From 62e92c381d66bc78c81f540714368e8f13912c1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jeremy=20Lain=C3=A9?= Date: Tue, 30 Jun 2009 13:29:10 +0200 Subject: linux-2.6.29: remove SQN11xx hack for boc01 --- recipes/linux/linux_2.6.29.bb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/recipes/linux/linux_2.6.29.bb b/recipes/linux/linux_2.6.29.bb index dfed6f2a65..8f48dbcf3c 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 = "r6" S = "${WORKDIR}/linux-2.6.29" @@ -22,7 +22,6 @@ SRC_URI = "${KERNELORG_MIRROR}/pub/linux/kernel/v2.6/linux-2.6.29.tar.bz2 \ 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 \ -- cgit v1.2.3 From 5b5a19ac0378bee6786d5365ada8f849429f26be Mon Sep 17 00:00:00 2001 From: David Batzle Date: Tue, 30 Jun 2009 15:55:23 +0200 Subject: irrlicht: add recipe to build irrlicht demos against a GLES1.1 lib --- recipes/irrlicht/files/irrlicht_beagle.diff | 865 ++++++++++++++++++++++++++++ recipes/irrlicht/irrlicht-examples-gles.bb | 42 ++ 2 files changed, 907 insertions(+) create mode 100644 recipes/irrlicht/files/irrlicht_beagle.diff create mode 100644 recipes/irrlicht/irrlicht-examples-gles.bb 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( 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}/" + -- cgit v1.2.3 From 0c88cc6cb7604802c845da97952fc95a3d3e8a0e Mon Sep 17 00:00:00 2001 From: Koen Kooi Date: Tue, 30 Jun 2009 16:54:48 +0200 Subject: lirc: update to 0.8.5 --- conf/checksums.ini | 8 +++++ recipes/lirc/lirc-modules_0.8.5.bb | 30 +++++++++++++++++ recipes/lirc/lirc_0.8.5.bb | 67 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 105 insertions(+) create mode 100644 recipes/lirc/lirc-modules_0.8.5.bb create mode 100644 recipes/lirc/lirc_0.8.5.bb diff --git a/conf/checksums.ini b/conf/checksums.ini index 7fb09b94a4..83bd082078 100644 --- a/conf/checksums.ini +++ b/conf/checksums.ini @@ -15582,6 +15582,10 @@ sha256=8bc1c6cfc6a9c312c8f5b8cc79b501e26b438c96a2d245f42e50bfb353617716 md5=1101c44d542807a4f9f5e33349b5bf56 sha256=d6e68935e69c82bba091cb102bbc4b63428eb8deb94c7d00e14ea3b673e10712 +[http://downloads.sourceforge.net/lirc/lirc-0.8.5.tar.gz] +md5=a9e44df2adbd71be586e0df6304605cc +sha256=ab5752e9af2df5f4cd2bd6d4f13872fbb519d7fa1bd3f187cc14dcb163440234 + [http://lisa-home.sourceforge.net/src/lisa-0.2.2.tar.bz2] md5=cba116a4880f77205e0813d93bf14310 sha256=986a923a5247468db1d2a03e93268f4025ae5dc27e911dafc7b37e6a802122db @@ -17594,6 +17598,10 @@ sha256=e42d3b3f30de0c1ad0a86aa039b35cf2bf64c7f64c29ee333cbf934784639973 md5=0e942f22864e601406a994420231075b sha256=28e76af491ea3696885e4558ae2f5628a4b9ebdbefc2f1d9cf1b35db2813e497 +[ftp://ftp.netperf.org/netperf/netperf-2.4.4.tar.bz2] +md5=0e942f22864e601406a994420231075b +sha256=28e76af491ea3696885e4558ae2f5628a4b9ebdbefc2f1d9cf1b35db2813e497 + [ftp://ftp.debian.org/debian/pool/non-free/n/netperf/netperf_2.3.orig.tar.gz] md5=b50e49d5f0d3780438af0027a182b997 sha256=0578f4fafb309adf3413c9f56076b1b16476cb71e83c02ff7efafad172d91adb 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}" -- cgit v1.2.3 From dc6b5e572953485d53ab314ba2bf7cd60660e387 Mon Sep 17 00:00:00 2001 From: Koen Kooi Date: Tue, 30 Jun 2009 17:46:52 +0200 Subject: myththv: bump SRCREV * this fixes the "people look like smurfs" bug: http://svn.mythtv.org/trac/ticket/5670 --- recipes/mythtv/mythtv_0.21.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 += " \ -- cgit v1.2.3 From cbe3798f416e1153ab58652ed829dac1b69068ff Mon Sep 17 00:00:00 2001 From: Koen Kooi Date: Tue, 30 Jun 2009 19:46:32 +0200 Subject: sugarbase: inherit gnome for gconf and icon helpers --- recipes/sugar/sugar-base_0.83.2.bb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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" -- cgit v1.2.3 From bb6a5a722b0845baad602a51daf3304e6c2ef1ad Mon Sep 17 00:00:00 2001 From: Koen Kooi Date: Tue, 30 Jun 2009 20:16:32 +0200 Subject: u-boot git: update beagleboard pinmux --- recipes/u-boot/u-boot-git/new-pinmux.patch | 71 ++++++++++++++++++++++++++++++ recipes/u-boot/u-boot_git.bb | 3 +- 2 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 recipes/u-boot/u-boot-git/new-pinmux.patch 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 +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..d87e5a1529 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}" -- cgit v1.2.3 From 378be0dcdc32126268b05329b980dd574d695fe9 Mon Sep 17 00:00:00 2001 From: Ottavio Campana Date: Tue, 9 Jun 2009 21:21:23 +0000 Subject: live555: update to 2009.06 Signed-off-by: Koen Kooi --- conf/checksums.ini | 4 ++++ recipes/live555/live555_20090602.bb | 42 +++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 recipes/live555/live555_20090602.bb diff --git a/conf/checksums.ini b/conf/checksums.ini index 83bd082078..abbaa2de7e 100644 --- a/conf/checksums.ini +++ b/conf/checksums.ini @@ -1,3 +1,7 @@ +[http://www.live555.com/liveMedia/public/live.2009.06.02.tar.gz] +md5=088f848b64cef1d54034bc24cfa3c156 +sha256=66c54241bfcc7ea42fe40e1c93739be79a3c065390c4163c0f2647ac45c24758 + [http://www.directfb.org/downloads/Extras/++DFB-0.9.25.tar.gz] md5=c6a2705f6210d8ede50a947b375f1c0b sha256=b3dbf01563dd60d63cff543ea8cd0c885381e78ecbbab8ff176e46df3f198a88 diff --git a/recipes/live555/live555_20090602.bb b/recipes/live555/live555_20090602.bb new file mode 100644 index 0000000000..8d1a314f35 --- /dev/null +++ b/recipes/live555/live555_20090602.bb @@ -0,0 +1,42 @@ +# 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" + +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 () { + cp -a ${D}${includedir}/* ${STAGING_INCDIR} + cp -a ${D}${libdir}/* ${STAGING_LIBDIR} +} + -- cgit v1.2.3 From 9628f84b91574ba4c1f968ae49d8cbca3544f01c Mon Sep 17 00:00:00 2001 From: Koen Kooi Date: Tue, 30 Jun 2009 21:50:22 +0200 Subject: linux-omap 2.6.29: add support for mmc1 on expansion connector --- conf/machine/include/omap3.inc | 2 +- recipes/linux/linux-omap_2.6.29.bb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/conf/machine/include/omap3.inc b/conf/machine/include/omap3.inc index 8e90453d4c..97327f0db7 100644 --- a/conf/machine/include/omap3.inc +++ b/conf/machine/include/omap3.inc @@ -1,7 +1,7 @@ require conf/machine/include/tune-cortexa8.inc PREFERRED_PROVIDER_virtual/kernel = "linux-omap" # Increase this everytime you change something in the kernel -MACHINE_KERNEL_PR = "r37" +MACHINE_KERNEL_PR = "r38" KERNEL_IMAGETYPE = "uImage" diff --git a/recipes/linux/linux-omap_2.6.29.bb b/recipes/linux/linux-omap_2.6.29.bb index 67a4803893..4193edaf8d 100644 --- a/recipes/linux/linux-omap_2.6.29.bb +++ b/recipes/linux/linux-omap_2.6.29.bb @@ -162,6 +162,7 @@ SRC_URI_append = " \ 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 = " \ -- cgit v1.2.3 From 7ad802292d40022c87c43bcdce7df851b0dc42ab Mon Sep 17 00:00:00 2001 From: Denys Dmytriyenko Date: Tue, 30 Jun 2009 16:21:17 -0400 Subject: linux-davinci: update to the latest staging/vpfe branch Signed-off-by: Denys Dmytriyenko --- conf/machine/include/davinci.inc | 2 +- recipes/linux/linux-davinci_git.bb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/conf/machine/include/davinci.inc b/conf/machine/include/davinci.inc index af9dc0ff9c..32211a07a5 100644 --- a/conf/machine/include/davinci.inc +++ b/conf/machine/include/davinci.inc @@ -1,7 +1,7 @@ require conf/machine/include/tune-arm926ejs.inc # Increase this everytime you change something in the kernel -MACHINE_KERNEL_PR = "r8" +MACHINE_KERNEL_PR = "r9" TARGET_ARCH = "arm" 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" -- cgit v1.2.3 From 60b572f455f2e44cae5745285b8145b66ab695d4 Mon Sep 17 00:00:00 2001 From: Denys Dmytriyenko Date: Tue, 30 Jun 2009 16:26:42 -0400 Subject: linux-davinci: add formal 2.6.30 version Signed-off-by: Denys Dmytriyenko --- recipes/linux/linux-davinci_2.6.30.bb | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 recipes/linux/linux-davinci_2.6.30.bb 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" -- cgit v1.2.3 From 0f691ce3239a8eb24a64610742105ad923309110 Mon Sep 17 00:00:00 2001 From: Denys Dmytriyenko Date: Tue, 30 Jun 2009 16:34:27 -0400 Subject: MAINTAINERS: add my entry --- MAINTAINERS | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 6313ee7282..e6466618a5 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -46,6 +46,12 @@ Interests: Support in OE for single board computers, web application support Machines: cm-x270, em-x270, gesbc-9302 Recipes: mono, argtable, vala, socketcan +Person: Denys Dmytriyenko +Mail: denis@denix.org +Machines: davinci (dm6446-evm, dm6467-evm, dm355-evm, dm365-evm), omap3evm +Distros: Ã…ngström, Arago +Interests: External Toolchains + Person: Erik Hovland Mail: erik@hovland.org Distros: familiar -- cgit v1.2.3 From 9236bee4400b2db9cddbdef8c08e3f71e2f322f7 Mon Sep 17 00:00:00 2001 From: Koen Kooi Date: Tue, 30 Jun 2009 22:41:49 +0200 Subject: php-native: add 5.3.0 --- conf/checksums.ini | 12 ++++++++---- recipes/php/php-5.3.0/acinclude-xml2-config.patch | 18 ++++++++++++++++++ recipes/php/php-5.3.0/pear-makefile.patch | 11 +++++++++++ recipes/php/php-native_5.3.0.bb | 3 +++ 4 files changed, 40 insertions(+), 4 deletions(-) create mode 100644 recipes/php/php-5.3.0/acinclude-xml2-config.patch create mode 100644 recipes/php/php-5.3.0/pear-makefile.patch create mode 100644 recipes/php/php-native_5.3.0.bb diff --git a/conf/checksums.ini b/conf/checksums.ini index abbaa2de7e..61e3a6c87d 100644 --- a/conf/checksums.ini +++ b/conf/checksums.ini @@ -1,7 +1,3 @@ -[http://www.live555.com/liveMedia/public/live.2009.06.02.tar.gz] -md5=088f848b64cef1d54034bc24cfa3c156 -sha256=66c54241bfcc7ea42fe40e1c93739be79a3c065390c4163c0f2647ac45c24758 - [http://www.directfb.org/downloads/Extras/++DFB-0.9.25.tar.gz] md5=c6a2705f6210d8ede50a947b375f1c0b sha256=b3dbf01563dd60d63cff543ea8cd0c885381e78ecbbab8ff176e46df3f198a88 @@ -15610,6 +15606,10 @@ sha256=ee3edf1ea89a90f2b7f82ad09b83c25dc8ea8ca7cf0fce2aa921f897929b2bb9 md5=6f15406664ef31172c68d46567569bb8 sha256=9532b981c9b8974ceedd3d25a8f9a0e167a92c9da0dece47f34a4ec34e34b1cf +[http://www.live555.com/liveMedia/public/live.2009.06.02.tar.gz] +md5=088f848b64cef1d54034bc24cfa3c156 +sha256=66c54241bfcc7ea42fe40e1c93739be79a3c065390c4163c0f2647ac45c24758 + [http://llvm.org/releases/1.9/llvm-1.9.tar.gz] md5=866ba97420f5ce978b6a6b1cb4338890 sha256=17b82323151925ff5a7ad09a21781a0fa50ead4b87a339cee262271e4ededa13 @@ -19194,6 +19194,10 @@ sha256=5cac1e70df5019ebdfdab2e0b8b216f7fdf56b9895c9f68c993313918249bba3 md5=7380ffecebd95c6edb317ef861229ebd sha256=1892b2dd50b56ae2c9aec027fcd9035b76673f113555bc2bc1007bab8ae4db81 +[http://us2.php.net/distributions/php-5.3.0.tar.bz2] +md5=846760cd655c98dfd86d6d97c3d964b0 +sha256=83c9d86f830f8b188c70d3554d07b7416af90fd9e06d84340ffda58c09e58357 + [http://efault.net/npat/hacks/picocom/dist/picocom-1.3.tar.gz] md5=21865bf2891222082afc44afdd80aeaa sha256=ed3e0190a1940cf08a167429aa3fd25b3ae7313fdf126f851a9abccc89845ee6 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" -- cgit v1.2.3 From 814775d0a9db1776f2bbcbe5517ed65b9a435ef9 Mon Sep 17 00:00:00 2001 From: Stanislav Brabec Date: Tue, 30 Jun 2009 21:50:52 +0000 Subject: libgmime: Packaged versions 2.2.23 (as libgmime) and 2.4.7 (as libgmime-2.4). --- conf/checksums.ini | 8 ++++++ recipes/libgmime/files/configure-cross.patch | 42 ++++++++++++++++++++++++++++ recipes/libgmime/files/iconv-detect.h | 5 ++++ recipes/libgmime/libgmime-2.4_2.4.7.bb | 15 ++++++++++ recipes/libgmime/libgmime_2.2.23.bb | 20 +++++++++++++ 5 files changed, 90 insertions(+) create mode 100644 recipes/libgmime/files/configure-cross.patch create mode 100644 recipes/libgmime/files/iconv-detect.h create mode 100644 recipes/libgmime/libgmime-2.4_2.4.7.bb create mode 100644 recipes/libgmime/libgmime_2.2.23.bb diff --git a/conf/checksums.ini b/conf/checksums.ini index abbaa2de7e..b8d3352193 100644 --- a/conf/checksums.ini +++ b/conf/checksums.ini @@ -8082,6 +8082,14 @@ sha256=69d8553b351c461a8e36ed633aa2da14fdb79423b9ce0e6d3174e5ace09fadd8 md5=ed99c382471294896f576e5f77694142 sha256=39ef812217a76982947a7ac3b4a97e8303466a3dd93709366d1559e0a7ec8a46 +[http://ftp.acc.umu.se/pub/GNOME/sources/gmime/2.2/gmime-2.2.23.tar.bz2] +md5=9f254eb989e0506243da6fde7f164998 +sha256=d5420eef50372d24eaecde93ea4c8ec55f5bf24c9e0f6abbded76e5dbd6a2d76 + +[http://ftp.acc.umu.se/pub/GNOME/sources/gmime/2.4/gmime-2.4.7.tar.bz2] +md5=0fb23dbb1ed6934ab577e90269cd901f +sha256=bf75214018bb1ae82c797e79d52db2c37a8d3d9f002a737f12960fa2b1022dbd + [http://download.gna.org/getfem/stable/gmm-3.0.tar.gz] md5=e543571d8812357374699491014abd58 sha256=f7fad050ce4641a43c2249fd691e514a0ee6afc09b4ec54c8c30038d0c2783d1 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 +} -- cgit v1.2.3 From f73238a444ebe83621d786db188491c8a30aa129 Mon Sep 17 00:00:00 2001 From: Denys Dmytriyenko Date: Tue, 30 Jun 2009 18:20:00 -0400 Subject: alsa-utils: add 1.0.20 version --- conf/checksums.ini | 12 ++-- .../alsa-utils-remove-xmlto.patch | 18 ------ recipes/alsa/alsa-utils_1.0.19.bb | 4 +- recipes/alsa/alsa-utils_1.0.20.bb | 66 ++++++++++++++++++++++ .../files/alsa-utils-remove-xmlto-1.0.19plus.patch | 18 ++++++ 5 files changed, 94 insertions(+), 24 deletions(-) delete mode 100644 recipes/alsa/alsa-utils-1.0.19/alsa-utils-remove-xmlto.patch create mode 100644 recipes/alsa/alsa-utils_1.0.20.bb create mode 100644 recipes/alsa/files/alsa-utils-remove-xmlto-1.0.19plus.patch diff --git a/conf/checksums.ini b/conf/checksums.ini index b8d3352193..47055cf648 100644 --- a/conf/checksums.ini +++ b/conf/checksums.ini @@ -1,7 +1,3 @@ -[http://www.live555.com/liveMedia/public/live.2009.06.02.tar.gz] -md5=088f848b64cef1d54034bc24cfa3c156 -sha256=66c54241bfcc7ea42fe40e1c93739be79a3c065390c4163c0f2647ac45c24758 - [http://www.directfb.org/downloads/Extras/++DFB-0.9.25.tar.gz] md5=c6a2705f6210d8ede50a947b375f1c0b sha256=b3dbf01563dd60d63cff543ea8cd0c885381e78ecbbab8ff176e46df3f198a88 @@ -1494,6 +1490,10 @@ sha256=ea0ae914cc8d46254dc02ca2b227d379d0eb1d76a3960907e57f26f2ec584aef md5=5ff0379c707c1a29083233edc9ab4e06 sha256=1f4924f5ae7857ce64a3d6ecbeb98133c74ff1ead2b0f48187623d6e4b838cad +[ftp://ftp.alsa-project.org/pub/utils/alsa-utils-1.0.20.tar.bz2] +md5=6837e673ef19da96d8bd2f9e18cd9574 +sha256=07f08286b3860f60d1794cc0de4407a53adcd4b6f065531d6dcef02b0c56a0cf + [http://www.panix.com/~gesslein/am.tgz] md5=df7535050d4bbe57c5d1243c8ec2479e sha256=13ab5d2045d902b627725e7cf4fc82df3ec2e714e85e42b93bd48af7af9bffdc @@ -15618,6 +15618,10 @@ sha256=ee3edf1ea89a90f2b7f82ad09b83c25dc8ea8ca7cf0fce2aa921f897929b2bb9 md5=6f15406664ef31172c68d46567569bb8 sha256=9532b981c9b8974ceedd3d25a8f9a0e167a92c9da0dece47f34a4ec34e34b1cf +[http://www.live555.com/liveMedia/public/live.2009.06.02.tar.gz] +md5=088f848b64cef1d54034bc24cfa3c156 +sha256=66c54241bfcc7ea42fe40e1c93739be79a3c065390c4163c0f2647ac45c24758 + [http://llvm.org/releases/1.9/llvm-1.9.tar.gz] md5=866ba97420f5ce978b6a6b1cb4338890 sha256=17b82323151925ff5a7ad09a21781a0fa50ead4b87a339cee262271e4ededa13 diff --git a/recipes/alsa/alsa-utils-1.0.19/alsa-utils-remove-xmlto.patch b/recipes/alsa/alsa-utils-1.0.19/alsa-utils-remove-xmlto.patch deleted file mode 100644 index 53ff95a886..0000000000 --- a/recipes/alsa/alsa-utils-1.0.19/alsa-utils-remove-xmlto.patch +++ /dev/null @@ -1,18 +0,0 @@ -Index: alsa-utils-1.0.19/alsactl/Makefile.am -=================================================================== ---- alsa-utils-1.0.19.orig/alsactl/Makefile.am 2009-06-24 01:08:16.000000000 -0400 -+++ alsa-utils-1.0.19/alsactl/Makefile.am 2009-06-24 01:08:26.000000000 -0400 -@@ -2,13 +2,7 @@ - - sbin_PROGRAMS=alsactl - man_MANS=alsactl.1 --if USE_XMLTO --man_MANS += alsactl_init.7 --endif - EXTRA_DIST=alsactl.1 alsactl_init.xml - - alsactl_SOURCES=alsactl.c state.c utils.c init_parse.c - noinst_HEADERS=alsactl.h list.h init_sysdeps.c init_utils_string.c init_utils_run.c init_sysfs.c -- --%.7: %.xml -- xmlto man $? 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/files/alsa-utils-remove-xmlto-1.0.19plus.patch b/recipes/alsa/files/alsa-utils-remove-xmlto-1.0.19plus.patch new file mode 100644 index 0000000000..53ff95a886 --- /dev/null +++ b/recipes/alsa/files/alsa-utils-remove-xmlto-1.0.19plus.patch @@ -0,0 +1,18 @@ +Index: alsa-utils-1.0.19/alsactl/Makefile.am +=================================================================== +--- alsa-utils-1.0.19.orig/alsactl/Makefile.am 2009-06-24 01:08:16.000000000 -0400 ++++ alsa-utils-1.0.19/alsactl/Makefile.am 2009-06-24 01:08:26.000000000 -0400 +@@ -2,13 +2,7 @@ + + sbin_PROGRAMS=alsactl + man_MANS=alsactl.1 +-if USE_XMLTO +-man_MANS += alsactl_init.7 +-endif + EXTRA_DIST=alsactl.1 alsactl_init.xml + + alsactl_SOURCES=alsactl.c state.c utils.c init_parse.c + noinst_HEADERS=alsactl.h list.h init_sysdeps.c init_utils_string.c init_utils_run.c init_sysfs.c +- +-%.7: %.xml +- xmlto man $? -- cgit v1.2.3 From 7354ce1960407a294d76edaab5e34a98d888c2b1 Mon Sep 17 00:00:00 2001 From: Andrea Adami Date: Wed, 1 Jul 2009 00:29:43 +0200 Subject: zaurusd: rework patches - revert 8c942c2a74598c84dbe9646bbd6bbde6525ca53f - minimal fix to 35b530346188557e7b81bcb69ccea27f60766177 - s/event1/touchscreen0/ is done in a separate patch --- recipes/zaurusd/files/avoid-rotated-server.patch | 7 ++----- recipes/zaurusd/files/use-ts-symlink-instead-of-hardcoding.diff | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) 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 diff --git a/recipes/zaurusd/files/use-ts-symlink-instead-of-hardcoding.diff b/recipes/zaurusd/files/use-ts-symlink-instead-of-hardcoding.diff index 55118f6aaa..9c418ec5f9 100644 --- a/recipes/zaurusd/files/use-ts-symlink-instead-of-hardcoding.diff +++ b/recipes/zaurusd/files/use-ts-symlink-instead-of-hardcoding.diff @@ -15,7 +15,7 @@ SWITCH_EVENT_DEVICE=/dev/input/event0 TSKEYS_CONF=@appconfdir@/tskeys/zaurus-cxx00.conf --TSKEYS_DEVICE=/dev/input/touchscreen0 +-TSKEYS_DEVICE=/dev/input/event1 +TSKEYS_DEVICE=/dev/input/touchscreen0 ALSA_MIXER_INIT=@appconfdir@/alsa/cxx00-default.state -- cgit v1.2.3 From caa7a37b973c1bd178f519d9fd5460e0bc040fc3 Mon Sep 17 00:00:00 2001 From: Koen Kooi Date: Wed, 1 Jul 2009 01:18:54 +0200 Subject: linux-omap 2..29: add mising patch --- .../beagleboard/tincantools-puppy.diff | 66 ++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 recipes/linux/linux-omap-2.6.29/beagleboard/tincantools-puppy.diff 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, -- cgit v1.2.3 From f35c640b686fa967625f6467bed2b77739cbd374 Mon Sep 17 00:00:00 2001 From: Denys Dmytriyenko Date: Tue, 30 Jun 2009 19:20:20 -0400 Subject: gdbserver: add 6.6 version - old, but GPLv2 --- recipes/gdb/gdbserver_6.6.bb | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 recipes/gdb/gdbserver_6.6.bb 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" -- cgit v1.2.3 From ab81f3a9ebc9906412d4a0a3e8d58bf6155f1506 Mon Sep 17 00:00:00 2001 From: Florian Boor Date: Wed, 1 Jul 2009 01:59:18 +0200 Subject: tx25.conf: Use correct kernel --- conf/machine/tx25.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/machine/tx25.conf b/conf/machine/tx25.conf index 92a8fef3df..abe1135dce 100644 --- a/conf/machine/tx25.conf +++ b/conf/machine/tx25.conf @@ -9,7 +9,7 @@ MACHINE_FEATURES = "kernel26 apm alsa ext2 pcmcia usbhost usbgadget screen camer GUI_MACHINE_CLASS = "bigscreen" PREFERRED_PROVIDER_virtual/kernel = "linux" -PREFERRED_VERSION_linux = "2.6.30" +PREFERRED_VERSION_linux = "2.6.30-rc4" PREFERRED_PROVIDER_virtual/xserver = "xserver-kdrive" XSERVER = "xserver-kdrive-fbdev" -- cgit v1.2.3 From 599bfe6146ea5a403c14e6b8a2c60be69daac3f9 Mon Sep 17 00:00:00 2001 From: Florian Boor Date: Wed, 1 Jul 2009 02:00:41 +0200 Subject: linux: Remove broken tx25 support from 2.6.30 --- recipes/linux/linux-2.6.30/tx25/defconfig | 1203 -- .../linux-2.6.30/tx25/linux-2.6.30-rc4-karo.diff | 17631 ------------------- recipes/linux/linux_2.6.30.bb | 3 - 3 files changed, 18837 deletions(-) delete mode 100644 recipes/linux/linux-2.6.30/tx25/defconfig delete mode 100644 recipes/linux/linux-2.6.30/tx25/linux-2.6.30-rc4-karo.diff diff --git a/recipes/linux/linux-2.6.30/tx25/defconfig b/recipes/linux/linux-2.6.30/tx25/defconfig deleted file mode 100644 index db27e0251f..0000000000 --- a/recipes/linux/linux-2.6.30/tx25/defconfig +++ /dev/null @@ -1,1203 +0,0 @@ -# -# 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_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 - -# -# 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=y -CONFIG_NETCONSOLE_DYNAMIC=y -CONFIG_NETPOLL=y -# CONFIG_NETPOLL_TRAP is not set -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 -# 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 --git a/recipes/linux/linux-2.6.30/tx25/linux-2.6.30-rc4-karo.diff b/recipes/linux/linux-2.6.30/tx25/linux-2.6.30-rc4-karo.diff deleted file mode 100644 index 6926571c2e..0000000000 --- a/recipes/linux/linux-2.6.30/tx25/linux-2.6.30-rc4-karo.diff +++ /dev/null @@ -1,17631 +0,0 @@ -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 @@ -+# -+# 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_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 -+ -+# -+# 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=y -+CONFIG_NETCONSOLE_DYNAMIC=y -+CONFIG_NETPOLL=y -+# CONFIG_NETPOLL_TRAP is not set -+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 -+# 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_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 -+ -+# -+# 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=y -+CONFIG_NETCONSOLE_DYNAMIC=y -+CONFIG_NETPOLL=y -+# CONFIG_NETPOLL_TRAP is not set -+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 -+# 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/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 - - config MACH_MX21 - bool "i.MX21 support" -+ select ARCH_MXC_IOMUX_V2 -+ select ARCH_MXC_HAS_NFC_V1 - help - This enables support for Freescale's MX2 based i.MX21 processor. - - config MACH_MX27 - bool "i.MX27 support" -+ select ARCH_MXC_IOMUX_V2 -+ select ARCH_MXC_HAS_NFC_V1 - 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 PHYLIB if FEC -+ help -+ This enables support for Freescale's MX2 based i.MX25 processor. -+ - endchoice - - comment "MX2 platforms:" -@@ -39,6 +51,26 @@ config MACH_PCM038 - Include support for phyCORE-i.MX27 (aka pcm038) platform. This - includes specific configurations for the module and its peripherals. - -+config MACH_TX25 -+ bool "Support Ka-Ro electronics TX25 module" -+ depends on MACH_MX25 -+ help -+ Include support for Ka-Ro TX25 processor module -+ -+config KARO_DEBUG -+ bool "Enable Ka-Ro specific debug messages" -+ depends on MACH_TX25 || MACH_TX27 -+ help -+ Compile the architecture specific files with -DDEBUG to enable -+ additional debug messages -+ -+config MACH_STK5_BASEBOARD -+ bool "Ka-Ro Starterkit-5 (STK5) development board" -+ depends on MACH_TX27 || MACH_TX25 -+ help -+ This adds board specific devices that can be found on Ka-Ro's -+ STK5 evaluation board. -+ - choice - prompt "Baseboard" - depends on MACH_PCM038 -@@ -60,3 +92,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 -@@ -2,17 +2,31 @@ - # Makefile for the linux kernel. - # - -+ifeq ($(CONFIG_KARO_DEBUG),y) -+ EXTRA_CFLAGS += -DDEBUG -+endif -+ - # Object file lists. - --obj-y := generic.o devices.o serial.o -+obj-y := generic.o serial.o -+obj-$(CONFIG_MACH_MX25) += devices_mx25.o -+ifeq ($(CONFIG_MACH_MX25),) -+obj-y += devices.o -+endif -+ -+obj-$(CONFIG_MACH_MX21) += clock_imx21.o - --obj-$(CONFIG_MACH_MX21) += clock_imx21.o -+obj-$(CONFIG_MACH_MX25) += clock_imx25.o -+obj-$(CONFIG_MACH_MX25) += cpu_imx25.o - --obj-$(CONFIG_MACH_MX27) += cpu_imx27.o --obj-$(CONFIG_MACH_MX27) += clock_imx27.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 -+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 -+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 -@@ -5,3 +5,7 @@ initrd_phys-$(CONFIG_MACH_MX21) := 0xC08 - zreladdr-$(CONFIG_MACH_MX27) := 0xA0008000 - params_phys-$(CONFIG_MACH_MX27) := 0xA0000100 - initrd_phys-$(CONFIG_MACH_MX27) := 0xA0800000 -+ -+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 -@@ -890,7 +890,7 @@ static struct clk clko_clk = { - .con_id = n, \ - .clk = &c, \ - }, --static struct clk_lookup lookups[] __initdata = { -+static struct clk_lookup lookups[] = { - /* 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 @@ -+/* -+ * Copyright 2008 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 -+ */ -+ -+/* based on mach-mx27/clock.c */ -+ -+#include -+#include -+#include -+//#include -+ -+#include -+//#include -+ -+#include -+#include -+#include -+ -+/* Register offsets */ -+#define MXC_CCM_MPCTL (IO_ADDRESS(CCM_BASE_ADDR) + 0x00) -+#define MXC_CCM_UPCTL (IO_ADDRESS(CCM_BASE_ADDR) + 0x04) -+#define MXC_CCM_CCTL (IO_ADDRESS(CCM_BASE_ADDR) + 0x08) -+#define MXC_CCM_CGCR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x0C) -+#define MXC_CCM_CGCR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x10) -+#define MXC_CCM_CGCR2 (IO_ADDRESS(CCM_BASE_ADDR) + 0x14) -+#define MXC_CCM_PCDR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x18) -+#define MXC_CCM_PCDR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x1C) -+#define MXC_CCM_PCDR2 (IO_ADDRESS(CCM_BASE_ADDR) + 0x20) -+#define MXC_CCM_PCDR3 (IO_ADDRESS(CCM_BASE_ADDR) + 0x24) -+#define MXC_CCM_RCSR (IO_ADDRESS(CCM_BASE_ADDR) + 0x28) -+#define MXC_CCM_CRDR (IO_ADDRESS(CCM_BASE_ADDR) + 0x2C) -+#define MXC_CCM_DCVR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x30) -+#define MXC_CCM_DCVR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x34) -+#define MXC_CCM_DCVR2 (IO_ADDRESS(CCM_BASE_ADDR) + 0x38) -+#define MXC_CCM_DCVR3 (IO_ADDRESS(CCM_BASE_ADDR) + 0x3C) -+#define MXC_CCM_LTR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x40) -+#define MXC_CCM_LTR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x44) -+#define MXC_CCM_LTR2 (IO_ADDRESS(CCM_BASE_ADDR) + 0x48) -+#define MXC_CCM_LTR3 (IO_ADDRESS(CCM_BASE_ADDR) + 0x4C) -+#define MXC_CCM_LTBR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x50) -+#define MXC_CCM_LTBR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x54) -+#define MXC_CCM_PMCR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x58) -+#define MXC_CCM_PMCR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x5C) -+#define MXC_CCM_PMCR2 (IO_ADDRESS(CCM_BASE_ADDR) + 0x60) -+#define MXC_CCM_MCR (IO_ADDRESS(CCM_BASE_ADDR) + 0x64) -+ -+#define MXC_CCM_MPCTL_BRMO (1 << 31) -+#define MXC_CCM_MPCTL_PD_OFFSET 26 -+#define MXC_CCM_MPCTL_PD_MASK (0xf << 26) -+#define MXC_CCM_MPCTL_MFD_OFFSET 16 -+#define MXC_CCM_MPCTL_MFD_MASK (0x3ff << 16) -+#define MXC_CCM_MPCTL_MFI_OFFSET 10 -+#define MXC_CCM_MPCTL_MFI_MASK (0xf << 10) -+#define MXC_CCM_MPCTL_MFN_OFFSET 0 -+#define MXC_CCM_MPCTL_MFN_MASK 0x3ff -+#define MXC_CCM_MPCTL_LF (1 << 15) -+ -+#define MXC_CCM_UPCTL_BRMO (1 << 31) -+#define MXC_CCM_UPCTL_PD_OFFSET 26 -+#define MXC_CCM_UPCTL_PD_MASK (0xf << 26) -+#define MXC_CCM_UPCTL_MFD_OFFSET 16 -+#define MXC_CCM_UPCTL_MFD_MASK (0x3ff << 16) -+#define MXC_CCM_UPCTL_MFI_OFFSET 10 -+#define MXC_CCM_UPCTL_MFI_MASK (0xf << 10) -+#define MXC_CCM_UPCTL_MFN_OFFSET 0 -+#define MXC_CCM_UPCTL_MFN_MASK 0x3ff -+#define MXC_CCM_UPCTL_LF (1 << 15) -+ -+#define MXC_CCM_CCTL_ARM_OFFSET 30 -+#define MXC_CCM_CCTL_ARM_MASK (0x3 << 30) -+#define MXC_CCM_CCTL_AHB_OFFSET 28 -+#define MXC_CCM_CCTL_AHB_MASK (0x3 << 28) -+#define MXC_CCM_CCTL_MPLL_RST (1 << 27) -+#define MXC_CCM_CCTL_UPLL_RST (1 << 26) -+#define MXC_CCM_CCTL_LP_CTL_OFFSET 24 -+#define MXC_CCM_CCTL_LP_CTL_MASK (0x3 << 24) -+#define MXC_CCM_CCTL_LP_MODE_RUN (0x0 << 24) -+#define MXC_CCM_CCTL_LP_MODE_WAIT (0x1 << 24) -+#define MXC_CCM_CCTL_LP_MODE_DOZE (0x2 << 24) -+#define MXC_CCM_CCTL_LP_MODE_STOP (0x3 << 24) -+#define MXC_CCM_CCTL_UPLL_DISABLE (1 << 23) -+#define MXC_CCM_CCTL_MPLL_BYPASS (1 << 22) -+#define MXC_CCM_CCTL_USB_DIV_OFFSET 16 -+#define MXC_CCM_CCTL_USB_DIV_MASK (0x3 << 16) -+#define MXC_CCM_CCTL_CG_CTRL (1 << 15) -+#define MXC_CCM_CCTL_ARM_SRC (1 << 14) -+ -+#define MXC_CCM_CGCR0_HCLK_ATA_OFFSET (16 + 0) -+#define MXC_CCM_CGCR0_HCLK_BROM_OFFSET (16 + 1) -+#define MXC_CCM_CGCR0_HCLK_CSI_OFFSET (16 + 2) -+#define MXC_CCM_CGCR0_HCLK_EMI_OFFSET (16 + 3) -+#define MXC_CCM_CGCR0_HCLK_ESAI_OFFSET (16 + 4) -+#define MXC_CCM_CGCR0_HCLK_ESDHC1_OFFSET (16 + 5) -+#define MXC_CCM_CGCR0_HCLK_ESDHC2_OFFSET (16 + 6) -+#define MXC_CCM_CGCR0_HCLK_FEC_OFFSET (16 + 7) -+#define MXC_CCM_CGCR0_HCLK_LCDC_OFFSET (16 + 8) -+#define MXC_CCM_CGCR0_HCLK_RTIC_OFFSET (16 + 9) -+#define MXC_CCM_CGCR0_HCLK_SDMA_OFFSET (16 + 10) -+#define MXC_CCM_CGCR0_HCLK_SLCDC_OFFSET (16 + 11) -+#define MXC_CCM_CGCR0_HCLK_USBOTG_OFFSET (16 + 12) -+ -+#define MXC_CCM_CGCR0_PER_CSI_OFFSET 0 -+#define MXC_CCM_CGCR0_PER_EPIT_OFFSET 1 -+#define MXC_CCM_CGCR0_PER_ESAI_OFFSET 2 -+#define MXC_CCM_CGCR0_PER_ESDHC1_OFFSET 3 -+#define MXC_CCM_CGCR0_PER_ESDHC2_OFFSET 4 -+#define MXC_CCM_CGCR0_PER_GPT_OFFSET 5 -+#define MXC_CCM_CGCR0_PER_I2C_OFFSET 6 -+#define MXC_CCM_CGCR0_PER_LCDC_OFFSET 7 -+#define MXC_CCM_CGCR0_PER_NFC_OFFSET 8 -+#define MXC_CCM_CGCR0_PER_OWIRE_OFFSET 9 -+#define MXC_CCM_CGCR0_PER_PWM_OFFSET 10 -+#define MXC_CCM_CGCR0_PER_SIM1_OFFSET 11 -+#define MXC_CCM_CGCR0_PER_SIM2_OFFSET 12 -+#define MXC_CCM_CGCR0_PER_SSI1_OFFSET 13 -+#define MXC_CCM_CGCR0_PER_SSI2_OFFSET 14 -+#define MXC_CCM_CGCR0_PER_UART_OFFSET 15 -+ -+#define MXC_CCM_CGCR1_AUDMUX_OFFSET 0 -+#define MXC_CCM_CGCR1_ATA_OFFSET 1 -+#define MXC_CCM_CGCR1_CAN1_OFFSET 2 -+#define MXC_CCM_CGCR1_CAN2_OFFSET 3 -+#define MXC_CCM_CGCR1_CSI_OFFSET 4 -+#define MXC_CCM_CGCR1_CSPI1_OFFSET 5 -+#define MXC_CCM_CGCR1_CSPI2_OFFSET 6 -+#define MXC_CCM_CGCR1_CSPI3_OFFSET 7 -+#define MXC_CCM_CGCR1_DRYICE_OFFSET 8 -+#define MXC_CCM_CGCR1_ECT_OFFSET 9 -+#define MXC_CCM_CGCR1_EPIT1_OFFSET 10 -+#define MXC_CCM_CGCR1_EPIT2_OFFSET 11 -+#define MXC_CCM_CGCR1_ESAI_OFFSET 12 -+#define MXC_CCM_CGCR1_ESDHC1_OFFSET 13 -+#define MXC_CCM_CGCR1_ESDHC2_OFFSET 14 -+#define MXC_CCM_CGCR1_FEC_OFFSET 15 -+#define MXC_CCM_CGCR1_GPIO1_OFFSET 16 -+#define MXC_CCM_CGCR1_GPIO2_OFFSET 17 -+#define MXC_CCM_CGCR1_GPIO3_OFFSET 18 -+#define MXC_CCM_CGCR1_GPT1_OFFSET 19 -+#define MXC_CCM_CGCR1_GPT2_OFFSET 20 -+#define MXC_CCM_CGCR1_GPT3_OFFSET 21 -+#define MXC_CCM_CGCR1_GPT4_OFFSET 22 -+#define MXC_CCM_CGCR1_I2C1_OFFSET 23 -+#define MXC_CCM_CGCR1_I2C2_OFFSET 24 -+#define MXC_CCM_CGCR1_I2C3_OFFSET 25 -+#define MXC_CCM_CGCR1_IIM_OFFSET 26 -+#define MXC_CCM_CGCR1_IOMUXC_OFFSET 27 -+#define MXC_CCM_CGCR1_KPP_OFFSET 28 -+#define MXC_CCM_CGCR1_LCDC_OFFSET 29 -+#define MXC_CCM_CGCR1_OWIRE_OFFSET 30 -+#define MXC_CCM_CGCR1_PWM1_OFFSET 31 -+ -+#define MXC_CCM_CGCR2_PWM2_OFFSET (32 - 32) -+#define MXC_CCM_CGCR2_PWM3_OFFSET (33 - 32) -+#define MXC_CCM_CGCR2_PWM4_OFFSET (34 - 32) -+#define MXC_CCM_CGCR2_RNGB_OFFSET (35 - 32) -+#define MXC_CCM_CGCR2_RTIC_OFFSET (36 - 32) -+#define MXC_CCM_CGCR2_SCC_OFFSET (37 - 32) -+#define MXC_CCM_CGCR2_SDMA_OFFSET (38 - 32) -+#define MXC_CCM_CGCR2_SIM1_OFFSET (39 - 32) -+#define MXC_CCM_CGCR2_SIM2_OFFSET (40 - 32) -+#define MXC_CCM_CGCR2_SLCDC_OFFSET (41 - 32) -+#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_UART1_OFFSET (46 - 32) -+#define MXC_CCM_CGCR2_UART2_OFFSET (47 - 32) -+#define MXC_CCM_CGCR2_UART3_OFFSET (48 - 32) -+#define MXC_CCM_CGCR2_UART4_OFFSET (49 - 32) -+#define MXC_CCM_CGCR2_UART5_OFFSET (50 - 32) -+#define MXC_CCM_CGCR2_WDOG_OFFSET (51 - 32) -+ -+#define MXC_CCM_PCDR1_PERDIV1_MASK 0x3f -+ -+#define MXC_CCM_MCR_USB_XTAL_MUX_OFFSET 31 -+#define MXC_CCM_MCR_CLKO_EN_OFFSET 30 -+#define MXC_CCM_MCR_CLKO_DIV_OFFSET 24 -+#define MXC_CCM_MCR_CLKO_DIV_MASK (0x3F << 24) -+#define MXC_CCM_MCR_CLKO_SEL_OFFSET 20 -+#define MXC_CCM_MCR_CLKO_SEL_MASK (0xF << 20) -+#define MXC_CCM_MCR_ESAI_CLK_MUX_OFFSET 19 -+#define MXC_CCM_MCR_SSI2_CLK_MUX_OFFSET 18 -+#define MXC_CCM_MCR_SSI1_CLK_MUX_OFFSET 17 -+#define MXC_CCM_MCR_USB_CLK_MUX_OFFSET 16 -+ -+#define MXC_CCM_MCR_PER_CLK_MUX_MASK (0xFFFF << 0) -+ -+#define OSC24M_CLK_FREQ 24000000 /* 24MHz reference clk */ -+#define OSC32K_CLK_FREQ 32768 /* 32.768kHz oscillator in */ -+ -+static struct clk mpll_clk; -+static struct clk upll_clk; -+static struct clk ahb_clk; -+static struct clk upll_24610k_clk; -+ -+static int _clk_enable(struct clk *clk) -+{ -+ unsigned long reg; -+ -+ if (!clk->enable_reg) -+ return 0; -+ -+ reg = __raw_readl(clk->enable_reg); -+ reg |= 1 << clk->enable_shift; -+ __raw_writel(reg, clk->enable_reg); -+ -+ return 0; -+} -+ -+static void _clk_disable(struct clk *clk) -+{ -+ unsigned long reg; -+ -+ if (!clk->enable_reg) -+ return; -+ -+ reg = __raw_readl(clk->enable_reg); -+ reg &= ~(1 << clk->enable_shift); -+ __raw_writel(reg, clk->enable_reg); -+} -+ -+static int _clk_upll_enable(struct clk *clk) -+{ -+ unsigned long reg; -+ -+ reg = __raw_readl(MXC_CCM_CCTL); -+ reg &= ~MXC_CCM_CCTL_UPLL_DISABLE; -+ __raw_writel(reg, MXC_CCM_CCTL); -+ -+ while (!(__raw_readl(MXC_CCM_UPCTL) & MXC_CCM_UPCTL_LF)) -+ cpu_relax(); -+ -+ return 0; -+} -+ -+static void _clk_upll_disable(struct clk *clk) -+{ -+ unsigned long reg; -+ -+ reg = __raw_readl(MXC_CCM_CCTL); -+ reg |= MXC_CCM_CCTL_UPLL_DISABLE; -+ __raw_writel(reg, MXC_CCM_CCTL); -+} -+ -+static int _perclk_enable(struct clk *clk) -+{ -+ unsigned long reg; -+ -+ reg = __raw_readl(MXC_CCM_CGCR0); -+ reg |= 1 << clk->id; -+ __raw_writel(reg, MXC_CCM_CGCR0); -+ -+ return 0; -+} -+ -+static void _perclk_disable(struct clk *clk) -+{ -+ unsigned long reg; -+ -+ reg = __raw_readl(MXC_CCM_CGCR0); -+ reg &= ~(1 << clk->id); -+ __raw_writel(reg, MXC_CCM_CGCR0); -+} -+ -+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) */ -+ signed long mfn; /* Multiplication Factor (Integer part) */ -+ signed long mfd; /* Multiplication Factor (Denominator Part) */ -+ signed long tmp; -+ unsigned long ref_freq = clk_get_rate(clk->parent); -+ -+ 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; -+ 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); -+ -+ mfn = (mfn + ((mfn < 0) ? 1024 : 0)) & 0x3ff; -+ pd--; -+ mfd--; -+ -+ /* Change the Pll value */ -+ reg = (mfi << MXC_CCM_MPCTL_MFI_OFFSET) | -+ (mfn << MXC_CCM_MPCTL_MFN_OFFSET) | -+ (mfd << MXC_CCM_MPCTL_MFD_OFFSET) | -+ (pd << MXC_CCM_MPCTL_PD_OFFSET); -+ -+ if (clk == &mpll_clk) { -+ printk(KERN_DEBUG "Changing MPCTL from %08x to %08lx\n", -+ __raw_readl(MXC_CCM_MPCTL), reg); -+ } else if (clk == &upll_clk) { -+ printk(KERN_DEBUG "Changing UPCTL from %08x to %08lx\n", -+ __raw_readl(MXC_CCM_UPCTL), reg); -+ } -+ if (clk == &mpll_clk) -+ __raw_writel(reg, MXC_CCM_MPCTL); -+ else if (clk == &upll_clk) -+ __raw_writel(reg, MXC_CCM_UPCTL); -+ return 0; -+} -+ -+static unsigned long _clk_pll_getrate(struct clk *clk) -+{ -+ unsigned long rate; -+ signed long mfi, mfn, mfd, pdf; -+ unsigned long ref_clk; -+ unsigned long reg; -+ -+ ref_clk = clk_get_rate(clk->parent); -+ -+ if (clk == &mpll_clk) { -+ reg = __raw_readl(MXC_CCM_MPCTL); -+ pdf = (reg & MXC_CCM_MPCTL_PD_MASK) >> MXC_CCM_MPCTL_PD_OFFSET; -+ mfd = (reg & MXC_CCM_MPCTL_MFD_MASK) >> MXC_CCM_MPCTL_MFD_OFFSET; -+ mfi = (reg & MXC_CCM_MPCTL_MFI_MASK) >> MXC_CCM_MPCTL_MFI_OFFSET; -+ mfn = (reg & MXC_CCM_MPCTL_MFN_MASK) >> MXC_CCM_MPCTL_MFN_OFFSET; -+ } else if (clk == &upll_clk) { -+ reg = __raw_readl(MXC_CCM_UPCTL); -+ pdf = (reg & MXC_CCM_UPCTL_PD_MASK) >> MXC_CCM_UPCTL_PD_OFFSET; -+ mfd = (reg & MXC_CCM_UPCTL_MFD_MASK) >> MXC_CCM_UPCTL_MFD_OFFSET; -+ mfi = (reg & MXC_CCM_UPCTL_MFI_MASK) >> MXC_CCM_UPCTL_MFI_OFFSET; -+ mfn = (reg & MXC_CCM_UPCTL_MFN_MASK) >> MXC_CCM_UPCTL_MFN_OFFSET; -+ } else { -+ BUG(); /* oops */ -+ } -+ -+ mfi = (mfi < 5) ? 5 : mfi; -+ rate = 2LL * ref_clk * mfn; -+ do_div(rate, mfd + 1); -+ rate = 2LL * ref_clk * mfi + rate; -+ do_div(rate, pdf + 1); -+ -+ return rate; -+} -+ -+static unsigned long _clk_cpu_round_rate(struct clk *clk, unsigned long rate) -+{ -+ int div = clk_get_rate(clk->parent) / rate; -+ -+ if (clk_get_rate(clk->parent) % rate) -+ div++; -+ -+ if (div > 4) -+ div = 4; -+ -+ return clk_get_rate(clk->parent) / div; -+} -+ -+static int _clk_cpu_set_rate(struct clk *clk, unsigned long rate) -+{ -+ int div, reg; -+ unsigned long cctl = __raw_readl(MXC_CCM_CCTL); -+ -+ div = clk_get_rate(clk->parent) / rate; -+ -+ if (div > 4 || div < 1 || ((clk_get_rate(clk->parent) / div) != rate)) -+ return -EINVAL; -+ div--; -+ -+ reg = (cctl & ~MXC_CCM_CCTL_ARM_MASK) | -+ (div << MXC_CCM_CCTL_ARM_OFFSET); -+ __raw_writel(reg, MXC_CCM_CCTL); -+ -+ return 0; -+} -+ -+static unsigned long _clk_cpu_getrate(struct clk *clk) -+{ -+ unsigned long div; -+ unsigned long cctl = __raw_readl(MXC_CCM_CCTL); -+ unsigned long rate; -+ -+ div = (cctl & MXC_CCM_CCTL_ARM_MASK) >> MXC_CCM_CCTL_ARM_OFFSET; -+ -+ rate = clk_get_rate(clk->parent) / (div + 1); -+ -+ if (cctl & MXC_CCM_CCTL_ARM_SRC) { -+ rate *= 3; -+ rate /= 4; -+ } -+ return rate; -+} -+ -+static unsigned long _clk_ahb_getrate(struct clk *clk) -+{ -+ unsigned long div; -+ unsigned long cctl = __raw_readl(MXC_CCM_CCTL); -+ -+ div = (cctl & MXC_CCM_CCTL_AHB_MASK) >> MXC_CCM_CCTL_AHB_OFFSET; -+ -+ return clk_get_rate(clk->parent) / (div + 1); -+} -+ -+static void __iomem *pcdr_a[4] = { -+ MXC_CCM_PCDR0, MXC_CCM_PCDR1, MXC_CCM_PCDR2, MXC_CCM_PCDR3 -+}; -+ -+static unsigned long _clk_perclkx_getrate(struct clk *clk) -+{ -+ unsigned long perclk_pdf; -+ unsigned long pcdr; -+ -+ if (clk->id < 0 || clk->id > 15) -+ return 0; -+ -+ pcdr = __raw_readl(pcdr_a[clk->id >> 2]); -+ -+ perclk_pdf = -+ (pcdr >> ((clk->id & 3) << 3)) & MXC_CCM_PCDR1_PERDIV1_MASK; -+ -+ return clk_get_rate(clk->parent) / (perclk_pdf + 1); -+} -+ -+static unsigned long _clk_perclkx_round_rate(struct clk *clk, -+ unsigned long rate) -+{ -+ unsigned long div; -+ -+ div = clk_get_rate(clk->parent) / rate; -+ if (clk_get_rate(clk->parent) % rate) -+ div++; -+ -+ if (div > 64) -+ div = 64; -+ -+ return clk_get_rate(clk->parent) / div; -+} -+ -+static int _clk_perclkx_set_rate(struct clk *clk, unsigned long rate) -+{ -+ unsigned long reg; -+ unsigned long div; -+ -+ if (clk->id < 0 || clk->id > 15) -+ 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--; -+ -+ reg = -+ __raw_readl(pcdr_a[clk->id >> 2]) & ~(MXC_CCM_PCDR1_PERDIV1_MASK << -+ ((clk->id & 3) << 3)); -+ reg |= div << ((clk->id & 3) << 3); -+ __raw_writel(reg, pcdr_a[clk->id >> 2]); -+ -+ return 0; -+} -+ -+static int _clk_perclkx_set_parent(struct clk *clk, struct clk *parent) -+{ -+ unsigned long mcr; -+ -+ if (clk->parent == parent) -+ return 0; -+ if (parent != &upll_clk && parent != &ahb_clk) -+ return -EINVAL; -+ -+ clk->parent = parent; -+ mcr = __raw_readl(MXC_CCM_MCR); -+ if (parent == &upll_clk) -+ mcr |= (1 << clk->id); -+ else -+ mcr &= ~(1 << clk->id); -+ -+ __raw_writel(mcr, MXC_CCM_MCR); -+ -+ return 0; -+} -+ -+static int _clk_perclkx_set_parent3(struct clk *clk, struct clk *parent) -+{ -+ unsigned long mcr = __raw_readl(MXC_CCM_MCR); -+ int bit; -+ -+ if (clk->parent == parent) -+ return 0; -+ if (parent != &upll_clk && parent != &ahb_clk && -+ parent != &upll_24610k_clk) -+ return -EINVAL; -+ -+ switch (clk->id) { -+ case 2: -+ bit = MXC_CCM_MCR_ESAI_CLK_MUX_OFFSET; -+ break; -+ case 13: -+ bit = MXC_CCM_MCR_SSI1_CLK_MUX_OFFSET; -+ break; -+ case 14: -+ bit = MXC_CCM_MCR_SSI2_CLK_MUX_OFFSET; -+ break; -+ default: -+ return -EINVAL; -+ } -+ -+ if (parent == &upll_24610k_clk) { -+ mcr |= bit; -+ __raw_writel(mcr, MXC_CCM_MCR); -+ clk->parent = parent; -+ } else { -+ mcr &= ~bit; -+ __raw_writel(mcr, MXC_CCM_MCR); -+ return _clk_perclkx_set_parent(clk, parent); -+ } -+ -+ return 0; -+} -+ -+static unsigned long _clk_ipg_getrate(struct clk *clk) -+{ -+ return clk_get_rate(clk->parent) / 2; /* Always AHB / 2 */ -+} -+ -+/* Top-level clocks */ -+static unsigned long ckih_rate = OSC24M_CLK_FREQ; -+ -+static unsigned long clk_ckih_get_rate(struct clk *clk) -+{ -+ return ckih_rate; -+} -+ -+static unsigned long clk_ckil_get_rate(struct clk *clk) -+{ -+ return OSC32K_CLK_FREQ; -+} -+ -+static struct clk osc24m_clk = { -+ .get_rate = clk_ckih_get_rate, -+}; -+ -+static struct clk osc32k_clk = { -+ .get_rate = clk_ckil_get_rate, -+}; -+ -+static struct clk mpll_clk = { -+ .parent = &osc24m_clk, -+ .get_rate = _clk_pll_getrate, -+ .set_rate = _clk_pll_set_rate, -+}; -+ -+static struct clk upll_clk = { -+ .parent = &osc24m_clk, -+ .get_rate = _clk_pll_getrate, -+ .set_rate = _clk_pll_set_rate, -+ .enable = _clk_upll_enable, -+ .disable = _clk_upll_disable, -+}; -+ -+static unsigned long _clk_24610k_getrate(struct clk *clk) -+{ -+ long long rate = clk_get_rate(clk->parent) * 2461LL; -+ -+ do_div(rate, 24000); -+ -+ return rate; /* Always (UPLL * 24.61 / 240) */ -+} -+ -+static struct clk upll_24610k_clk = { -+ .parent = &upll_clk, -+ .get_rate = _clk_24610k_getrate, -+}; -+ -+/* Mid-level clocks */ -+ -+static struct clk cpu_clk = { /* ARM clock */ -+ .parent = &mpll_clk, -+ .set_rate = _clk_cpu_set_rate, -+ .get_rate = _clk_cpu_getrate, -+ .round_rate = _clk_cpu_round_rate, -+}; -+ -+static struct clk ahb_clk = { /* a.k.a. HCLK */ -+ .parent = &cpu_clk, -+ .get_rate = _clk_ahb_getrate, -+}; -+ -+static struct clk ipg_clk = { -+ .parent = &ahb_clk, -+ .get_rate = _clk_ipg_getrate, -+}; -+ -+/* Bottom-level clocks */ -+ -+struct clk usbotg_clk = { -+ .id = 0, -+ .parent = &ahb_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR0, -+ .enable_shift = MXC_CCM_CGCR0_HCLK_USBOTG_OFFSET, -+ .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, -+}; -+ -+struct clk emi_clk = { -+ .id = 0, -+ .parent = &ahb_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR0, -+ .enable_shift = MXC_CCM_CGCR0_HCLK_EMI_OFFSET, -+ .disable = _clk_disable, -+}; -+ -+struct clk brom_clk = { -+ .id = 0, -+ .parent = &ahb_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR0, -+ .enable_shift = MXC_CCM_CGCR0_HCLK_BROM_OFFSET, -+ .disable = _clk_disable, -+}; -+ -+static struct clk per_clk[] = { -+ { -+ .id = 0, -+ .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, -+ .get_rate = _clk_perclkx_getrate, -+ .enable = _perclk_enable, -+ .disable = _perclk_disable, -+ }, -+ { -+ .id = 1, -+ .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, -+ .get_rate = _clk_perclkx_getrate, -+ .enable = _perclk_enable, -+ .disable = _perclk_disable, -+ }, -+ { -+ .id = 2, -+ .parent = &ahb_clk, /* can be AHB or UPLL or 24.61MHz */ -+ .round_rate = _clk_perclkx_round_rate, -+ .set_rate = _clk_perclkx_set_rate, -+ .set_parent = _clk_perclkx_set_parent3, -+ .get_rate = _clk_perclkx_getrate, -+ .enable = _perclk_enable, -+ .disable = _perclk_disable, -+ }, -+ { -+ .id = 3, -+ .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, -+ .get_rate = _clk_perclkx_getrate, -+ .enable = _perclk_enable, -+ }, -+ { -+ .id = 4, -+ .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, -+ .get_rate = _clk_perclkx_getrate, -+ .enable = _perclk_enable, -+ .disable = _perclk_disable, -+ }, -+ { -+ .id = 5, -+ .parent = &upll_clk, /* can be AHB or UPLL */ -+ .round_rate = _clk_perclkx_round_rate, -+ .set_rate = _clk_perclkx_set_rate, -+ .set_parent = _clk_perclkx_set_parent, -+ .get_rate = _clk_perclkx_getrate, -+ .enable = _perclk_enable, -+ .disable = _perclk_disable, -+ }, -+ { -+ .id = 6, -+ .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, -+ .get_rate = _clk_perclkx_getrate, -+ .enable = _perclk_enable, -+ .disable = _perclk_disable, -+ }, -+ { -+ .id = 7, -+ .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, -+ .get_rate = _clk_perclkx_getrate, -+ .enable = _perclk_enable, -+ .disable = _perclk_disable, -+ }, -+ { -+ .id = 8, -+ .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, -+ .get_rate = _clk_perclkx_getrate, -+ .enable = _perclk_enable, -+ .disable = _perclk_disable, -+ }, -+ { -+ .id = 9, -+ .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, -+ .get_rate = _clk_perclkx_getrate, -+ .enable = _perclk_enable, -+ .disable = _perclk_disable, -+ }, -+ { -+ .id = 10, -+ .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, -+ .get_rate = _clk_perclkx_getrate, -+ .enable = _perclk_enable, -+ .disable = _perclk_disable, -+ }, -+ { -+ .id = 11, -+ .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, -+ .get_rate = _clk_perclkx_getrate, -+ .enable = _perclk_enable, -+ .disable = _perclk_disable, -+ }, -+ { -+ .id = 12, -+ .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, -+ .get_rate = _clk_perclkx_getrate, -+ .enable = _perclk_enable, -+ .disable = _perclk_disable, -+ }, -+ { -+ .id = 13, -+ .parent = &ahb_clk, /* can be AHB or UPLL or 24.61MHz */ -+ .round_rate = _clk_perclkx_round_rate, -+ .set_rate = _clk_perclkx_set_rate, -+ .set_parent = _clk_perclkx_set_parent3, -+ .get_rate = _clk_perclkx_getrate, -+ .enable = _perclk_enable, -+ .disable = _perclk_disable, -+ }, -+ { -+ .id = 14, -+ .parent = &ahb_clk, /* can be AHB or UPLL or 24.61MHz */ -+ .round_rate = _clk_perclkx_round_rate, -+ .set_rate = _clk_perclkx_set_rate, -+ .set_parent = _clk_perclkx_set_parent3, -+ .get_rate = _clk_perclkx_getrate, -+ .enable = _perclk_enable, -+ .disable = _perclk_disable, -+ }, -+ { -+ .id = 15, -+ .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, -+ .get_rate = _clk_perclkx_getrate, -+ .enable = _perclk_enable, -+ .disable = _perclk_disable, -+ }, -+}; -+ -+struct clk nfc_clk = { -+ .id = 0, -+ .parent = &per_clk[8], -+}; -+ -+struct clk audmux_clk = { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_AUDMUX_OFFSET, -+ .disable = _clk_disable, -+}; -+ -+struct clk ata_clk[] = { -+ { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_ATA_OFFSET, -+ .disable = _clk_disable, -+ .secondary = &ata_clk[1], -+ }, -+ { -+ .id = 0, -+ .parent = &ahb_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR0, -+ .enable_shift = MXC_CCM_CGCR0_HCLK_ATA_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk can_clk[] = { -+ { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_CAN1_OFFSET, -+ .disable = _clk_disable, -+ }, -+ { -+ .id = 1, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_CAN2_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk csi_clk[] = { -+ { -+ .id = 0, -+ .parent = &per_clk[0], -+ .secondary = &csi_clk[1], -+ }, -+ { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_CSI_OFFSET, -+ .disable = _clk_disable, -+ .secondary = &csi_clk[2], -+ }, -+ { -+ .id = 0, -+ .parent = &ahb_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR0, -+ .enable_shift = MXC_CCM_CGCR0_HCLK_CSI_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk cspi_clk[] = { -+ { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_CSPI1_OFFSET, -+ .disable = _clk_disable, -+ }, -+ { -+ .id = 1, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_CSPI2_OFFSET, -+ .disable = _clk_disable, -+ }, -+ { -+ .id = 2, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_CSPI3_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk dryice_clk = { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_DRYICE_OFFSET, -+ .disable = _clk_disable, -+}; -+ -+struct clk ect_clk = { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_ECT_OFFSET, -+ .disable = _clk_disable, -+}; -+ -+struct clk epit1_clk[] = { -+ { -+ .id = 0, -+ .parent = &per_clk[1], -+ .secondary = &epit1_clk[1], -+ }, -+ { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_EPIT1_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk epit2_clk[] = { -+ { -+ .id = 1, -+ .parent = &per_clk[1], -+ .secondary = &epit2_clk[1], -+ }, -+ { -+ .id = 1, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_EPIT2_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk esai_clk[] = { -+ { -+ .id = 0, -+ .parent = &per_clk[2], -+ .secondary = &esai_clk[1], -+ }, -+ { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_ESAI_OFFSET, -+ .disable = _clk_disable, -+ .secondary = &esai_clk[2], -+ }, -+ { -+ .id = 0, -+ .parent = &ahb_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR0, -+ .enable_shift = MXC_CCM_CGCR0_HCLK_ESAI_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk esdhc1_clk[] = { -+ { -+ .id = 0, -+ .parent = &per_clk[3], -+ .secondary = &esdhc1_clk[1], -+ }, -+ { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_ESDHC1_OFFSET, -+ .disable = _clk_disable, -+ .secondary = &esdhc1_clk[2], -+ }, -+ { -+ .id = 0, -+ .parent = &ahb_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR0, -+ .enable_shift = MXC_CCM_CGCR0_HCLK_ESDHC1_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk esdhc2_clk[] = { -+ { -+ .id = 1, -+ .parent = &per_clk[4], -+ .secondary = &esdhc2_clk[1], -+ }, -+ { -+ .id = 1, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_ESDHC2_OFFSET, -+ .disable = _clk_disable, -+ .secondary = &esdhc2_clk[2], -+ }, -+ { -+ .id = 1, -+ .parent = &ahb_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR0, -+ .enable_shift = MXC_CCM_CGCR0_HCLK_ESDHC2_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk fec_clk[] = { -+ { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_FEC_OFFSET, -+ .disable = _clk_disable, -+ .secondary = &fec_clk[1], -+ }, -+ { -+ .id = 0, -+ .parent = &ahb_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR0, -+ .enable_shift = MXC_CCM_CGCR0_HCLK_FEC_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk gpio_clk[] = { -+ { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_GPIO1_OFFSET, -+ .disable = _clk_disable, -+ }, -+ { -+ .id = 1, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_GPIO2_OFFSET, -+ .disable = _clk_disable, -+ }, -+ { -+ .id = 2, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_GPIO3_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+static struct clk gpt1_clk[] = { -+ { -+ .id = 0, -+ .parent = &per_clk[5], -+ .secondary = &gpt1_clk[1], -+ }, -+ { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_GPT1_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+static struct clk gpt2_clk[] = { -+ { -+ .id = 1, -+ .parent = &per_clk[5], -+ .secondary = &gpt1_clk[1], -+ }, -+ { -+ .id = 1, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_GPT2_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+static struct clk gpt3_clk[] = { -+ { -+ .id = 2, -+ .parent = &per_clk[5], -+ .secondary = &gpt1_clk[1], -+ }, -+ { -+ .id = 2, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_GPT3_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+static struct clk gpt4_clk[] = { -+ { -+ .id = 3, -+ .parent = &per_clk[5], -+ .secondary = &gpt1_clk[1], -+ }, -+ { -+ .id = 3, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_GPT4_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk i2c_clk[] = { -+ { -+ .id = 0, -+ .parent = &per_clk[6], -+ }, -+ { -+ .id = 1, -+ .parent = &per_clk[6], -+ }, -+ { -+ .id = 2, -+ .parent = &per_clk[6], -+ }, -+}; -+ -+struct clk iim_clk = { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_IIM_OFFSET, -+ .disable = _clk_disable, -+}; -+ -+struct clk iomuxc_clk = { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_IOMUXC_OFFSET, -+ .disable = _clk_disable, -+}; -+ -+struct clk kpp_clk = { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_KPP_OFFSET, -+ .disable = _clk_disable, -+}; -+ -+struct clk lcdc_clk[] = { -+ { -+ .id = 0, -+ .parent = &per_clk[7], -+ .secondary = &lcdc_clk[1], -+ }, -+ { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_LCDC_OFFSET, -+ .disable = _clk_disable, -+ .secondary = &lcdc_clk[2], -+ }, -+ { -+ .id = 0, -+ .parent = &ahb_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR0, -+ .enable_shift = MXC_CCM_CGCR0_HCLK_LCDC_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk owire_clk[] = { -+ { -+ .id = 0, -+ .parent = &per_clk[9], -+ .secondary = &owire_clk[1], -+ }, -+ { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_OWIRE_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk pwm1_clk[] = { -+ { -+ .id = 0, -+ .parent = &per_clk[10], -+ .secondary = &pwm1_clk[1], -+ }, -+ { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_PWM1_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk pwm2_clk[] = { -+ { -+ .id = 1, -+ .parent = &per_clk[10], -+ .secondary = &pwm2_clk[1], -+ }, -+ { -+ .id = 1, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR2, -+ .enable_shift = MXC_CCM_CGCR2_PWM2_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk pwm3_clk[] = { -+ { -+ .id = 2, -+ .parent = &per_clk[10], -+ .secondary = &pwm3_clk[1], -+ }, -+ { -+ .id = 2, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR2, -+ .enable_shift = MXC_CCM_CGCR2_PWM3_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk pwm4_clk[] = { -+ { -+ .id = 3, -+ .parent = &per_clk[10], -+ .secondary = &pwm4_clk[1], -+ }, -+ { -+ .id = 3, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR2, -+ .enable_shift = MXC_CCM_CGCR2_PWM3_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk rngb_clk = { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR2, -+ .enable_shift = MXC_CCM_CGCR2_RNGB_OFFSET, -+ .disable = _clk_disable, -+}; -+ -+struct clk scc_clk = { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR2, -+ .enable_shift = MXC_CCM_CGCR2_SCC_OFFSET, -+ .disable = _clk_disable, -+}; -+ -+struct clk sdma_clk[] = { -+ { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR2, -+ .enable_shift = MXC_CCM_CGCR2_SDMA_OFFSET, -+ .disable = _clk_disable, -+ .secondary = &sdma_clk[1], -+ }, -+ { -+ .id = 0, -+ .parent = &ahb_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR0, -+ .enable_shift = MXC_CCM_CGCR0_HCLK_SDMA_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk sim1_clk[] = { -+ { -+ .id = 0, -+ .parent = &per_clk[11], -+ .secondary = &sim1_clk[1], -+ }, -+ { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR2, -+ .enable_shift = MXC_CCM_CGCR2_SIM1_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk sim2_clk[] = { -+ { -+ .id = 1, -+ .parent = &per_clk[12], -+ .secondary = &sim2_clk[1], -+ }, -+ { -+ .id = 1, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR2, -+ .enable_shift = MXC_CCM_CGCR2_SIM2_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk slcdc_clk[] = { -+ { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR2, -+ .enable_shift = MXC_CCM_CGCR2_SLCDC_OFFSET, -+ .disable = _clk_disable, -+ .secondary = &slcdc_clk[1], -+ }, -+ { -+ .id = 0, -+ .parent = &ahb_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR0, -+ .enable_shift = MXC_CCM_CGCR0_HCLK_SLCDC_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk spba_clk = { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR2, -+ .enable_shift = MXC_CCM_CGCR2_SPBA_OFFSET, -+ .disable = _clk_disable, -+}; -+ -+struct clk ssi1_clk[] = { -+ { -+ .id = 0, -+ .parent = &per_clk[13], -+ .secondary = &ssi1_clk[1], -+ }, -+ { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR2, -+ .enable_shift = MXC_CCM_CGCR2_SSI1_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk ssi2_clk[] = { -+ { -+ .id = 1, -+ .parent = &per_clk[14], -+ .secondary = &ssi2_clk[1], -+ }, -+ { -+ .id = 1, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR2, -+ .enable_shift = MXC_CCM_CGCR2_SSI2_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk tchscrn_clk = { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR2, -+ .enable_shift = MXC_CCM_CGCR2_TCHSCRN_OFFSET, -+ .disable = _clk_disable, -+}; -+ -+struct clk uart1_clk[] = { -+ { -+ .id = 0, -+ .parent = &per_clk[15], -+ .secondary = &uart1_clk[1], -+ }, -+ { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR2, -+ .enable_shift = MXC_CCM_CGCR2_UART1_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk uart2_clk[] = { -+ { -+ .id = 1, -+ .parent = &per_clk[15], -+ .secondary = &uart2_clk[1], -+ }, -+ { -+ .id = 1, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR2, -+ .enable_shift = MXC_CCM_CGCR2_UART2_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk uart3_clk[] = { -+ { -+ .id = 2, -+ .parent = &per_clk[15], -+ .secondary = &uart3_clk[1], -+ }, -+ { -+ .id = 2, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR2, -+ .enable_shift = MXC_CCM_CGCR2_UART3_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk uart4_clk[] = { -+ { -+ .id = 3, -+ .parent = &per_clk[15], -+ .secondary = &uart4_clk[1], -+ }, -+ { -+ .id = 3, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR2, -+ .enable_shift = MXC_CCM_CGCR2_UART4_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk uart5_clk[] = { -+ { -+ .id = 4, -+ .parent = &per_clk[15], -+ .secondary = &uart5_clk[1], -+ }, -+ { -+ .id = 4, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR2, -+ .enable_shift = MXC_CCM_CGCR2_UART5_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk wdog_clk = { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR2, -+ .enable_shift = MXC_CCM_CGCR2_WDOG_OFFSET, -+ .disable = _clk_disable, -+}; -+ -+static unsigned long _clk_usb_round_rate(struct clk *clk, unsigned long rate) -+{ -+ unsigned long div; -+ -+ div = clk_get_rate(clk->parent) / rate; -+ if (clk_get_rate(clk->parent) % rate) -+ div++; -+ -+ if (div > 64) -+ return -EINVAL; -+ -+ return clk_get_rate(clk->parent) / div; -+} -+ -+static int _clk_usb_set_rate(struct clk *clk, unsigned long rate) -+{ -+ unsigned long reg; -+ unsigned long div; -+ -+ div = clk_get_rate(clk->parent) / rate; -+ -+ if (clk_get_rate(clk->parent) / div != rate) -+ return -EINVAL; -+ if (div > 64) -+ return -EINVAL; -+ -+ reg = __raw_readl(MXC_CCM_CCTL) & ~MXC_CCM_CCTL_USB_DIV_MASK; -+ reg |= (div - 1) << MXC_CCM_CCTL_USB_DIV_OFFSET; -+ __raw_writel(reg, MXC_CCM_MCR); -+ -+ return 0; -+} -+ -+static unsigned long _clk_usb_getrate(struct clk *clk) -+{ -+ unsigned long 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); -+} -+ -+static int _clk_usb_set_parent(struct clk *clk, struct clk *parent) -+{ -+ unsigned long mcr; -+ -+ if (clk->parent == parent) -+ return 0; -+ if (parent != &upll_clk && parent != &ahb_clk) -+ return -EINVAL; -+ -+ clk->parent = parent; -+ mcr = __raw_readl(MXC_CCM_MCR); -+ if (parent == &ahb_clk) -+ mcr |= (1 << MXC_CCM_MCR_USB_CLK_MUX_OFFSET); -+ else -+ mcr &= ~(1 << MXC_CCM_MCR_USB_CLK_MUX_OFFSET); -+ -+ __raw_writel(mcr, MXC_CCM_MCR); -+ -+ return 0; -+} -+ -+static struct clk usb_clk = { -+ .parent = &upll_clk, -+ .get_rate = _clk_usb_getrate, -+ .set_rate = _clk_usb_set_rate, -+ .round_rate = _clk_usb_round_rate, -+ .set_parent = _clk_usb_set_parent, -+}; -+ -+/* CLKO */ -+ -+static unsigned long _clk_clko_round_rate(struct clk *clk, unsigned long rate) -+{ -+ unsigned long div; -+ -+ div = clk_get_rate(clk->parent) / rate; -+ if (clk_get_rate(clk->parent) % rate) -+ div++; -+ -+ if (div > 64) -+ return -EINVAL; -+ -+ return clk_get_rate(clk->parent) / div; -+} -+ -+static int _clk_clko_set_rate(struct clk *clk, unsigned long rate) -+{ -+ unsigned long reg; -+ unsigned long div; -+ -+ div = clk_get_rate(clk->parent) / rate; -+ -+ if ((clk_get_rate(clk->parent) / div) != rate) -+ return -EINVAL; -+ if (div > 64) -+ return -EINVAL; -+ -+ reg = __raw_readl(MXC_CCM_MCR) & ~MXC_CCM_MCR_CLKO_DIV_MASK; -+ reg |= (div - 1) << MXC_CCM_MCR_CLKO_DIV_OFFSET; -+ __raw_writel(reg, MXC_CCM_MCR); -+ -+ return 0; -+} -+ -+static unsigned long _clk_clko_getrate(struct clk *clk) -+{ -+ unsigned long div = __raw_readl(MXC_CCM_MCR); -+ -+ div &= MXC_CCM_MCR_CLKO_DIV_MASK; -+ div >>= MXC_CCM_MCR_CLKO_DIV_OFFSET; -+ -+ return clk_get_rate(clk->parent) / (div + 1); -+} -+ -+static struct clk *clko_sources[] = { -+ &osc32k_clk, /* 0x0 */ -+ &osc24m_clk, /* 0x1 */ -+ &cpu_clk, /* 0x2 */ -+ &ahb_clk, /* 0x3 */ -+ &ipg_clk, /* 0x4 */ -+ NULL, /* 0x5 */ -+ NULL, /* 0x6 */ -+ NULL, /* 0x7 */ -+ NULL, /* 0x8 */ -+ NULL, /* 0x9 */ -+ &per_clk[0], /* 0xA */ -+ &per_clk[2], /* 0xB */ -+ &per_clk[13], /* 0xC */ -+ &per_clk[14], /* 0xD */ -+ &usb_clk, /* 0xE */ -+ NULL, /* 0xF */ -+}; -+ -+#define NR_CLKO_SOURCES (sizeof(clko_sources) / sizeof(struct clk *)) -+ -+static int _clk_clko_set_parent(struct clk *clk, struct clk *parent) -+{ -+ unsigned long reg; -+ struct clk **src; -+ int i; -+ -+ if (clk->parent == parent) -+ return 0; -+ for (i = 0, src = clko_sources; i < NR_CLKO_SOURCES; i++, src++) -+ if (*src == parent) -+ break; -+ -+ if (i == NR_CLKO_SOURCES) -+ return -EINVAL; -+ -+ clk->parent = parent; -+ -+ reg = __raw_readl(MXC_CCM_MCR) & ~MXC_CCM_MCR_CLKO_SEL_MASK; -+ reg |= i << MXC_CCM_MCR_CLKO_SEL_OFFSET; -+ __raw_writel(reg, MXC_CCM_MCR); -+ -+ return 0; -+} -+ -+static struct clk clko_clk = { -+ .set_rate = _clk_clko_set_rate, -+ .round_rate = _clk_clko_round_rate, -+ .set_parent = _clk_clko_set_parent, -+ .get_rate = _clk_clko_getrate, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_MCR, -+ .enable_shift = MXC_CCM_MCR_CLKO_EN_OFFSET, -+ .disable = _clk_disable, -+}; -+ -+#ifdef CONFIG_COMMON_CLKDEV -+#define _REGISTER_CLOCK(d, n, c) \ -+ { \ -+ .dev_id = d, \ -+ .con_id = n, \ -+ .clk = &c, \ -+ }, -+ -+static struct clk_lookup lookups[] = { -+ _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(NULL, "csi", csi_clk[0]) -+ _REGISTER_CLOCK(NULL, "cspi.0", cspi_clk[0]) -+ _REGISTER_CLOCK(NULL, "cspi.1", cspi_clk[1]) -+ _REGISTER_CLOCK(NULL, "cspi.2", cspi_clk[2]) -+ _REGISTER_CLOCK(NULL, "dryice", dryice_clk) -+ _REGISTER_CLOCK(NULL, "ect", ect_clk) -+ _REGISTER_CLOCK(NULL, "epit1", epit1_clk[0]) -+ _REGISTER_CLOCK(NULL, "epit2", epit2_clk[0]) -+ _REGISTER_CLOCK(NULL, "esai", esai_clk[0]) -+ _REGISTER_CLOCK("mxc-mmc.0", NULL, esdhc1_clk[0]) -+ _REGISTER_CLOCK("mxc-mmc.1", NULL, esdhc2_clk[0]) -+ _REGISTER_CLOCK("fec.0", NULL, fec_clk[0]) -+ _REGISTER_CLOCK(NULL, "gpio0", gpio_clk[0]) -+ _REGISTER_CLOCK(NULL, "gpio1", gpio_clk[1]) -+ _REGISTER_CLOCK(NULL, "gpio2", gpio_clk[2]) -+ _REGISTER_CLOCK(NULL, "gpt1", gpt1_clk[0]) -+ _REGISTER_CLOCK(NULL, "gpt2", gpt2_clk[0]) -+ _REGISTER_CLOCK(NULL, "gpt3", gpt3_clk[0]) -+ _REGISTER_CLOCK(NULL, "gpt4", gpt4_clk[0]) -+ _REGISTER_CLOCK("imx-i2c.0", NULL, i2c_clk[0]) -+ _REGISTER_CLOCK("imx-i2c.1", NULL, i2c_clk[1]) -+ _REGISTER_CLOCK("imx-i2c.2", NULL, i2c_clk[2]) -+ _REGISTER_CLOCK(NULL, "iim", iim_clk) -+ _REGISTER_CLOCK(NULL, "iomuxc", iomuxc_clk) -+ _REGISTER_CLOCK(NULL, "kpp", kpp_clk) -+ _REGISTER_CLOCK("imx-fb.0", NULL, lcdc_clk[0]) -+ _REGISTER_CLOCK(NULL, "owire", owire_clk[0]) -+ _REGISTER_CLOCK("mxc_pwm.0", NULL, pwm1_clk[0]) -+ _REGISTER_CLOCK("mxc_pwm.1", NULL, pwm2_clk[0]) -+ _REGISTER_CLOCK("mxc_pwm.2", NULL, pwm3_clk[0]) -+ _REGISTER_CLOCK("mxc_pwm.3", NULL, pwm4_clk[0]) -+ _REGISTER_CLOCK(NULL, "rngb", rngb_clk) -+ _REGISTER_CLOCK(NULL, "scc", scc_clk) -+ _REGISTER_CLOCK(NULL, "sdma", sdma_clk[0]) -+ _REGISTER_CLOCK(NULL, "sim1", sim1_clk[0]) -+ _REGISTER_CLOCK(NULL, "sim2", sim2_clk[0]) -+ _REGISTER_CLOCK(NULL, "slcdc", slcdc_clk[0]) -+ _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("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(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 : ""); -+ 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 */ -+ __raw_writel((1 << MXC_CCM_CGCR0_HCLK_EMI_OFFSET), MXC_CCM_CGCR0); -+ -+ __raw_writel((1 << MXC_CCM_CGCR1_GPT1_OFFSET) | -+ (1 << MXC_CCM_CGCR1_IIM_OFFSET), MXC_CCM_CGCR1); -+ __raw_writel(1 << MXC_CCM_CGCR2_SCC_OFFSET, MXC_CCM_CGCR2); -+#endif -+#if 1 -+ /* Set all perclk sources to upll */ -+ for (i = 0; i < ARRAY_SIZE(per_clk); i++) { -+ int ret; -+ unsigned long rate = per_clk[i].get_rate(&per_clk[i]); -+ -+#ifdef CONFIG_DEBUG_LL -+ if (i == 15) { -+ printk(KERN_DEBUG "skipping per_clk[%d] rate=%lu\n", i, rate); -+ continue; -+ } -+#endif -+ { -+ unsigned long new_rate; -+ -+ per_clk[i].set_parent(&per_clk[i], &upll_clk); -+ new_rate = per_clk[i].round_rate(&per_clk[i], rate); -+ 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); -+ clk_set_rate(&per_clk[8], clk_get_rate(&ahb_clk) / 6); -+ -+ /* This will propagate to all children and init all the clock rates */ -+#if 1 -+ 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)); -+ -+ pr_info("CPU: %lu.%03luMHz\n", -+ clk_get_rate(&cpu_clk) / 1000000, clk_get_rate(&cpu_clk) / 1000 % 1000); -+ pr_info("AHB: %lu.%03luMHz\n", -+ clk_get_rate(&ahb_clk) / 1000000, clk_get_rate(&ahb_clk) / 1000 % 1000); -+ pr_info("MPLL: %lu.%03luMHz\n", -+ clk_get_rate(&mpll_clk) / 1000000, clk_get_rate(&mpll_clk) / 1000 % 1000); -+ pr_info("UPLL: %lu.%03luMHz\n", -+ clk_get_rate(&upll_clk) / 1000000, clk_get_rate(&upll_clk) / 1000 % 1000); -+ 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]); -+ 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 -@@ -621,7 +621,7 @@ DEFINE_CLOCK1(csi_clk, 0, 0, 0, - .clk = &c, \ - }, - --static struct clk_lookup lookups[] __initdata = { -+static struct clk_lookup lookups[] = { - _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 -@@ -0,0 +1,65 @@ -+/* -+ * arch/arm/mach-mx2/cpu_mx25.c -+ * -+ * Copyright 2009 Lothar Wassmann -+ * derived from: cpu_mx27.c -+ * Copyright 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., 51 Franklin Street, Fifth Floor, Boston, -+ * MA 02110-1301, USA. -+ */ -+ -+/* -+ * i.MX25 specific CPU detection code -+ */ -+ -+#include -+#include -+ -+#include -+ -+static int cpu_silicon_rev = -1; -+static int cpu_partnumber; -+ -+#define IIM_PREV_REG IO_ADDRESS(IIM_BASE_ADDR + 0x20) -+#define IIM_SREV_REG IO_ADDRESS(IIM_BASE_ADDR + 0x24) -+ -+static void query_silicon_parameter(void) -+{ -+ cpu_partnumber = __raw_readl(IIM_PREV_REG) >> 3; -+ cpu_silicon_rev = __raw_readl(IIM_SREV_REG); -+ -+ printk(KERN_DEBUG "CPU rev: 0x%02x chip_rev: 0x%02x\n", -+ cpu_partnumber, cpu_silicon_rev); -+ if (WARN_ON(cpu_partnumber != 0x1f)) { -+ printk(KERN_WARNING "Unsupported CPU rev: 0x%02x\n", cpu_partnumber); -+ } -+} -+ -+/* -+ * Returns: -+ * the silicon revision of the cpu -+ * -EINVAL - not a mx25 -+ */ -+int mx25_revision(void) -+{ -+ if (cpu_silicon_rev == -1) -+ query_silicon_parameter(); -+ -+ if (cpu_partnumber != 0x1f) -+ return -EINVAL; -+ -+ 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 -@@ -0,0 +1,190 @@ -+/* -+ * Copyright 2008 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 __ARCH_ARM_MACH_MX25_CRM_REGS_H__ -+#define __ARCH_ARM_MACH_MX25_CRM_REGS_H__ -+ -+#include -+ -+/* Register offsets */ -+#define MXC_CCM_MPCTL (IO_ADDRESS(CCM_BASE_ADDR) + 0x00) -+#define MXC_CCM_UPCTL (IO_ADDRESS(CCM_BASE_ADDR) + 0x04) -+#define MXC_CCM_CCTL (IO_ADDRESS(CCM_BASE_ADDR) + 0x08) -+#define MXC_CCM_CGCR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x0C) -+#define MXC_CCM_CGCR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x10) -+#define MXC_CCM_CGCR2 (IO_ADDRESS(CCM_BASE_ADDR) + 0x14) -+#define MXC_CCM_PCDR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x18) -+#define MXC_CCM_PCDR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x1C) -+#define MXC_CCM_PCDR2 (IO_ADDRESS(CCM_BASE_ADDR) + 0x20) -+#define MXC_CCM_PCDR3 (IO_ADDRESS(CCM_BASE_ADDR) + 0x24) -+#define MXC_CCM_RCSR (IO_ADDRESS(CCM_BASE_ADDR) + 0x28) -+#define MXC_CCM_CRDR (IO_ADDRESS(CCM_BASE_ADDR) + 0x2C) -+#define MXC_CCM_DCVR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x30) -+#define MXC_CCM_DCVR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x34) -+#define MXC_CCM_DCVR2 (IO_ADDRESS(CCM_BASE_ADDR) + 0x38) -+#define MXC_CCM_DCVR3 (IO_ADDRESS(CCM_BASE_ADDR) + 0x3C) -+#define MXC_CCM_LTR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x40) -+#define MXC_CCM_LTR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x44) -+#define MXC_CCM_LTR2 (IO_ADDRESS(CCM_BASE_ADDR) + 0x48) -+#define MXC_CCM_LTR3 (IO_ADDRESS(CCM_BASE_ADDR) + 0x4C) -+#define MXC_CCM_LTBR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x50) -+#define MXC_CCM_LTBR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x54) -+#define MXC_CCM_PMCR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x58) -+#define MXC_CCM_PMCR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x5C) -+#define MXC_CCM_PMCR2 (IO_ADDRESS(CCM_BASE_ADDR) + 0x60) -+#define MXC_CCM_MCR (IO_ADDRESS(CCM_BASE_ADDR) + 0x64) -+ -+#define MXC_CCM_MPCTL_BRMO (1 << 31) -+#define MXC_CCM_MPCTL_PD_OFFSET 26 -+#define MXC_CCM_MPCTL_PD_MASK (0xf << 26) -+#define MXC_CCM_MPCTL_MFD_OFFSET 16 -+#define MXC_CCM_MPCTL_MFD_MASK (0x3ff << 16) -+#define MXC_CCM_MPCTL_MFI_OFFSET 10 -+#define MXC_CCM_MPCTL_MFI_MASK (0xf << 10) -+#define MXC_CCM_MPCTL_MFN_OFFSET 0 -+#define MXC_CCM_MPCTL_MFN_MASK 0x3ff -+#define MXC_CCM_MPCTL_LF (1 << 15) -+ -+#define MXC_CCM_UPCTL_BRMO (1 << 31) -+#define MXC_CCM_UPCTL_PD_OFFSET 26 -+#define MXC_CCM_UPCTL_PD_MASK (0xf << 26) -+#define MXC_CCM_UPCTL_MFD_OFFSET 16 -+#define MXC_CCM_UPCTL_MFD_MASK (0x3ff << 16) -+#define MXC_CCM_UPCTL_MFI_OFFSET 10 -+#define MXC_CCM_UPCTL_MFI_MASK (0xf << 10) -+#define MXC_CCM_UPCTL_MFN_OFFSET 0 -+#define MXC_CCM_UPCTL_MFN_MASK 0x3ff -+#define MXC_CCM_UPCTL_LF (1 << 15) -+ -+#define MXC_CCM_CCTL_ARM_OFFSET 30 -+#define MXC_CCM_CCTL_ARM_MASK (0x3 << 30) -+#define MXC_CCM_CCTL_AHB_OFFSET 28 -+#define MXC_CCM_CCTL_AHB_MASK (0x3 << 28) -+#define MXC_CCM_CCTL_MPLL_RST (1 << 27) -+#define MXC_CCM_CCTL_UPLL_RST (1 << 26) -+#define MXC_CCM_CCTL_LP_CTL_OFFSET 24 -+#define MXC_CCM_CCTL_LP_CTL_MASK (0x3 << 24) -+#define MXC_CCM_CCTL_LP_MODE_RUN (0x0 << 24) -+#define MXC_CCM_CCTL_LP_MODE_WAIT (0x1 << 24) -+#define MXC_CCM_CCTL_LP_MODE_DOZE (0x2 << 24) -+#define MXC_CCM_CCTL_LP_MODE_STOP (0x3 << 24) -+#define MXC_CCM_CCTL_UPLL_DISABLE (1 << 23) -+#define MXC_CCM_CCTL_MPLL_BYPASS (1 << 22) -+#define MXC_CCM_CCTL_USB_DIV_OFFSET 16 -+#define MXC_CCM_CCTL_USB_DIV_MASK (0x3 << 16) -+#define MXC_CCM_CCTL_CG_CTRL (1 << 15) -+#define MXC_CCM_CCTL_ARM_SRC (1 << 14) -+ -+#define MXC_CCM_CGCR0_HCLK_ATA_OFFSET 16 -+#define MXC_CCM_CGCR0_HCLK_BROM_OFFSET 17 -+#define MXC_CCM_CGCR0_HCLK_CSI_OFFSET 18 -+#define MXC_CCM_CGCR0_HCLK_EMI_OFFSET 19 -+#define MXC_CCM_CGCR0_HCLK_ESAI_OFFSET 20 -+#define MXC_CCM_CGCR0_HCLK_ESDHC1_OFFSET 21 -+#define MXC_CCM_CGCR0_HCLK_ESDHC2_OFFSET 22 -+#define MXC_CCM_CGCR0_HCLK_FEC_OFFSET 23 -+#define MXC_CCM_CGCR0_HCLK_LCDC_OFFSET 24 -+#define MXC_CCM_CGCR0_HCLK_RTIC_OFFSET 25 -+#define MXC_CCM_CGCR0_HCLK_SDMA_OFFSET 26 -+#define MXC_CCM_CGCR0_HCLK_SLCDC_OFFSET 27 -+#define MXC_CCM_CGCR0_HCLK_USBOTG_OFFSET 28 -+ -+#define MXC_CCM_CGCR0_PER_CSI_OFFSET 0 -+#define MXC_CCM_CGCR0_PER_EPIT_OFFSET 1 -+#define MXC_CCM_CGCR0_PER_ESAI_OFFSET 2 -+#define MXC_CCM_CGCR0_PER_ESDHC1_OFFSET 3 -+#define MXC_CCM_CGCR0_PER_ESDHC2_OFFSET 4 -+#define MXC_CCM_CGCR0_PER_GPT_OFFSET 5 -+#define MXC_CCM_CGCR0_PER_I2C_OFFSET 6 -+#define MXC_CCM_CGCR0_PER_LCDC_OFFSET 7 -+#define MXC_CCM_CGCR0_PER_NFC_OFFSET 8 -+#define MXC_CCM_CGCR0_PER_OWIRE_OFFSET 9 -+#define MXC_CCM_CGCR0_PER_PWM_OFFSET 10 -+#define MXC_CCM_CGCR0_PER_SIM1_OFFSET 11 -+#define MXC_CCM_CGCR0_PER_SIM2_OFFSET 12 -+#define MXC_CCM_CGCR0_PER_SSI1_OFFSET 13 -+#define MXC_CCM_CGCR0_PER_SSI2_OFFSET 14 -+#define MXC_CCM_CGCR0_PER_UART_OFFSET 15 -+ -+#define MXC_CCM_CGCR1_AUDMUX_OFFSET 0 -+#define MXC_CCM_CGCR1_ATA_OFFSET 1 -+#define MXC_CCM_CGCR1_CAN1_OFFSET 2 -+#define MXC_CCM_CGCR1_CAN2_OFFSET 3 -+#define MXC_CCM_CGCR1_CSI_OFFSET 4 -+#define MXC_CCM_CGCR1_CSPI1_OFFSET 5 -+#define MXC_CCM_CGCR1_CSPI2_OFFSET 6 -+#define MXC_CCM_CGCR1_CSPI3_OFFSET 7 -+#define MXC_CCM_CGCR1_DRYICE_OFFSET 8 -+#define MXC_CCM_CGCR1_ECT_OFFSET 9 -+#define MXC_CCM_CGCR1_EPIT1_OFFSET 10 -+#define MXC_CCM_CGCR1_EPIT2_OFFSET 11 -+#define MXC_CCM_CGCR1_ESAI_OFFSET 12 -+#define MXC_CCM_CGCR1_ESDHC1_OFFSET 13 -+#define MXC_CCM_CGCR1_ESDHC2_OFFSET 14 -+#define MXC_CCM_CGCR1_FEC_OFFSET 15 -+#define MXC_CCM_CGCR1_GPIO1_OFFSET 16 -+#define MXC_CCM_CGCR1_GPIO2_OFFSET 17 -+#define MXC_CCM_CGCR1_GPIO3_OFFSET 18 -+#define MXC_CCM_CGCR1_GPT1_OFFSET 19 -+#define MXC_CCM_CGCR1_GPT2_OFFSET 20 -+#define MXC_CCM_CGCR1_GPT3_OFFSET 21 -+#define MXC_CCM_CGCR1_GPT4_OFFSET 22 -+#define MXC_CCM_CGCR1_I2C1_OFFSET 23 -+#define MXC_CCM_CGCR1_I2C2_OFFSET 24 -+#define MXC_CCM_CGCR1_I2C3_OFFSET 25 -+#define MXC_CCM_CGCR1_IIM_OFFSET 26 -+#define MXC_CCM_CGCR1_IOMUXC_OFFSET 27 -+#define MXC_CCM_CGCR1_KPP_OFFSET 28 -+#define MXC_CCM_CGCR1_LCDC_OFFSET 29 -+#define MXC_CCM_CGCR1_OWIRE_OFFSET 30 -+#define MXC_CCM_CGCR1_PWM1_OFFSET 31 -+ -+#define MXC_CCM_CGCR2_PWM2_OFFSET (32-32) -+#define MXC_CCM_CGCR2_PWM3_OFFSET (33-32) -+#define MXC_CCM_CGCR2_PWM4_OFFSET (34-32) -+#define MXC_CCM_CGCR2_RNGB_OFFSET (35-32) -+#define MXC_CCM_CGCR2_RTIC_OFFSET (36-32) -+#define MXC_CCM_CGCR2_SCC_OFFSET (37-32) -+#define MXC_CCM_CGCR2_SDMA_OFFSET (38-32) -+#define MXC_CCM_CGCR2_SIM1_OFFSET (39-32) -+#define MXC_CCM_CGCR2_SIM2_OFFSET (40-32) -+#define MXC_CCM_CGCR2_SLCDC_OFFSET (41-32) -+#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_UART1_OFFSET (46-32) -+#define MXC_CCM_CGCR2_UART2_OFFSET (47-32) -+#define MXC_CCM_CGCR2_UART3_OFFSET (48-32) -+#define MXC_CCM_CGCR2_UART4_OFFSET (49-32) -+#define MXC_CCM_CGCR2_UART5_OFFSET (50-32) -+#define MXC_CCM_CGCR2_WDOG_OFFSET (51-32) -+ -+#define MXC_CCM_PCDR1_PERDIV1_MASK 0x3f -+ -+#define MXC_CCM_RCSR_NF16B (1 << 14) -+ -+#define MXC_CCM_MCR_USB_XTAL_MUX_OFFSET 31 -+#define MXC_CCM_MCR_CLKO_EN_OFFSET 30 -+#define MXC_CCM_MCR_CLKO_DIV_OFFSET 24 -+#define MXC_CCM_MCR_CLKO_DIV_MASK (0x3F << 24) -+#define MXC_CCM_MCR_CLKO_SEL_OFFSET 20 -+#define MXC_CCM_MCR_CLKO_SEL_MASK (0xF << 20) -+#define MXC_CCM_MCR_ESAI_CLK_MUX_OFFSET 19 -+#define MXC_CCM_MCR_SSI2_CLK_MUX_OFFSET 18 -+#define MXC_CCM_MCR_SSI1_CLK_MUX_OFFSET 17 -+#define MXC_CCM_MCR_USB_CLK_MUX_OFFSET 16 -+ -+#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 - extern struct platform_device mxc_i2c_device1; - extern struct platform_device mxc_sdhc_device0; - extern struct platform_device mxc_sdhc_device1; -+#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 @@ -+/* -+ * Copyright 2008 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 -+ */ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#include -+#include -+ -+#include "sdma_script_code.h" -+ -+#include "karo.h" -+ -+void mx25_sdma_get_script_info(sdma_script_start_addrs * sdma_script_addr) -+{ -+ sdma_script_addr->mxc_sdma_ap_2_ap_addr = ap_2_ap_ADDR; -+ sdma_script_addr->mxc_sdma_ap_2_bp_addr = -1; -+ sdma_script_addr->mxc_sdma_bp_2_ap_addr = -1; -+ sdma_script_addr->mxc_sdma_loopback_on_dsp_side_addr = -1; -+ sdma_script_addr->mxc_sdma_mcu_interrupt_only_addr = -1; -+ -+ sdma_script_addr->mxc_sdma_firi_2_per_addr = -1; -+ sdma_script_addr->mxc_sdma_firi_2_mcu_addr = -1; -+ sdma_script_addr->mxc_sdma_per_2_firi_addr = -1; -+ sdma_script_addr->mxc_sdma_mcu_2_firi_addr = -1; -+ -+ sdma_script_addr->mxc_sdma_uart_2_per_addr = uart_2_per_ADDR; -+ sdma_script_addr->mxc_sdma_uart_2_mcu_addr = uart_2_mcu_ADDR; -+ sdma_script_addr->mxc_sdma_per_2_app_addr = per_2_app_ADDR; -+ sdma_script_addr->mxc_sdma_mcu_2_app_addr = mcu_2_app_ADDR; -+ -+ sdma_script_addr->mxc_sdma_per_2_per_addr = -1; -+ -+ sdma_script_addr->mxc_sdma_uartsh_2_per_addr = uartsh_2_per_ADDR; -+ sdma_script_addr->mxc_sdma_uartsh_2_mcu_addr = uartsh_2_mcu_ADDR; -+ sdma_script_addr->mxc_sdma_per_2_shp_addr = per_2_shp_ADDR; -+ sdma_script_addr->mxc_sdma_mcu_2_shp_addr = mcu_2_shp_ADDR; -+ -+ sdma_script_addr->mxc_sdma_ata_2_mcu_addr = ata_2_mcu_ADDR; -+ sdma_script_addr->mxc_sdma_mcu_2_ata_addr = mcu_2_ata_ADDR; -+ -+ sdma_script_addr->mxc_sdma_app_2_per_addr = app_2_per_ADDR; -+ sdma_script_addr->mxc_sdma_app_2_mcu_addr = app_2_mcu_ADDR; -+ sdma_script_addr->mxc_sdma_shp_2_per_addr = shp_2_per_ADDR; -+ sdma_script_addr->mxc_sdma_shp_2_mcu_addr = shp_2_mcu_ADDR; -+ -+ sdma_script_addr->mxc_sdma_mshc_2_mcu_addr = -1; -+ sdma_script_addr->mxc_sdma_mcu_2_mshc_addr = -1; -+ -+ sdma_script_addr->mxc_sdma_spdif_2_mcu_addr = -1; -+ sdma_script_addr->mxc_sdma_mcu_2_spdif_addr = -1; -+ -+ sdma_script_addr->mxc_sdma_asrc_2_mcu_addr = -1; -+ -+ sdma_script_addr->mxc_sdma_dptc_dvfs_addr = -1; -+ sdma_script_addr->mxc_sdma_ext_mem_2_ipu_addr = ext_mem__ipu_ram_ADDR; -+ sdma_script_addr->mxc_sdma_descrambler_addr = -1; -+ -+ sdma_script_addr->mxc_sdma_start_addr = (unsigned short *)sdma_code; -+ sdma_script_addr->mxc_sdma_ram_code_size = RAM_CODE_SIZE; -+ sdma_script_addr->mxc_sdma_ram_code_start_addr = RAM_CODE_START_ADDR; -+} -+ -+#if defined(CONFIG_MXC_WATCHDOG) || defined(CONFIG_MXC_WATCHDOG_MODULE) -+static struct resource wdt_resources[] = { -+ { -+ .start = WDOG_BASE_ADDR, -+ .end = WDOG_BASE_ADDR + 0x2f, -+ .flags = IORESOURCE_MEM, -+ }, -+}; -+ -+static struct platform_device mx25_wdt_device = { -+ .name = "mxc_wdt", -+ .id = 0, -+ .num_resources = ARRAY_SIZE(wdt_resources), -+ .resource = wdt_resources, -+}; -+ -+static void mx25_init_wdt(void) -+{ -+ (void)platform_device_register(&mx25_wdt_device); -+} -+#else -+static inline void mx25_init_wdt(void) -+{ -+} -+#endif -+ -+/* -+ * lcdc: -+ * - i.MX1: the basic controller -+ * - i.MX21: to be checked -+ * - i.MX27: like i.MX1, with slightly variations -+ */ -+static struct resource mxc_fb[] = { -+ { -+ .start = LCDC_BASE_ADDR, -+ .end = LCDC_BASE_ADDR + 0xFFF, -+ .flags = IORESOURCE_MEM, -+ }, -+ { -+ .start = MXC_INT_LCDC, -+ .end = MXC_INT_LCDC, -+ .flags = IORESOURCE_IRQ, -+ } -+}; -+ -+/* mxc lcd driver */ -+struct platform_device mxc_fb_device = { -+ .name = "imx-fb", -+ .id = 0, -+ .num_resources = ARRAY_SIZE(mxc_fb), -+ .resource = mxc_fb, -+ .dev = { -+ .coherent_dma_mask = 0xFFFFFFFF, -+ }, -+}; -+ -+/* SPI controller and device data */ -+#if defined(CONFIG_SPI_MXC) || defined(CONFIG_SPI_MXC_MODULE) -+ -+#ifdef CONFIG_SPI_MXC_SELECT1 -+/*! -+ * 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, -+ }, -+}; -+ -+/*! Platform Data for MXC CSPI1 */ -+static struct mxc_spi_master mx25_spi1_data = { -+ .maxchipselect = 4, -+ .spi_version = 7, -+}; -+ -+/*! Device Definition for MXC CSPI1 */ -+static struct platform_device mx25_spi1_device = { -+ .name = "mxc_spi", -+ .id = 0, -+ .dev = { -+ .platform_data = &mx25_spi1_data, -+ }, -+ .num_resources = ARRAY_SIZE(mx25_spi1_resources), -+ .resource = mx25_spi1_resources, -+}; -+ -+#endif /* CONFIG_SPI_MXC_SELECT1 */ -+ -+#ifdef CONFIG_SPI_MXC_SELECT2 -+/*! -+ * 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, -+ }, -+}; -+ -+/*! Platform Data for MXC CSPI2 */ -+static struct mxc_spi_master mx25_spi2_data = { -+ .maxchipselect = 4, -+ .spi_version = 7, -+}; -+ -+/*! Device Definition for MXC CSPI2 */ -+static struct platform_device mx25_spi2_device = { -+ .name = "mxc_spi", -+ .id = 1, -+ .dev = { -+ .platform_data = &mx25_spi2_data, -+ }, -+ .num_resources = ARRAY_SIZE(mx25_spi2_resources), -+ .resource = mx25_spi2_resources, -+}; -+#endif /* CONFIG_SPI_MXC_SELECT2 */ -+ -+#ifdef CONFIG_SPI_MXC_SELECT3 -+/*! -+ * 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, -+ }, -+}; -+ -+/*! Platform Data for MXC CSPI3 */ -+static struct mxc_spi_master mx25_spi3_data = { -+ .maxchipselect = 4, -+ .spi_version = 7, -+}; -+ -+/*! Device Definition for MXC CSPI3 */ -+static struct platform_device mx25_spi3_device = { -+ .name = "mxc_spi", -+ .id = 2, -+ .dev = { -+ .platform_data = &mx25_spi3_data, -+ }, -+ .num_resources = ARRAY_SIZE(mx25_spi3_resources), -+ .resource = mx25_spi3_resources, -+}; -+#endif /* CONFIG_SPI_MXC_SELECT3 */ -+ -+static inline void mx25_init_spi(void) -+{ -+ spba_take_ownership(SPBA_CSPI2, SPBA_MASTER_A); -+ spba_take_ownership(SPBA_CSPI3, SPBA_MASTER_A); -+ -+#ifdef CONFIG_SPI_MXC_SELECT1 -+ if (platform_device_register(&mx25_spi1_device) < 0) -+ printk(KERN_ERR "Error: Registering the SPI Controller_1\n"); -+#endif /* CONFIG_SPI_MXC_SELECT1 */ -+#ifdef CONFIG_SPI_MXC_SELECT2 -+ if (platform_device_register(&mx25_spi2_device) < 0) -+ printk(KERN_ERR "Error: Registering the SPI Controller_2\n"); -+#endif /* CONFIG_SPI_MXC_SELECT2 */ -+#ifdef CONFIG_SPI_MXC_SELECT3 -+ if (platform_device_register(&mx25_spi3_device) < 0) -+ printk(KERN_ERR "Error: Registering the SPI Controller_3\n"); -+#endif /* CONFIG_SPI_MXC_SELECT3 */ -+} -+#else -+static inline void mx25_init_spi(void) -+{ -+} -+#endif -+ -+/* I2C controller and device data */ -+#if defined(CONFIG_I2C_IMX) || defined(CONFIG_I2C_IMX_MODULE) -+ -+/*! -+ * 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, -+ }, -+}; -+ -+/*! -+ * 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, -+ }, -+}; -+ -+/*! -+ * 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, -+ }, -+}; -+ -+/*! Device Definition for MXC I2C1 */ -+struct platform_device mx25_i2c_device0 = { -+ .name = "imx-i2c", -+ .id = 0, -+ .num_resources = ARRAY_SIZE(mx25_i2c1_resources), -+ .resource = mx25_i2c1_resources, -+}; -+ -+struct platform_device mx25_i2c_device1 = { -+ .name = "imx-i2c", -+ .id = 1, -+ .num_resources = ARRAY_SIZE(mx25_i2c2_resources), -+ .resource = mx25_i2c2_resources, -+}; -+ -+struct platform_device mx25_i2c_device2 = { -+ .name = "imx-i2c", -+ .id = 2, -+ .num_resources = ARRAY_SIZE(mx25_i2c3_resources), -+ .resource = mx25_i2c3_resources, -+}; -+#endif -+ -+static struct mxc_gpio_port mx25_gpio_ports[] = { -+ { -+ .chip.label = "gpio-1", -+ .base = IO_ADDRESS(GPIO1_BASE_ADDR), -+ .irq = MXC_INT_GPIO1, -+ .virtual_irq_start = MXC_GPIO_IRQ_START, -+ }, -+ { -+ .chip.label = "gpio-2", -+ .base = IO_ADDRESS(GPIO2_BASE_ADDR), -+ .irq = MXC_INT_GPIO2, -+ .virtual_irq_start = MXC_GPIO_IRQ_START + 1 * 32, -+ }, -+ { -+ .chip.label = "gpio-3", -+ .base = IO_ADDRESS(GPIO3_BASE_ADDR), -+ .irq = MXC_INT_GPIO3, -+ .virtual_irq_start = MXC_GPIO_IRQ_START + 2 * 32, -+ }, -+ { -+ .chip.label = "gpio-4", -+ .base = IO_ADDRESS(GPIO4_BASE_ADDR), -+ .irq = MXC_INT_GPIO4, -+ .virtual_irq_start = MXC_GPIO_IRQ_START + 3 * 32, -+ }, -+}; -+ -+static inline void mx25_init_ssi(void) -+{ -+ /* SPBA configuration for SSI - SDMA and MCU are set */ -+ spba_take_ownership(SPBA_SSI1, SPBA_MASTER_A | SPBA_MASTER_C); -+ spba_take_ownership(SPBA_SSI2, SPBA_MASTER_A | SPBA_MASTER_C); -+} -+ -+static struct platform_device mx25_dma_device = { -+ .name = "mxc_dma", -+ .id = 0, -+}; -+ -+static inline void mx25_init_dma(void) -+{ -+ (void)platform_device_register(&mx25_dma_device); -+} -+ -+static int __init mx25_init_devices(void) -+{ -+ mx25_init_wdt(); -+ mx25_init_spi(); -+ mx25_init_dma(); -+ mx25_init_ssi(); -+ -+ return 0; -+} -+arch_initcall(mx25_init_devices); -+ -+int __init mxc_register_gpios(void) -+{ -+ 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 -@@ -26,6 +26,7 @@ - #include - - /* MX27 memory map definition */ -+#if defined(CONFIG_MACH_MX27) || defined(CONFIG_MACH_MX21) - static struct map_desc mxc_io_desc[] __initdata = { - /* - * this fixed mapping covers: -@@ -61,7 +62,7 @@ static struct map_desc mxc_io_desc[] __i - .pfn = __phys_to_pfn(X_MEMC_BASE_ADDR), - .length = X_MEMC_SIZE, - .type = MT_DEVICE -- } -+ }, - }; - - /* -@@ -82,4 +83,46 @@ void __init mx27_map_io(void) - - iotable_init(mxc_io_desc, ARRAY_SIZE(mxc_io_desc)); - } -+#endif -+ -+#ifdef CONFIG_MACH_MX25 -+static struct map_desc mx25_io_desc[] __initdata = { -+ { -+ .virtual = (unsigned long)X_MEMC_BASE_ADDR_VIRT, -+ .pfn = __phys_to_pfn(X_MEMC_BASE_ADDR), -+ .length = X_MEMC_SIZE, -+ .type = MT_DEVICE -+ }, -+ { -+ .virtual = (unsigned long)ASIC_BASE_ADDR_VIRT, -+ .pfn = __phys_to_pfn(ASIC_BASE_ADDR), -+ .length = ASIC_SIZE, -+ .type = MT_DEVICE_NONSHARED -+ }, -+ { -+ .virtual = (unsigned long)AIPS1_BASE_ADDR_VIRT, -+ .pfn = __phys_to_pfn(AIPS1_BASE_ADDR), -+ .length = AIPS1_SIZE, -+ .type = MT_DEVICE_NONSHARED -+ }, -+ { -+ .virtual = (unsigned long)AIPS2_BASE_ADDR_VIRT, -+ .pfn = __phys_to_pfn(AIPS2_BASE_ADDR), -+ .length = AIPS2_SIZE, -+ .type = MT_DEVICE_NONSHARED -+ }, -+ { -+ .virtual = (unsigned long)SPBA0_BASE_ADDR_VIRT, -+ .pfn = __phys_to_pfn(SPBA0_BASE_ADDR), -+ .length = SPBA0_SIZE, -+ .type = MT_DEVICE_NONSHARED -+ }, -+}; -+ -+void __init mx25_map_io(void) -+{ -+ mxc_set_cpu_type(MXC_CPU_MX25); - -+ 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 @@ -+/* -+ * arch/arm/mach-mx2/karo-tx25.c -+ * -+ * Copyright (C) 2008 Lothar Wassmann -+ * -+ * based on: arch/arm/mach-mx27ads.c (C) 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 -+ * 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 -+ * -+ * This file adds support for the Ka-Ro electronics TX25 processor modules -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+//#include -+//#include -+#include -+#include -+#include -+#if defined(CONFIG_MTD) || defined(CONFIG_MTD_MODULE) -+#include -+#include -+#include -+#include -+#endif -+ -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+//#include -+//#include -+#include -+#include -+#include -+//#include -+//#include -+//#include -+ -+#include "crm_regs.h" -+#include "devices.h" -+#include "karo.h" -+ -+#ifdef DEBUG -+int tx25_debug = 1; -+module_param(tx25_debug, int, S_IRUGO | S_IWUSR); -+#else -+static int tx25_debug; -+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) -+{ -+ 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); -+ } -+ } -+ 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; -+} -+device_initcall(tx25_usbh2_register); -+#endif // CONFIG_USB_EHCI_MXC -+ -+//#define FEC_MII_IRQ IRQ_GPIOD(8) -+ -+#if defined(CONFIG_FEC) || defined(CONFIG_FEC_MODULE) -+static struct resource fec_resources[] = { -+ { -+ .start = FEC_BASE_ADDR, -+ .end = FEC_BASE_ADDR + 0x18f, -+ .flags = IORESOURCE_MEM, -+ }, { -+ .start = FEC_BASE_ADDR + 0x200, -+ .end = FEC_BASE_ADDR + 0x30b, -+ .flags = IORESOURCE_MEM, -+ }, { -+ .start = MXC_INT_FEC, -+ .end = MXC_INT_FEC, -+ .flags = IORESOURCE_IRQ, -+#ifdef FEC_MII_IRQ -+ }, { -+ .start = FEC_MII_IRQ, -+ .end = FEC_MII_IRQ, -+ .flags = IORESOURCE_IRQ | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, -+#endif -+ }, -+}; -+ -+/* -+ * Setup GPIO for FEC device to be active -+ * -+ */ -+static struct pad_desc karo_tx25_fec_gpios_off[] = { -+ MX25_PAD_FEC_MDC__GPIO_3_5, -+ MX25_PAD_FEC_MDIO__GPIO_3_6, -+ MX25_PAD_FEC_TDATA0__GPIO_3_7, -+ MX25_PAD_FEC_TDATA1__GPIO_3_8, -+ MX25_PAD_FEC_TX_EN__GPIO_3_9, -+ MX25_PAD_FEC_RDATA0__GPIO_3_10, -+ MX25_PAD_FEC_RDATA1__GPIO_3_11, -+ MX25_PAD_FEC_RX_DV__GPIO_3_12, -+ MX25_PAD_FEC_TX_CLK__GPIO_3_13, -+ MX25_PAD_D12__GPIO_4_8, -+ MX25_PAD_D10__GPIO_4_10, -+}; -+ -+static struct pad_desc karo_tx25_fec_pwr_gpios[] = { -+ MX25_PAD_D11__GPIO_4_9, /* FEC PHY power on pin */ -+ MX25_PAD_D13__GPIO_4_7, /* FEC reset */ -+}; -+ -+static struct pad_desc karo_tx25_fec_gpios_on[] = { -+ MX25_PAD_FEC_MDC__FEC_MDC, -+ MX25_PAD_FEC_MDIO__FEC_MDIO, -+ MX25_PAD_FEC_TDATA0__FEC_TDATA0, -+ MX25_PAD_FEC_TDATA1__FEC_TDATA1, -+ MX25_PAD_FEC_TX_EN__FEC_TX_EN, -+ MX25_PAD_FEC_RDATA0__FEC_RDATA0, -+ MX25_PAD_FEC_RDATA1__FEC_RDATA1, -+ MX25_PAD_FEC_RX_DV__FEC_RX_DV, -+ MX25_PAD_FEC_TX_CLK__FEC_TX_CLK, -+ MX25_PAD_D12__GPIO_4_8, -+ MX25_PAD_D10__GPIO_4_10, -+}; -+ -+static struct gpio_desc { -+ unsigned int gpio:7; -+ unsigned int dir:1; -+ unsigned int level:1; -+} karo_tx25_fec_strap_gpios[] = { -+ /* configure the PHY strap pins to the correct values */ -+ { GPIO_PORTC | 5, 1, 0, }, -+ { GPIO_PORTC | 6, 1, 0, }, -+ { GPIO_PORTC | 7, 1, 0, }, -+ { GPIO_PORTC | 8, 1, 0, }, -+ { GPIO_PORTC | 9, 1, 0, }, -+ { GPIO_PORTC | 10, 1, 1, }, -+ { GPIO_PORTC | 11, 1, 1, }, -+ { GPIO_PORTC | 12, 0, 1, }, -+ { GPIO_PORTC | 13, 1, 0, }, -+ -+ { GPIO_PORTD | 8, 0, 0, }, -+ { GPIO_PORTD | 10, 0, 0, }, -+ { GPIO_PORTD | 9, 1, 1, }, -+ { GPIO_PORTD | 7, 1, 0, }, -+}; -+ -+#define TX25_FEC_PWR_GPIO (GPIO_PORTD | 9) -+#define TX25_FEC_RST_GPIO (GPIO_PORTD | 7) -+ -+static int gpio_fec_active(void) -+{ -+ int ret; -+ int i; -+ -+#ifdef FEC_MII_IRQ -+ DBG(0, "%s: Using IRQ %d (GPIO %d) for MII\n", __FUNCTION__, -+ FEC_MII_IRQ, irq_to_gpio(FEC_MII_IRQ)); -+ -+ set_irq_type(FEC_MII_IRQ, IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING); -+#endif -+ ret = mxc_iomux_v3_setup_multiple_pads(karo_tx25_fec_pwr_gpios, -+ ARRAY_SIZE(karo_tx25_fec_pwr_gpios)); -+ if (ret) { -+ return ret; -+ } -+ /* -+ * If the PHY is already powered on, assume it has been -+ * correctly configured (by the boot loader) -+ */ -+ if (0 && gpio_get_value(TX25_FEC_PWR_GPIO) && -+ gpio_get_value(TX25_FEC_RST_GPIO)) { -+ ret = mxc_iomux_v3_setup_multiple_pads(karo_tx25_fec_gpios_on, -+ ARRAY_SIZE(karo_tx25_fec_gpios_on)); -+ if (ret) { -+ mxc_iomux_v3_release_multiple_pads(karo_tx25_fec_pwr_gpios, -+ ARRAY_SIZE(karo_tx25_fec_pwr_gpios)); -+ return ret; -+ } -+ } else { -+ /* switch PHY strap pins into required state */ -+ ret = mxc_iomux_v3_setup_multiple_pads(karo_tx25_fec_gpios_off, -+ ARRAY_SIZE(karo_tx25_fec_gpios_off)); -+ if (ret) { -+ mxc_iomux_v3_release_multiple_pads(karo_tx25_fec_pwr_gpios, -+ ARRAY_SIZE(karo_tx25_fec_pwr_gpios)); -+ 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]; -+ -+ ret = gpio_request(pd->gpio, "FEC"); -+ if (ret < 0) { -+ DBG(0, "%s: Failed to request GPIO%d_%d: %d\n", -+ __FUNCTION__, pd->gpio / 32 + 1, pd->gpio % 32, ret); -+ goto rel_mux; -+ } -+ if (pd->dir) { -+ gpio_direction_output(pd->gpio, -+ pd->level); -+ } else { -+ gpio_direction_input(pd->gpio); -+ } -+ } -+#ifdef DEBUG -+ for (i = 0; i < ARRAY_SIZE(karo_tx25_fec_strap_gpios); i++) { -+ struct gpio_desc *pd = &karo_tx25_fec_strap_gpios[i]; -+ int grp = pd->gpio / 32 + 1; -+ int ofs = pd->gpio % 32; -+ -+ if (pd->dir && pd->level != gpio_get_value(pd->gpio)) { -+ DBG(0, "%s: GPIO%d_%d is %d instead of %d\n", __FUNCTION__, -+ grp, ofs, gpio_get_value(pd->gpio), -+ pd->level); -+ } -+ } -+#endif -+ DBG(0, "%s: Delaying for 22ms\n", __FUNCTION__); -+ mdelay(22); -+ DBG(0, "%s: Deasserting FEC PHY reset\n", __FUNCTION__); -+ gpio_set_value(TX25_FEC_RST_GPIO, 1); -+#ifdef DEBUG -+ for (i = 0; i < ARRAY_SIZE(karo_tx25_fec_strap_gpios); i++) { -+ struct gpio_desc *pd = &karo_tx25_fec_strap_gpios[i]; -+ int grp = pd->gpio / 32 + 1; -+ int ofs = pd->gpio % 32; -+ -+ DBG(0, "%s: GPIO%d_%d is %d\n", __FUNCTION__, -+ grp, ofs, gpio_get_value(pd->gpio)); -+ } -+#endif -+ mxc_iomux_v3_release_multiple_pads(karo_tx25_fec_gpios_off, -+ ARRAY_SIZE(karo_tx25_fec_gpios_off)); -+ ret = mxc_iomux_v3_setup_multiple_pads(karo_tx25_fec_gpios_on, -+ ARRAY_SIZE(karo_tx25_fec_gpios_on)); -+ if (ret) { -+ goto rel_gpio; -+ } -+#ifdef DEBUG -+ for (i = 0; i < ARRAY_SIZE(karo_tx25_fec_strap_gpios); i++) { -+ struct gpio_desc *pd = &karo_tx25_fec_strap_gpios[i]; -+ int grp = pd->gpio / 32 + 1; -+ int ofs = pd->gpio % 32; -+ -+ DBG(0, "%s: GPIO%d_%d is %d\n", __FUNCTION__, -+ grp, ofs, gpio_get_value(pd->gpio)); -+ } -+#endif -+ } -+ return ret; -+ -+ rel_mux: -+ mxc_iomux_v3_release_multiple_pads(karo_tx25_fec_gpios_off, -+ ARRAY_SIZE(karo_tx25_fec_gpios_off)); -+ 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, -+ ARRAY_SIZE(karo_tx25_fec_pwr_gpios)); -+ return ret; -+} -+ -+/* -+ * Setup GPIO for FEC device to be inactive -+ * -+ */ -+static void gpio_fec_inactive(void) -+{ -+ int i; -+ -+ mxc_iomux_v3_release_multiple_pads(karo_tx25_fec_gpios_on, -+ ARRAY_SIZE(karo_tx25_fec_gpios_on)); -+ mxc_iomux_v3_setup_multiple_pads(karo_tx25_fec_gpios_off, -+ ARRAY_SIZE(karo_tx25_fec_gpios_off)); -+ DBG(0, "%s: Asserting FEC PHY reset\n", __FUNCTION__); -+ gpio_set_value(TX25_FEC_RST_GPIO, 0); -+ DBG(0, "%s: Switching FEC PHY power off\n", __FUNCTION__); -+ gpio_set_value(TX25_FEC_PWR_GPIO, 0); -+ -+ mxc_iomux_v3_release_multiple_pads(karo_tx25_fec_gpios_off, -+ ARRAY_SIZE(karo_tx25_fec_gpios_off)); -+ mxc_iomux_v3_release_multiple_pads(karo_tx25_fec_pwr_gpios, -+ 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); -+ } -+} -+ -+static struct clk *tx25_fec_clk; -+ -+static int tx25_fec_suspend(struct platform_device *pdev) -+{ -+ BUG_ON(tx25_fec_clk == NULL); -+ DBG(1, "%s: Switching FEC PHY off\n", __FUNCTION__); -+ gpio_fec_inactive(); -+ clk_disable(tx25_fec_clk); -+ return 0; -+} -+ -+static int tx25_fec_resume(struct platform_device *pdev) -+{ -+ BUG_ON(tx25_fec_clk == NULL); -+ DBG(1, "%s: Switching FEC PHY on\n", __FUNCTION__); -+ clk_enable(tx25_fec_clk); -+ gpio_fec_active(); -+ 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; -+ -+ DBG(0, "%s: Activating FEC GPIOs\n", __FUNCTION__); -+ dump_regs(); -+ -+ ret = gpio_fec_active(); -+ if (ret) { -+ printk(KERN_ERR "%s: could not enable FEC gpios: %d\n", __FUNCTION__, ret); -+ return ret; -+ } -+ -+ BUG_ON(tx25_fec_clk != NULL); -+ tx25_fec_clk = clk_get(&pdev->dev, NULL); -+ if (unlikely(IS_ERR(tx25_fec_clk))) { -+ printk(KERN_ERR "Failed to get fec_clk\n"); -+ return PTR_ERR(tx25_fec_clk); -+ } -+ DBG(0, "%s: Enabling FEC clock\n", __FUNCTION__); -+ clk_enable(tx25_fec_clk); -+ dump_regs(); -+ return 0; -+} -+ -+static void fec_arch_exit(struct platform_device *pdev) -+{ -+ BUG_ON(tx25_fec_clk == NULL); -+ if (unlikely(IS_ERR(tx25_fec_clk))) { -+ printk(KERN_ERR "Failed to get fec_clk\n"); -+ return; -+ } -+ DBG(0, "%s: Disabling FEC clock\n", __FUNCTION__); -+ clk_disable(tx25_fec_clk); -+ clk_put(tx25_fec_clk); -+ tx25_fec_clk = NULL; -+ DBG(0, "%s: Deactivating FEC GPIOs\n", __FUNCTION__); -+ gpio_fec_inactive(); -+} -+ -+static struct fec_enet_platform_data fec_data = { -+ .arch_init = fec_arch_init, -+ .arch_exit = fec_arch_exit, -+ .suspend = tx25_fec_suspend, -+ .resume = tx25_fec_resume, -+}; -+ -+static struct platform_device fec_device = { -+ .name = "fec", -+ .id = 0, -+ .num_resources = ARRAY_SIZE(fec_resources), -+ .resource = fec_resources, -+ .dev = { -+ .platform_data = &fec_data, -+ .coherent_dma_mask = 0xFFFFFFFF, -+ }, -+}; -+#endif -+ -+/* 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, -+ MX25_PAD_NFRE_B__NFRE_B, -+ MX25_PAD_NFALE__NFALE, -+ MX25_PAD_NFCLE__NFCLE, -+ MX25_PAD_NFWP_B__NFWP_B, -+ MX25_PAD_NFRB__NFRB, -+ MX25_PAD_D7__D7, -+ MX25_PAD_D6__D6, -+ MX25_PAD_D5__D5, -+ MX25_PAD_D4__D4, -+ MX25_PAD_D3__D3, -+ MX25_PAD_D2__D2, -+ MX25_PAD_D1__D1, -+ MX25_PAD_D0__D0, -+}; -+ -+static int tx25_nand_init(void) -+{ -+ int ret; -+ -+ DBG(0, "%s: Configuring NAND pins\n", __FUNCTION__); -+ ret = mxc_iomux_v3_setup_multiple_pads(karo_tx25_nand_pads, -+ ARRAY_SIZE(karo_tx25_nand_pads)); -+ if (ret) { -+ return ret; -+ } -+ 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 -+ -+static struct resource tx25_nand_resources[] = { -+#ifdef CONFIG_ARCH_MXC_HAS_NFC_V1_1 -+ { -+ .start = NFC_BASE_ADDR + 0x1e00, -+ .end = NFC_BASE_ADDR + 0x1e2f, -+ .flags = IORESOURCE_MEM, -+ }, { -+ .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, -+ .flags = IORESOURCE_IRQ, -+ }, -+}; -+ -+static struct platform_device tx25_nand_mtd_device = { -+ .name = "mxc_nand", -+ .id = 0, -+ .num_resources = ARRAY_SIZE(tx25_nand_resources), -+ .resource = tx25_nand_resources, -+ .dev = { -+ .platform_data = &tx25_nand_data, -+ }, -+}; -+#endif -+ -+#if defined(CONFIG_VIDEO_MXC_EMMA_OUTPUT) || defined(CONFIG_VIDEO_MXC_EMMA_OUTPUT_MODULE) -+static u64 mxc_emma_dmamask = 0xffffffffUL; -+ -+static struct platform_device tx25_v4l2out_device = { -+ .name = "MXC Video Output", -+ .id = 0, -+ .dev = { -+ .dma_mask = &mxc_emma_dmamask, -+ .coherent_dma_mask = ~0UL, -+ }, -+}; -+#endif -+ -+#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, -+}; -+ -+static int karo_tx25_i2c_0_init(struct device *dev) -+{ -+ DBG(-1, "%s: \n", __FUNCTION__); -+ return mxc_iomux_v3_setup_multiple_pads(mxc_i2c0_pins, -+ ARRAY_SIZE(mxc_i2c0_pins)); -+} -+ -+static void karo_tx25_i2c_0_exit(struct device *dev) -+{ -+ DBG(-1, "%s: \n", __FUNCTION__); -+ mxc_iomux_v3_release_multiple_pads(mxc_i2c0_pins, -+ ARRAY_SIZE(mxc_i2c0_pins)); -+} -+ -+static struct imxi2c_platform_data karo_tx25_i2c_0_data = { -+ .bitrate = 100000, -+ .init = karo_tx25_i2c_0_init, -+ .exit = karo_tx25_i2c_0_exit, -+}; -+ -+static struct at24_platform_data karo_tx25_eeprom = { -+ .byte_len = 2048, -+ .page_size = 32, -+ .flags = AT24_FLAG_ADDR16 | AT24_FLAG_TAKE8ADDR, -+}; -+ -+static struct i2c_board_info karo_i2c_0_boardinfo[] __initdata = { -+ { -+ I2C_BOARD_INFO("24c16", 0x50), -+ .platform_data = &karo_tx25_eeprom, -+ .type = "24c16", -+ }, -+}; -+ -+int __init karo_i2c_init(void) -+{ -+ int ret; -+ -+ DBG(0, "%s: Registering I2C bus 0\n", __FUNCTION__); -+ ret = mxc_register_device(&mx25_i2c_device0, &karo_tx25_i2c_0_data); -+ if (ret != 0) { -+ printk(KERN_ERR "Failed to register I2C device: %d\n", ret); -+ return ret; -+ } -+ ret = i2c_register_board_info(0, karo_i2c_0_boardinfo, -+ ARRAY_SIZE(karo_i2c_0_boardinfo)); -+ if (ret != 0) { -+ printk(KERN_ERR "Failed to register I2C board info: %d\n", ret); -+ } -+ return ret; -+} -+device_initcall(karo_i2c_init); -+#endif -+#endif -+ -+struct platform_dev_list { -+ struct platform_device *pdev; -+ int flag; -+} tx25_devices[] __initdata = { -+#if defined(CONFIG_RTC_MXC) || defined(CONFIG_RTC_MXC_MODULE) -+ { .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, }, -+#endif -+#if defined(CONFIG_FEC) || defined(CONFIG_FEC_MODULE) -+ { .pdev = &fec_device, .flag = 1, }, -+#endif -+#if defined(CONFIG_SPI_MXC) || defined(CONFIG_SPI_MXC_MODULE) -+ { .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, }, -+#endif -+#if defined(CONFIG_MXC_VPU) || defined(CONFIG_MXC_VPU_MODULE) -+ { .pdev = &mxc_vpu_device, .flag = 1, }, -+#endif -+}; -+#define TX25_NUM_DEVICES ARRAY_SIZE(tx25_devices) -+ -+static __init void karo_tx25_board_init(void) -+{ -+ int i; -+ -+ DBG(0, "%s: \n", __FUNCTION__); -+ -+ dump_regs(); -+ -+ for (i = 0; i < TX25_NUM_DEVICES; i++) { -+ int ret; -+ -+ if (tx25_devices[i].pdev == NULL) continue; -+ if (!tx25_devices[i].flag) { -+ DBG(0, "%s: Skipping platform device[%d] @ %p dev %p: %s\n", -+ __FUNCTION__, i, tx25_devices[i].pdev, &tx25_devices[i].pdev->dev, -+ tx25_devices[i].pdev->name); -+ continue; -+ } -+ DBG(0, "%s: Registering platform device[%d] @ %p dev %p: %s\n", -+ __FUNCTION__, i, tx25_devices[i].pdev, &tx25_devices[i].pdev->dev, -+ tx25_devices[i].pdev->name); -+ ret = platform_device_register(tx25_devices[i].pdev); -+ if (ret) { -+ printk(KERN_WARNING "%s: Failed to register platform_device[%d]: %s: %d\n", -+ __FUNCTION__, i, tx25_devices[i].pdev->name, ret); -+ } -+ } -+ DBG(0, "%s: Done\n", __FUNCTION__); -+} -+ -+static struct pad_desc karo_tx25_gpios[] __initdata = { -+ MX25_PAD_GPIO_A__GPIO_A, -+ MX25_PAD_GPIO_B__GPIO_B, -+ MX25_PAD_GPIO_C__GPIO_C, -+ MX25_PAD_GPIO_D__GPIO_D, -+ MX25_PAD_GPIO_E__GPIO_E, -+ MX25_PAD_GPIO_F__GPIO_F, -+ MX25_PAD_CSI_D7__GPIO_1_6, -+ MX25_PAD_CSI_D8__GPIO_1_7, -+ MX25_PAD_CSI_MCLK__GPIO_1_8, -+ MX25_PAD_CSI_VSYNC__GPIO_1_9, -+ MX25_PAD_CSI_HSYNC__GPIO_1_10, -+ MX25_PAD_CSI_PIXCLK__GPIO_1_11, -+ MX25_PAD_I2C1_CLK__GPIO_1_12, -+ MX25_PAD_I2C1_DAT__GPIO_1_13, -+ MX25_PAD_CSPI1_MOSI__GPIO_1_14, -+ MX25_PAD_CSPI1_MISO__GPIO_1_15, -+ MX25_PAD_CSPI1_SS0__GPIO_1_16, -+ MX25_PAD_CSPI1_SS1__GPIO_1_17, -+ MX25_PAD_CSPI1_SCLK__GPIO_1_18, -+ MX25_PAD_LD5__GPIO_1_19, -+ MX25_PAD_LD6__GPIO_1_20, -+ MX25_PAD_LD7__GPIO_1_21, -+ MX25_PAD_HSYNC__GPIO_1_22, -+ MX25_PAD_VSYNC__GPIO_1_23, -+ MX25_PAD_LSCLK__GPIO_1_24, -+ MX25_PAD_OE_ACD__GPIO_1_25, -+ MX25_PAD_PWM__GPIO_1_26, -+ MX25_PAD_CSI_D2__GPIO_1_27, -+ MX25_PAD_CSI_D3__GPIO_1_28, -+ MX25_PAD_CSI_D4__GPIO_1_29, -+ MX25_PAD_CSI_D5__GPIO_1_30, -+ MX25_PAD_CSI_D6__GPIO_1_31, -+ -+ MX25_PAD_A14__GPIO_2_0, -+ MX25_PAD_A15__GPIO_2_1, -+ MX25_PAD_A16__GPIO_2_2, -+ MX25_PAD_A17__GPIO_2_3, -+ MX25_PAD_A18__GPIO_2_4, -+ MX25_PAD_A19__GPIO_2_5, -+ MX25_PAD_A20__GPIO_2_6, -+ MX25_PAD_A21__GPIO_2_7, -+ MX25_PAD_A22__GPIO_2_8, -+ MX25_PAD_A23__GPIO_2_9, -+ MX25_PAD_A24__GPIO_2_10, -+ MX25_PAD_A25__GPIO_2_11, -+ MX25_PAD_EB0__GPIO_2_12, -+ MX25_PAD_EB1__GPIO_2_13, -+ MX25_PAD_OE__GPIO_2_14, -+ MX25_PAD_LD0__GPIO_2_15, -+ MX25_PAD_LD1__GPIO_2_16, -+ MX25_PAD_LD2__GPIO_2_17, -+ MX25_PAD_LD3__GPIO_2_18, -+ MX25_PAD_LD4__GPIO_2_19, -+ MX25_PAD_DE_B__GPIO_2_20, -+ MX25_PAD_CLKO__GPIO_2_21, -+ MX25_PAD_CSPI1_RDY__GPIO_2_22, -+ MX25_PAD_SD1_CMD__GPIO_2_23, -+ MX25_PAD_SD1_CLK__GPIO_2_24, -+ MX25_PAD_SD1_DATA0__GPIO_2_25, -+ MX25_PAD_SD1_DATA1__GPIO_2_26, -+ MX25_PAD_SD1_DATA2__GPIO_2_27, -+ MX25_PAD_SD1_DATA3__GPIO_2_28, -+ MX25_PAD_KPP_ROW0__GPIO_2_29, -+ MX25_PAD_KPP_ROW1__GPIO_2_30, -+ MX25_PAD_KPP_ROW2__GPIO_2_31, -+ -+ MX25_PAD_KPP_ROW3__GPIO_3_0, -+ MX25_PAD_KPP_COL0__GPIO_3_1, -+ MX25_PAD_KPP_COL1__GPIO_3_2, -+ MX25_PAD_KPP_COL2__GPIO_3_3, -+ MX25_PAD_KPP_COL3__GPIO_3_4, -+ MX25_PAD_FEC_MDC__GPIO_3_5, -+ MX25_PAD_FEC_MDIO__GPIO_3_6, -+ MX25_PAD_FEC_TDATA0__GPIO_3_7, -+ MX25_PAD_FEC_TDATA1__GPIO_3_8, -+ MX25_PAD_FEC_TX_EN__GPIO_3_9, -+ MX25_PAD_FEC_RDATA0__GPIO_3_10, -+ MX25_PAD_FEC_RDATA1__GPIO_3_11, -+ MX25_PAD_FEC_RX_DV__GPIO_3_12, -+ MX25_PAD_FEC_TX_CLK__GPIO_3_13, -+ MX25_PAD_RTCK__GPIO_3_14, -+ MX25_PAD_EXT_ARMCLK__GPIO_3_15, -+ MX25_PAD_UPLL_BYPCLK__GPIO_3_16, -+ MX25_PAD_VSTBY_REQ__GPIO_3_17, -+ MX25_PAD_VSTBY_ACK__GPIO_3_18, -+ MX25_PAD_POWER_FAIL__GPIO_3_19, -+ MX25_PAD_CS4__GPIO_3_20, -+ MX25_PAD_CS5__GPIO_3_21, -+ MX25_PAD_NF_CE0__GPIO_3_22, -+ MX25_PAD_ECB__GPIO_3_23, -+ MX25_PAD_LBA__GPIO_3_24, -+ MX25_PAD_RW__GPIO_3_25, -+ MX25_PAD_NFWE_B__GPIO_3_26, -+ MX25_PAD_NFRE_B__GPIO_3_27, -+ MX25_PAD_NFALE__GPIO_3_28, -+ MX25_PAD_NFCLE__GPIO_3_29, -+ MX25_PAD_NFWP_B__GPIO_3_30, -+ MX25_PAD_NFRB__GPIO_3_31, -+ -+ MX25_PAD_A10__GPIO_4_0, -+ MX25_PAD_A13__GPIO_4_1, -+ MX25_PAD_CS0__GPIO_4_2, -+ MX25_PAD_CS1__GPIO_4_3, -+ MX25_PAD_BCLK__GPIO_4_4, -+ MX25_PAD_D15__GPIO_4_5, -+ MX25_PAD_D14__GPIO_4_6, -+ MX25_PAD_D13__GPIO_4_7, -+ MX25_PAD_D12__GPIO_4_8, -+ MX25_PAD_D11__GPIO_4_9, -+ MX25_PAD_D10__GPIO_4_10, -+ MX25_PAD_D9__GPIO_4_11, -+ MX25_PAD_D8__GPIO_4_12, -+ MX25_PAD_D7__GPIO_4_13, -+ MX25_PAD_D6__GPIO_4_14, -+ MX25_PAD_D5__GPIO_4_15, -+ MX25_PAD_D4__GPIO_4_16, -+ MX25_PAD_D3__GPIO_4_17, -+ MX25_PAD_D2__GPIO_4_18, -+ MX25_PAD_D1__GPIO_4_19, -+ MX25_PAD_D0__GPIO_4_20, -+ MX25_PAD_CSI_D9__GPIO_4_21, -+ MX25_PAD_UART1_RXD__GPIO_4_22, -+ MX25_PAD_UART1_TXD__GPIO_4_23, -+ MX25_PAD_UART1_RTS__GPIO_4_24, -+ MX25_PAD_UART1_CTS__GPIO_4_25, -+ MX25_PAD_UART2_RXD__GPIO_4_26, -+ MX25_PAD_UART2_TXD__GPIO_4_27, -+ MX25_PAD_UART2_RTS__GPIO_4_28, -+ MX25_PAD_UART2_CTS__GPIO_4_29, -+ MX25_PAD_BOOT_MODE0__GPIO_4_30, -+ MX25_PAD_BOOT_MODE1__GPIO_4_31, -+}; -+ -+static int __init karo_tx25_setup_gpios(void) -+{ -+ 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 -+ DBG(0, "%s: PAD[%d] %s set up as GPIO\n", __FUNCTION__, i, pd->name); -+#else -+ DBG(0, "%s: PAD[%d] set up as GPIO\n", __FUNCTION__, i); -+#endif -+ count++; -+ mxc_iomux_v3_release_pad(pd); -+ } else { -+#ifdef IOMUX_DEBUG -+ DBG(0, "%s: PAD[%d] %s skipped\n", __FUNCTION__, i, pd->name); -+#else -+ DBG(0, "%s: PAD[%d] skipped\n", __FUNCTION__, i); -+#endif -+ } -+ } -+ 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; -+} -+late_initcall(karo_tx25_setup_gpios); -+ -+static void __init karo_tx25_map_io(void) -+{ -+ mx25_map_io(); -+} -+ -+static void __init karo_tx25_fixup(struct machine_desc *desc, struct tag *tags, -+ char **cmdline, struct meminfo *mi) -+{ -+} -+ -+static void __init karo_tx25_timer_init(void) -+{ -+ DBG(0, "%s: \n", __FUNCTION__); -+ mx25_clocks_init(24000000); -+ DBG(0, "%s: Done\n", __FUNCTION__); -+} -+ -+struct sys_timer karo_tx25_timer = { -+ .init = karo_tx25_timer_init, -+}; -+ -+static int __init karo_mod_type_setup(char *line) -+{ -+ get_option(&line, &karo_mod_type); -+ DBG(0, "%s: Module type set to 0x%02x by kernel cmd line\n", __FUNCTION__, karo_mod_type); -+ -+ return 1; -+} -+__setup("module_type=", karo_mod_type_setup); -+ -+static int __init karo_board_type_setup(char *line) -+{ -+ get_option(&line, &karo_board_type); -+ DBG(0, "%s: Board type set to 0x%02x by kernel cmd line\n", __FUNCTION__, karo_board_type); -+ -+ return 1; -+} -+__setup("board_type=", karo_board_type_setup); -+ -+MACHINE_START(TX25, "Ka-Ro electronics TX25 module (Freescale i.MX25)") -+ /* Maintainer: */ -+ .phys_io = AIPS1_BASE_ADDR, -+ .io_pg_offst = ((unsigned long)AIPS1_BASE_ADDR_VIRT >> 18) & 0xfffc, -+ .fixup = karo_tx25_fixup, -+ .map_io = karo_tx25_map_io, -+ .init_irq = mxc_init_irq, -+ .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 -@@ -0,0 +1,99 @@ -+/* -+ * arch/arm/mach-mx2/karo.h -+ * -+ * Copyright (C) 2009 Lothar Wassmann -+ * -+ * 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 -+ * -+ * This file provides platform specific definitions for the -+ * Ka-Ro electronics TX25 processor modules -+ */ -+ -+#include -+#include "crm_regs_mx25.h" -+ -+enum { -+ BOARD_KARO_STK5, -+}; -+ -+extern int karo_board_type; -+extern int karo_mod_type; -+ -+#ifdef DEBUG -+extern int tx25_debug; -+#define dbg_lvl(n) ((n) < tx25_debug) -+#define DBG(lvl, fmt...) do { if (dbg_lvl(lvl)) printk(KERN_DEBUG fmt); } while (0) -+#else -+#define dbg_lvl(n) 0 -+#define DBG(lvl, fmt...) do { } while (0) -+#endif -+ -+static inline int karo_get_board_type(void) -+{ -+ return karo_board_type; -+} -+ -+static inline int karo_get_module_type(void) -+{ -+ return karo_mod_type; -+} -+ -+#define SHOW_REG(reg) DBG(0, "%s[%08lx]=%08x\n", #reg, MXC_PHYS_ADDRESS(reg), __raw_readl(reg)) -+ -+#define SHOW_GPIO_REG(port, reg) \ -+ DBG(0, "GPIO%d_%s[%08lx]=%08x\n", port, #reg, \ -+ GPIO_BASE_ADDR(port) + GPIO_##reg, \ -+ __raw_readl(IO_ADDRESS(GPIO_BASE_ADDR(port) + GPIO_##reg))) -+ -+static inline void dump_regs(void) -+{ -+ int i; -+ -+ SHOW_REG(MXC_CCM_MPCTL); -+ SHOW_REG(MXC_CCM_UPCTL); -+ SHOW_REG(MXC_CCM_CCTL); -+ SHOW_REG(MXC_CCM_RCSR); -+ SHOW_REG(MXC_CCM_CRDR); -+ SHOW_REG(MXC_CCM_PCDR0); -+ SHOW_REG(MXC_CCM_PCDR1); -+ SHOW_REG(MXC_CCM_PCDR2); -+ SHOW_REG(MXC_CCM_PCDR3); -+ SHOW_REG(MXC_CCM_CGCR0); -+ SHOW_REG(MXC_CCM_CGCR1); -+ SHOW_REG(MXC_CCM_CGCR2); -+ SHOW_REG(MXC_CCM_MCR); -+ SHOW_REG(MXC_CCM_PMCR0); -+ SHOW_REG(MXC_CCM_PMCR1); -+ SHOW_REG(MXC_CCM_PMCR2); -+ SHOW_REG(MXC_CCM_LTBR0); -+ SHOW_REG(MXC_CCM_LTBR1); -+ SHOW_REG(MXC_CCM_LTR0); -+ SHOW_REG(MXC_CCM_LTR1); -+ SHOW_REG(MXC_CCM_LTR2); -+ SHOW_REG(MXC_CCM_LTR3); -+ SHOW_REG(MXC_CCM_DCVR0); -+ SHOW_REG(MXC_CCM_DCVR1); -+ SHOW_REG(MXC_CCM_DCVR2); -+ SHOW_REG(MXC_CCM_DCVR3); -+ -+ for (i = 1; i <= 4; i++) { -+ SHOW_GPIO_REG(i, DR); -+ SHOW_GPIO_REG(i, GDIR); -+ SHOW_GPIO_REG(i, PSR); -+ SHOW_GPIO_REG(i, ICR1); -+ SHOW_GPIO_REG(i, ICR2); -+ SHOW_GPIO_REG(i, IMR); -+ 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 -@@ -0,0 +1,159 @@ -+ -+/* -+ * Copyright 2008 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 -+ */ -+ -+/*! -+ * @file sdma_script_code.h -+ * @brief This file contains functions of SDMA scripts code initialization -+ * -+ * The file was generated automatically. Based on sdma scripts library. -+ * -+ * @ingroup SDMA -+ */ -+/************************************************************************ -+ -+ SDMA RELEASE LABEL: "SS15_SENNA" -+ -+************************************************************************/ -+ -+#ifndef SDMA_SCRIPT_CODE_H -+#define SDMA_SCRIPT_CODE_H -+ -+/*! -+ * SDMA ROM scripts start addresses and sizes -+ */ -+#define start_ADDR 0 -+#define start_SIZE 22 -+ -+#define core_ADDR 80 -+#define core_SIZE 233 -+ -+#define common_ADDR 313 -+#define common_SIZE 416 -+ -+#define ap_2_ap_ADDR 729 -+#define ap_2_ap_SIZE 41 -+ -+#define app_2_mcu_ADDR 770 -+#define app_2_mcu_SIZE 64 -+ -+#define mcu_2_app_ADDR 834 -+#define mcu_2_app_SIZE 70 -+ -+#define uart_2_mcu_ADDR 904 -+#define uart_2_mcu_SIZE 75 -+ -+#define shp_2_mcu_ADDR 979 -+#define shp_2_mcu_SIZE 69 -+ -+#define mcu_2_shp_ADDR 1048 -+#define mcu_2_shp_SIZE 72 -+ -+#define uartsh_2_mcu_ADDR 1120 -+#define uartsh_2_mcu_SIZE 69 -+ -+#define app_2_per_ADDR 1189 -+#define app_2_per_SIZE 66 -+ -+#define per_2_app_ADDR 1255 -+#define per_2_app_SIZE 74 -+ -+#define per_2_shp_ADDR 1329 -+#define per_2_shp_SIZE 78 -+ -+#define shp_2_per_ADDR 1407 -+#define shp_2_per_SIZE 72 -+ -+#define mcu_2_ata_ADDR 1479 -+#define mcu_2_ata_SIZE 81 -+ -+#define ata_2_mcu_ADDR 1560 -+#define ata_2_mcu_SIZE 96 -+ -+#define loop_DMAs_routines_ADDR 1656 -+#define loop_DMAs_routines_SIZE 227 -+ -+#define test_ADDR 1883 -+#define test_SIZE 63 -+ -+#define signature_ADDR 1022 -+#define signature_SIZE 1 -+ -+/*! -+ * SDMA RAM scripts start addresses and sizes -+ */ -+#define ext_mem__ipu_ram_ADDR 6144 -+#define ext_mem__ipu_ram_SIZE 123 -+ -+#define uart_2_per_ADDR 6267 -+#define uart_2_per_SIZE 73 -+ -+#define uartsh_2_per_ADDR 6340 -+#define uartsh_2_per_SIZE 67 -+ -+/*! -+ * SDMA RAM image start address and size -+ */ -+#define RAM_CODE_START_ADDR 6144 -+#define RAM_CODE_SIZE 263 -+ -+/*! -+ * Buffer that holds the SDMA RAM image -+ */ -+__attribute__ ((__aligned__(4))) -+#ifndef CONFIG_XIP_KERNEL -+const -+#endif -+static const short sdma_code[] = { -+ 0x0e70, 0x0611, 0x5616, 0xc18a, 0x7d2a, 0x5ade, 0x008e, 0xc19c, -+ 0x7c26, 0x5be0, 0x5ef0, 0x5ce8, 0x0688, 0x08ff, 0x0011, 0x28ff, -+ 0x00bc, 0x53f6, 0x05df, 0x7d0b, 0x6dc5, 0x03df, 0x7d03, 0x6bd5, -+ 0xd84f, 0x982b, 0x6b05, 0xc6d8, 0x7e27, 0x7f29, 0x982b, 0x6d01, -+ 0x03df, 0x7d05, 0x6bd5, 0xc702, 0x7e18, 0x7f1a, 0x982b, 0x6b05, -+ 0xc678, 0x7e07, 0x7f06, 0x52de, 0x53e6, 0xc1a8, 0x7dd7, 0x0200, -+ 0x9803, 0x0007, 0x6004, 0x680c, 0x53f6, 0x028e, 0x00a3, 0xc2ad, -+ 0x048b, 0x0498, 0x0454, 0x068a, 0x982b, 0x0207, 0x680c, 0x6ddf, -+ 0x0107, 0x68ff, 0x60d0, 0x9834, 0x0207, 0x68ff, 0x6d28, 0x0107, -+ 0x6004, 0x680c, 0x9834, 0x0007, 0x68ff, 0x60d0, 0x9834, 0x0288, -+ 0x03a5, 0x3b03, 0x3d03, 0x4d00, 0x7d0a, 0x0804, 0x00a5, 0x00da, -+ 0x7d1a, 0x02a0, 0x7b01, 0x65d8, 0x7eee, 0x65ff, 0x7eec, 0x0804, -+ 0x02d0, 0x7d11, 0x4b00, 0x7c0f, 0x008a, 0x3003, 0x6dcf, 0x6bdf, -+ 0x0015, 0x0015, 0x7b02, 0x65d8, 0x0000, 0x7edd, 0x63ff, 0x7edb, -+ 0x3a03, 0x6dcd, 0x6bdd, 0x008a, 0x7b02, 0x65d8, 0x0000, 0x7ed3, -+ 0x65ff, 0x7ed1, 0x0006, 0xc23a, 0x57db, 0x52f3, 0x6ad5, 0x56fb, -+ 0x028e, 0x1a94, 0x6ac3, 0x62c8, 0x0269, 0x7d1e, 0x1e94, 0x6ee3, -+ 0x62d0, 0x5aeb, 0x62c8, 0x0248, 0x6ed3, 0x6ac8, 0x2694, 0x52eb, -+ 0x6ad5, 0x6ee3, 0x62c8, 0x026e, 0x7d27, 0x6ac8, 0x7f23, 0x2501, -+ 0x4d00, 0x7d26, 0x028e, 0x1a98, 0x6ac3, 0x62c8, 0x6ec3, 0x0260, -+ 0x7df1, 0x62d0, 0xc2d1, 0x98c0, 0x6ee3, 0x008f, 0x2001, 0x00d5, -+ 0x7d01, 0x008d, 0x05a0, 0x62c8, 0x026e, 0x7d0e, 0x6ac8, 0x7f0a, -+ 0x2001, 0x7cf9, 0x6add, 0x7f06, 0x0000, 0x4d00, 0x7d09, 0xc251, -+ 0x57db, 0x987f, 0x0007, 0x6aff, 0x62d0, 0xc2d1, 0x0458, 0x0454, -+ 0x6add, 0x7ff8, 0xc261, 0x987c, 0xc230, 0xc23a, 0x57db, 0x52f3, -+ 0x6ad5, 0x56fb, 0x028e, 0x1a94, 0x5202, 0x0269, 0x7d17, 0x1e94, -+ 0x5206, 0x0248, 0x5a06, 0x2694, 0x5206, 0x026e, 0x7d26, 0x6ac8, -+ 0x7f22, 0x2501, 0x4d00, 0x7d27, 0x028e, 0x1a98, 0x5202, 0x0260, -+ 0x7df3, 0x6add, 0x7f18, 0x62d0, 0xc2d1, 0x9903, 0x008f, 0x2001, -+ 0x00d5, 0x7d01, 0x008d, 0x05a0, 0x5206, 0x026e, 0x7d0e, 0x6ac8, -+ 0x7f0a, 0x2001, 0x7cf9, 0x6add, 0x7f06, 0x0000, 0x4d00, 0x7d0b, -+ 0xc251, 0x57db, 0x98c9, 0x0007, 0x6aff, 0x6add, 0x7ffc, 0x62d0, -+ 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 @@ -+/* -+ * arch/arm/mach-mx2/stk5-baseboard.c -+ * -+ * Copyright (C) 2009 Lothar Wassmann -+ * -+ * -+ * 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 -+ * -+ * This file adds support for devices found on Ka-Ro electronics -+ * Starterkit-5 (STK5) baseboard -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+//#include -+ -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+//#include -+#include -+#include -+#include -+//#include -+//#include -+#include -+ -+#include "crm_regs.h" -+#include "devices.h" -+#include "karo.h" -+ -+#if defined(CONFIG_SERIAL_IMX) || defined(CONFIG_SERIAL_IMX_MODULE) -+static struct pad_desc stk5_uart_pads[][4] = { -+ { -+ MX25_PAD_UART1_TXD__UART1_TXD, -+ MX25_PAD_UART1_RXD__UART1_RXD, -+ MX25_PAD_UART1_CTS__UART1_CTS, -+ MX25_PAD_UART1_RTS__UART1_RTS, -+ }, { -+ MX25_PAD_UART2_TXD__UART2_TXD, -+ MX25_PAD_UART2_RXD__UART2_RXD, -+ MX25_PAD_UART2_CTS__UART2_CTS, -+ MX25_PAD_UART2_RTS__UART2_RTS, -+ }, { -+ MX25_PAD_ECB__UART5_TXD_MUX, -+ MX25_PAD_LBA__UART5_RXD_MUX, -+ MX25_PAD_CS4__UART5_CTS, -+ MX25_PAD_CS5__UART5_RTS, -+#if 0 -+ }, { -+ MX25_PAD_UART4_TXD__UART4_TXD, -+ MX25_PAD_UART4_RXD__UART4_RXD, -+ MX25_PAD_UART4_CTS__UART4_CTS, -+ MX25_PAD_UART4_RTS__UART4_RTS, -+ }, { -+ MX25_PAD_UART5_TXD__UART5_TXD, -+ MX25_PAD_UART5_RXD__UART5_RXD, -+ MX25_PAD_UART5_CTS__UART5_CTS, -+ MX25_PAD_UART5_RTS__UART5_RTS, -+#endif -+ }, -+}; -+ -+static int stk5_uart_init(struct platform_device *pdev) -+{ -+ DBG(0, "%s: \n", __FUNCTION__); -+ return mxc_iomux_v3_setup_multiple_pads(stk5_uart_pads[pdev->id], -+ ARRAY_SIZE(stk5_uart_pads[pdev->id])); -+} -+ -+static void stk5_uart_exit(struct platform_device *pdev) -+{ -+ DBG(0, "%s: \n", __FUNCTION__); -+ mxc_iomux_v3_release_multiple_pads(stk5_uart_pads[pdev->id], -+ ARRAY_SIZE(stk5_uart_pads[pdev->id])); -+} -+ -+static struct imxuart_platform_data stk5_uart_ports[] = { -+ { -+ .init = stk5_uart_init, -+ .exit = stk5_uart_exit, -+ .flags = IMXUART_HAVE_RTSCTS, -+ }, { -+ .init = stk5_uart_init, -+ .exit = stk5_uart_exit, -+ .flags = IMXUART_HAVE_RTSCTS, -+ }, { -+ .init = stk5_uart_init, -+ .exit = stk5_uart_exit, -+ .flags = IMXUART_HAVE_RTSCTS, -+ }, { -+ .init = stk5_uart_init, -+ .exit = stk5_uart_exit, -+ .flags = IMXUART_HAVE_RTSCTS, -+ }, { -+ .init = stk5_uart_init, -+ .exit = stk5_uart_exit, -+ .flags = IMXUART_HAVE_RTSCTS, -+ }, { -+ .init = stk5_uart_init, -+ .exit = stk5_uart_exit, -+ .flags = IMXUART_HAVE_RTSCTS, -+ }, -+}; -+ -+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 void __init karo_stk5_serial_init(void) -+{ -+} -+#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) -+{ -+ if ((unsigned long)view & 0x400) { -+ return "USBH2"; -+ } else { -+ return "USBOTG"; -+ } -+} -+ -+static int usb3317_init(void __iomem *view) -+{ -+ int vid, pid, ret; -+ -+ 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) { -+ 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; -+ } -+ return 0; -+} -+ -+static int usb3317_set_vbus_power(void __iomem *view, int on) -+{ -+ 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); -+ } -+ } -+ 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 stk5_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 stk5_usbh2_exit(struct platform_device *pdev) -+{ -+ gpio_usbh2_inactive(); -+ return 0; -+} -+ -+static struct mxc_usbh_platform_data stk5_usbh2_data = { -+ .init = stk5_usbh2_init, -+ .exit = stk5_usbh2_exit, -+}; -+ -+static int __init karo_stk5_usbh2_register(void) -+{ -+ int ret; -+ -+ ret = mxc_register_device(&mxc_ehci2, &stk5_usbh2_data); -+ return ret; -+} -+#else -+static inline int karo_stk5_usbh2_register(void) -+{ -+ return 0; -+} -+#endif // CONFIG_USB_EHCI_MXC -+ -+#if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE) -+static struct gpio_led stk5_leds[] = { -+ { -+ .name = "GPIO-LED", -+ .default_trigger = "heartbeat", -+ .gpio = GPIO_PORTB | 7, -+ }, -+}; -+ -+static struct gpio_led_platform_data stk5_led_data = { -+ .leds = stk5_leds, -+ .num_leds = ARRAY_SIZE(stk5_leds), -+}; -+ -+static struct platform_device stk5_led_device = { -+ .name = "leds-gpio", -+ .id = -1, -+ .dev = { -+ .platform_data = &stk5_led_data, -+ }, -+}; -+#endif -+ -+#if defined(CONFIG_KEYBOARD_MXC) || defined(CONFIG_KEYBOARD_MXC_MODULE) -+/*! -+ * This array is used for mapping mx25 ADS keypad scancodes to input keyboard -+ * keycodes. -+ */ -+static u16 stk5_kpd_keycodes[] = { -+ KEY_POWER, -+}; -+ -+static struct keypad_data stk5_keypad = { -+ .rowmax = 1, -+ .colmax = 1, -+ .irq = MXC_INT_KPP, -+ .learning = 0, -+ //.delay = 2, /* unused in the driver! */ -+ .matrix = stk5_kpd_keycodes, -+}; -+ -+static struct resource stk5_kpp_resources[] = { -+ { -+ .start = MXC_INT_KPP, -+ .end = MXC_INT_KPP, -+ .flags = IORESOURCE_IRQ, -+ }, -+}; -+ -+/* stk5 keypad driver */ -+static struct platform_device stk5_keypad_device = { -+ .name = "mxc_keypad", -+ .id = 0, -+ .num_resources = ARRAY_SIZE(stk5_kpp_resources), -+ .resource = stk5_kpp_resources, -+ .dev = { -+ .platform_data = &stk5_keypad, -+ }, -+}; -+#endif -+ -+#if defined(CONFIG_FB_IMX) || defined(CONFIG_FB_IMX_MODULE) -+/* -+ * Setup GPIO for LCDC device to be active -+ * -+ */ -+static struct pad_desc mx25_lcdc_gpios[] = { -+#if 0 -+ MXC_PIN(A, 30, GPIO, GPIO_OUT | GPIO_DFLT_LOW), /* PA30 */ -+ MXC_PIN(A, 25, GPIO, GPIO_OUT | GPIO_DFLT_LOW), /* PA25 */ -+ MXC_PIN(A, 26, GPIO, GPIO_OUT | GPIO_DFLT_LOW), /* PA26 */ -+ MXC_PIN(A, 24, GPIO, GPIO_OUT | GPIO_DFLT_LOW), /* PA24 */ -+ MXC_PIN(A, 27, GPIO, GPIO_OUT | GPIO_DFLT_LOW), /* PA27 */ -+#endif -+ MX25_PAD_LSCLK__LSCLK, -+ MX25_PAD_LD0__LD0, -+ MX25_PAD_LD1__LD1, -+ MX25_PAD_LD2__LD2, -+ MX25_PAD_LD3__LD3, -+ MX25_PAD_LD4__LD4, -+ MX25_PAD_LD5__LD5, -+ MX25_PAD_LD6__LD6, -+ MX25_PAD_LD7__LD7, -+ MX25_PAD_LD8__LD8, -+ MX25_PAD_LD9__LD9, -+ MX25_PAD_LD10__LD10, -+ MX25_PAD_LD11__LD11, -+ MX25_PAD_LD12__LD12, -+ MX25_PAD_LD13__LD13, -+ MX25_PAD_LD14__LD14, -+ MX25_PAD_LD15__LD15, -+ MX25_PAD_D15__LD16, -+ MX25_PAD_D14__LD17, -+ MX25_PAD_HSYNC__HSYNC, -+ MX25_PAD_VSYNC__VSYNC, -+ MX25_PAD_OE_ACD__OE_ACD, -+}; -+ -+static int stk5_gpio_lcdc_active(struct platform_device *dev) -+{ -+ int ret; -+ -+ DBG(0, "%s: Setting up GPIO pins for LCD\n", __FUNCTION__); -+ ret = mxc_iomux_v3_setup_multiple_pads(mx25_lcdc_gpios, -+ ARRAY_SIZE(mx25_lcdc_gpios)); -+ if (ret) { -+ DBG(0, "%s: Failed to setup GPIO pins for LCD: %d\n", -+ __FUNCTION__, ret); -+ return ret; -+ } -+ return 0; -+} -+ -+/* -+ * Setup GPIO for LCDC device to be inactive -+ * -+ */ -+static void stk5_gpio_lcdc_inactive(struct platform_device *dev) -+{ -+ mxc_iomux_v3_release_multiple_pads(mx25_lcdc_gpios, -+ ARRAY_SIZE(mx25_lcdc_gpios)); -+} -+ -+static struct imx_fb_platform_data stk5_fb_data[] __initdata = { -+ { -+ //.fb_mode = "Xenarc_700_Y-18", -+ .init = stk5_gpio_lcdc_active, -+ .exit = stk5_gpio_lcdc_inactive, -+ .lcd_power = NULL, -+ .backlight_power = NULL, -+ -+ .pixclock = 34576, -+ .xres = 640, -+ .yres = 480, -+ -+ .bpp = 32, -+ -+ .hsync_len = 64, -+ .right_margin = 60 + 1, -+ .left_margin = 80 + 3, -+ -+ .vsync_len = 2, -+ .upper_margin = 54, -+ .lower_margin = 54, -+#if 0 -+ /* currently not used by driver! */ -+ .sync = ((0*FB_SYNC_HOR_HIGH_ACT) | -+ (0*FB_SYNC_VERT_HIGH_ACT) | -+ (1*FB_SYNC_OE_ACT_HIGH)), -+#else -+ .pcr = PCR_TFT | PCR_COLOR | PCR_PBSIZ_8 | -+ PCR_BPIX_18 | PCR_END_SEL | PCR_FLMPOL | PCR_LPPOL | PCR_SCLK_SEL, -+ .dmacr = 0x800a0078, -+#endif -+ .cmap_greyscale = 0, -+ .cmap_inverse = 0, -+ .cmap_static = 0, -+ -+ .fixed_screen_cpu = NULL, -+ }, { -+ //.fb_mode = "Xenarc_700_Y-16", -+ .init = stk5_gpio_lcdc_active, -+ .exit = stk5_gpio_lcdc_inactive, -+ .lcd_power = NULL, -+ .backlight_power = NULL, -+ -+ .pixclock = 34576, -+ .xres = 640, -+ .yres = 480, -+ -+ .bpp = 16, -+ -+ .hsync_len = 64, -+ .right_margin = 138 + 1, -+ .left_margin = 118 + 3, -+ -+ .vsync_len = 7, -+ .upper_margin = 44, -+ .lower_margin = 44, -+#if 0 -+ /* currently not used by driver! */ -+ .sync = ((0*FB_SYNC_HOR_HIGH_ACT) | -+ (0*FB_SYNC_VERT_HIGH_ACT) | -+ (1*FB_SYNC_OE_ACT_HIGH)), -+#else -+ .pcr = PCR_TFT | PCR_COLOR | PCR_PBSIZ_8 | -+ PCR_BPIX_16 | PCR_FLMPOL | PCR_LPPOL | PCR_SCLK_SEL, -+ .dmacr = 0x80040060, -+#endif -+ .cmap_greyscale = 0, -+ .cmap_inverse = 0, -+ .cmap_static = 0, -+ -+ .fixed_screen_cpu = NULL, -+ }, { -+ //.fb_mode = "SHARP LQ10D42-16", -+ .init = stk5_gpio_lcdc_active, -+ .exit = stk5_gpio_lcdc_inactive, -+ .lcd_power = NULL, -+ .backlight_power = NULL, -+ -+ .pixclock = 34576, -+ .xres = 640, -+ .yres = 480, -+ -+#ifdef USE_18BPP -+ .bpp = 32, -+#else -+ .bpp = 16, -+#endif -+ .hsync_len = 64, -+ .right_margin = 138 + 1, -+ .left_margin = 118 + 3, -+ -+ .vsync_len = 7, -+ .upper_margin = 28, -+ .lower_margin = 60, -+#if 0 -+ /* currently not used by driver! */ -+ .sync = ((0*FB_SYNC_HOR_HIGH_ACT) | -+ (0*FB_SYNC_VERT_HIGH_ACT) | -+ (1*FB_SYNC_OE_ACT_HIGH)), -+#else -+ .pcr = PCR_TFT | PCR_COLOR | PCR_PBSIZ_8 | -+#ifdef USE_18BPP -+ PCR_BPIX_18 | PCR_END_SEL | PCR_FLMPOL | PCR_LPPOL | PCR_SCLK_SEL, -+#else -+ PCR_BPIX_16 | PCR_FLMPOL | PCR_LPPOL | PCR_SCLK_SEL, -+#endif -+ .dmacr = 0x80040060, -+#endif -+ .cmap_greyscale = 0, -+ .cmap_inverse = 0, -+ .cmap_static = 0, -+ -+ .fixed_screen_cpu = NULL, -+ }, { -+ //.fb_mode = "SHARP LQ104V1DG61-16", -+ .init = stk5_gpio_lcdc_active, -+ .exit = stk5_gpio_lcdc_inactive, -+ .lcd_power = NULL, -+ .backlight_power = NULL, -+ -+ .pixclock = 40000, -+ .xres = 640, -+ .yres = 480, -+ -+#ifdef USE_18BPP -+ .bpp = 32, -+#else -+ .bpp = 16, -+#endif -+ .hsync_len = 32, -+ .right_margin = 32 + 1, -+ .left_margin = 0 + 3, -+ -+ .vsync_len = 35, -+ .upper_margin = 0, -+ .lower_margin = 0, -+#if 0 -+ /* currently not used by driver! */ -+ .sync = ((0*FB_SYNC_HOR_HIGH_ACT) | -+ (0*FB_SYNC_VERT_HIGH_ACT) | -+ (1*FB_SYNC_OE_ACT_HIGH)), -+#else -+ .pcr = PCR_TFT | PCR_COLOR | PCR_PBSIZ_8 | -+#ifdef USE_18BPP -+ PCR_BPIX_18 | PCR_END_SEL | PCR_FLMPOL | PCR_LPPOL | PCR_SCLK_SEL, -+#else -+ PCR_BPIX_16 | PCR_FLMPOL | PCR_LPPOL | PCR_CLKPOL | PCR_SCLK_SEL, -+#endif -+ .dmacr = 0x80040060, -+#endif -+ .cmap_greyscale = 0, -+ .cmap_inverse = 0, -+ .cmap_static = 0, -+ -+ .fixed_screen_cpu = NULL, -+ }, -+}; -+ -+static int __init karo_stk5_fb_register(void) -+{ -+ int ret; -+ -+ ret = mxc_register_device(&mxc_fb_device, &stk5_fb_data[0]); -+ if (ret != 0) { -+ DBG(0, "%s: Failed to register FB device: %d\n", __FUNCTION__, ret); -+ } -+ return ret; -+} -+#else -+static inline int karo_stk5_fb_register(void) -+{ -+ return 0; -+} -+#endif -+ -+#if defined(CONFIG_MMC_MXC) || defined(CONFIG_MMC_MXC_MODULE) -+/*! -+ * Resource definition for the SDHC1 -+ */ -+static struct resource stk5_sdhc1_resources[] = { -+ { -+ .start = MMC_SDHC1_BASE_ADDR, -+ .end = MMC_SDHC1_BASE_ADDR + SZ_4K - 1, -+ .flags = IORESOURCE_MEM, -+ }, { -+ .start = MXC_INT_SDHC1, -+ .end = MXC_INT_SDHC1, -+ .flags = IORESOURCE_IRQ, -+ }, { -+ .start = gpio_to_irq(4 * 32 + 4), -+ .end = gpio_to_irq(4 * 32 + 4), -+ .flags = IORESOURCE_IRQ, -+#if 0 -+ }, { -+ .name = "sdhc1", -+ .start = DMA_REQ_SDHC1, -+ .end = DMA_REQ_SDHC1, -+ .flags = IORESOURCE_DMA -+#endif -+ }, -+}; -+ -+static inline int stk5_mmc_get_irq(int id) -+{ -+ int irq; -+ -+ switch (id) { -+ case 0: -+ irq = stk5_sdhc1_resources[2].start; -+ break; -+ default: -+ BUG(); -+ } -+ return irq; -+} -+ -+static const char *stk5_mmc_irqdesc[] = { -+ "MMC card 0 detect", -+}; -+ -+static struct pad_desc stk5_sdhc_pads[] = { -+}; -+ -+static int stk5_mmc_init(struct device *dev, irqreturn_t (*mmc_detect_irq)(int, void *), -+ void *data) -+{ -+ int err; -+ int id = to_platform_device(dev)->id; -+ struct mmc_host *host = data; -+ int irq = stk5_mmc_get_irq(id); -+ -+ err = mxc_iomux_v3_setup_multiple_pads(stk5_sdhc_pads, -+ ARRAY_SIZE(stk5_sdhc_pads)); -+ if (err) { -+ return err; -+ } -+ -+ host->caps |= MMC_CAP_4_BIT_DATA; -+ -+ err = request_irq(irq, mmc_detect_irq, -+ IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING, -+ stk5_mmc_irqdesc[id], data); -+ if (err) { -+ printk(KERN_ERR "%s: MMC/SD: can't request MMC card detect IRQ %d\n", -+ __FUNCTION__, irq); -+ return err; -+ } -+ device_set_wakeup_capable(dev, 1); -+ -+ return 0; -+} -+ -+static void stk5_mmc_exit(struct device *dev, void *data) -+{ -+ int id = to_platform_device(dev)->id; -+ int irq = stk5_mmc_get_irq(id); -+ -+ free_irq(irq, data); -+ mxc_iomux_v3_release_multiple_pads(stk5_sdhc_pads, -+ ARRAY_SIZE(stk5_sdhc_pads)); -+} -+ -+#if 0 -+static int stk5_mmc_suspend(struct device *dev, pm_message_t state) -+{ -+ int id = to_platform_device(dev)->id; -+ int irq = stk5_mmc_get_irq(id); -+ -+ if (device_may_wakeup(dev)) { -+ DBG(0, "%s: Enabling IRQ %d wakeup\n", __FUNCTION__, irq); -+ return enable_irq_wake(irq); -+ } -+ return 0; -+} -+ -+static int stk5_mmc_resume(struct device *dev) -+{ -+ int id = to_platform_device(dev)->id; -+ int irq = stk5_mmc_get_irq(id); -+ -+ if (device_may_wakeup(dev)) { -+ DBG(0, "%s: Disabling IRQ %d wakeup\n", __FUNCTION__, irq); -+ return disable_irq_wake(irq); -+ } -+ return 0; -+} -+#endif -+ -+static struct imxmmc_platform_data stk5_sdhc1_data = { -+ //.ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, -+ //.min_clk = 150000, -+ //.max_clk = 25000000, -+ //.detect_delay = 20, -+ .init = stk5_mmc_init, -+ .exit = stk5_mmc_exit, -+// .suspend = stk5_mmc_suspend, -+// .resume = stk5_mmc_resume, -+}; -+ -+static struct platform_device stk5_sdhc1_device = { -+ .name = "imx-mmc", -+ .id = 0, -+ .dev = { -+ .platform_data = &stk5_sdhc1_data, -+ }, -+ .num_resources = ARRAY_SIZE(stk5_sdhc1_resources), -+ .resource = stk5_sdhc1_resources, -+}; -+#endif -+ -+#if defined(CONFIG_SPI_MXC) || defined(CONFIG_SPI_MXC_MODULE) -+static struct resource mxcspi1_resources[] = { -+ { -+ .start = CSPI1_BASE_ADDR, -+ .end = CSPI1_BASE_ADDR + SZ_4K - 1, -+ .flags = IORESOURCE_MEM, -+ }, { -+ .start = MXC_INT_CSPI1, -+ .end = MXC_INT_CSPI1, -+ .flags = IORESOURCE_IRQ, -+ }, -+}; -+ -+static struct mxc_spi_master mxcspi1_data = { -+ .maxchipselect = 2, -+ .spi_version = 0, -+}; -+ -+static struct platform_device mxcspi1_device = { -+ .name = "mxc_spi", -+ .id = 0, -+ .dev = { -+ .platform_data = &mxcspi1_data, -+ }, -+ .num_resources = ARRAY_SIZE(mxcspi1_resources), -+ .resource = mxcspi1_resources, -+}; -+#endif // defined(CONFIG_SPI_MXC) || defined(CONFIG_SPI_MXC_MODULE) -+ -+#if defined(CONFIG_AC97_BUS) || defined(CONFIG_AC97_BUS_MODULE) -+static u64 stk5_dma_mask = ~0UL; -+ -+static struct pad_desc stk5_ac97_pads_on[] = { -+ MX25_PAD_VSTBY_ACK__GPIO_3_18, /* UCB1400 Reset */ -+ MX25_PAD_RW__AUD4_TXFS, -+ MX25_PAD_EB0__AUD4_TXD, -+ MX25_PAD_EB1__AUD4_RXD, -+ MX25_PAD_OE__AUD4_TXC, -+}; -+ -+static struct pad_desc stk5_ac97_pads_off[] = { -+ MX25_PAD_VSTBY_ACK__GPIO_3_18, /* UCB1400 Reset */ -+ MX25_PAD_RW__GPIO_3_25, -+ MX25_PAD_EB0__GPIO_2_12, -+ MX25_PAD_EB1__AUD4_RXD, -+ MX25_PAD_OE__AUD4_TXC, -+}; -+ -+static struct gpio_desc { -+ unsigned int gpio:7; -+ unsigned int dir:1; -+ unsigned int level:1; -+} stk5_ac97_gpios[] = { -+ /* configure the PHY strap pins to the correct values */ -+ { GPIO_PORTC | 18, 1, 0, }, -+ { GPIO_PORTC | 25, 1, 0, }, -+ { GPIO_PORTB | 12, 1, 0, }, -+}; -+ -+static int stk5_ac97_init(struct platform_device *dev) -+{ -+ int ret; -+ int i; -+ -+ DBG(0, "%s: \n", __FUNCTION__); -+ -+ ret = mxc_iomux_v3_setup_multiple_pads(stk5_ac97_pads_off, -+ ARRAY_SIZE(stk5_ac97_pads_off)); -+ if (ret == 0) { -+ for (i = 0; i < ARRAY_SIZE(stk5_ac97_gpios); i++) { -+ struct gpio_desc *pd = &stk5_ac97_gpios[i]; -+ -+ ret = gpio_request(pd->gpio, "AC97"); -+ if (ret < 0) { -+ DBG(0, "%s: Failed to request GPIO%d_%d: %d\n", -+ __FUNCTION__, pd->gpio / 32 + 1, pd->gpio % 32, ret); -+ goto rel_mux; -+ } -+ if (pd->dir) { -+ gpio_direction_output(pd->gpio, -+ pd->level); -+ } else { -+ gpio_direction_input(pd->gpio); -+ } -+ } -+ -+ ret = mxc_iomux_v3_setup_multiple_pads(stk5_ac97_pads_on, -+ ARRAY_SIZE(stk5_ac97_pads_on)); -+ if (ret != 0) { -+ goto rel_gpio; -+ } -+ udelay(1); -+ gpio_set_value(stk5_ac97_gpios[0].gpio, !stk5_ac97_gpios[0].level); -+ } -+ return ret; -+ -+ rel_mux: -+ mxc_iomux_v3_release_multiple_pads(stk5_ac97_gpios_off, -+ ARRAY_SIZE(stk5_ac97_gpios_off)); -+ rel_gpio: -+ while (--i >= 0) { -+ struct gpio_desc *pd = &stk5_ac97_gpios[i]; -+ int grp = pd->gpio / 32 + 1; -+ int ofs = pd->gpio % 32; -+ -+ DBG(0, "%s: Freeing GPIO%d_%d\n", __FUNCTION__, -+ grp, ofs); -+ gpio_free(pd->gpio); -+ } -+ return ret; -+} -+ -+static void stk5_ac97_exit(struct platform_device *dev) -+{ -+ int i; -+ -+ DBG(0, "%s: Releasing AC97 GPIO pins\n", __FUNCTION__); -+ -+ mxc_iomux_v3_release_multiple_pads(stk5_ac97_pads_on, -+ ARRAY_SIZE(stk5_ac97_pads_on)); -+ for (i = 0; i < ARRAY_SIZE(stk5_ac97_gpios); i++) { -+ struct gpio_desc *pd = &stk5_ac97_gpios[i]; -+ int grp = pd->gpio / 32 + 1; -+ int ofs = pd->gpio % 32; -+ -+ DBG(0, "%s: Freeing GPIO%d_%d\n", __FUNCTION__, -+ grp, ofs); -+ gpio_free(pd->gpio); -+ } -+} -+ -+static struct mxc_ac97_audio_ops stk5_ac97_ops = { -+ .init = stk5_ac97_init, -+ .exit = stk5_ac97_exit, -+ .startup = NULL, -+ .shutdown = NULL, -+ .suspend = NULL, -+ .resume = NULL, -+ .priv = NULL, -+}; -+ -+static struct platform_device ac97_device = { -+ .name = "mx25-ac97", -+ .id = -1, -+ .dev = { -+ .dma_mask = &stk5_dma_mask, -+ .coherent_dma_mask = ~0UL, -+ .platform_data = &stk5_ac97_ops, -+ }, -+}; -+#endif -+ -+static struct platform_dev_list { -+ struct platform_device *pdev; -+ int flag; -+} stk5_devices[] __initdata = { -+#if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE) -+ { .pdev = &stk5_led_device, .flag = -1, }, -+#endif -+#if defined(CONFIG_KEYBOARD_MXC) || defined(CONFIG_KEYBOARD_MXC_MODULE) -+ { .pdev = &stk5_keypad_device, .flag = 1, }, -+#endif -+#if defined(CONFIG_SPI_MXC) || defined(CONFIG_SPI_MXC_MODULE) -+ { .pdev = &mxcspi1_device, .flag = 1, }, -+#endif -+#if defined(CONFIG_AC97_BUS) || defined(CONFIG_AC97_BUS_MODULE) -+ { .pdev = &ac97_device, .flag = 1, }, -+#endif -+#if defined(CONFIG_MMC_MXC) || defined(CONFIG_MMC_MXC_MODULE) -+ { .pdev = &stk5_sdhc1_device, .flag = 1, }, -+#endif -+}; -+#define STK5_NUM_DEVICES ARRAY_SIZE(stk5_devices) -+ -+static __init int karo_stk5_board_init(void) -+{ -+ int ret; -+ int i; -+ -+ if (karo_get_board_type() != BOARD_KARO_STK5) { -+ return -ENODEV; -+ } -+ DBG(0, "%s: \n", __FUNCTION__); -+ -+ karo_stk5_serial_init(); -+ -+ dump_regs(); -+ -+ /* enable SSI1_INT (GPIO_3_15) for IRQ probing */ -+ set_irq_flags(gpio_to_irq(GPIO_PORTC | 15), IRQF_VALID | IRQF_PROBE); -+ -+ ret = karo_stk5_fb_register(); -+ if (ret) { -+ 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; -+ if (!stk5_devices[i].flag) { -+ DBG(0, "%s: Skipping platform device[%d] @ %p dev %p: %s\n", -+ __FUNCTION__, i, stk5_devices[i].pdev, &stk5_devices[i].pdev->dev, -+ stk5_devices[i].pdev->name); -+ continue; -+ } -+ DBG(0, "%s: Registering platform device[%d] @ %p dev %p: %s\n", -+ __FUNCTION__, i, stk5_devices[i].pdev, &stk5_devices[i].pdev->dev, -+ stk5_devices[i].pdev->name); -+ ret = platform_device_register(stk5_devices[i].pdev); -+ if (ret) { -+ printk(KERN_WARNING "%s: Failed to register platform_device[%d]: %s: %d\n", -+ __FUNCTION__, i, stk5_devices[i].pdev->name, ret); -+ } -+ } -+ DBG(0, "%s: Done\n", __FUNCTION__); -+ 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 -@@ -381,7 +381,7 @@ DEFINE_CLOCK(gpu2d_clk, 0, CCM_CGR3, 4 - .clk = &c, \ - }, - --static struct clk_lookup lookups[] __initdata = { -+static struct clk_lookup lookups[] = { - _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 -@@ -516,7 +516,7 @@ DEFINE_CLOCK(ipg_clk, 0, NULL, - .clk = &c, \ - }, - --static struct clk_lookup lookups[] __initdata = { -+static struct clk_lookup lookups[] = { - _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 -@@ -56,6 +56,9 @@ config ARCH_HAS_RNGA - bool - depends on ARCH_MXC - -+config ARCH_MXC_IOMUX_V2 -+ bool -+ - 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 -@@ -5,7 +5,7 @@ - # Common support - obj-y := irq.o clock.o gpio.o time.o devices.o cpu.o system.o - --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 -+obj-$(CONFIG_ARCH_MXC_IOMUX_V2) += iomux-mx1-mx2.o dma-mx1-mx2.o -+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 -@@ -0,0 +1,17 @@ -+/* -+ * Copyright 2009 -+ * -+ * 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 -+ */ -+ -+#define UART1_ENABLED 1 -+#define UART2_ENABLED 1 -+#define UART3_ENABLED 1 -+/* 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 -@@ -0,0 +1,13 @@ -+/* -+ * Copyright 2009 -+ * -+ * 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 -+ */ -+ -+#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 -@@ -17,6 +17,7 @@ struct clk; - extern void mx1_map_io(void); - extern void mx21_map_io(void); - extern void mx27_map_io(void); -+extern void mx25_map_io(void); - extern void mx31_map_io(void); - extern void mx35_map_io(void); - extern void mxc_init_irq(void); -@@ -24,6 +25,7 @@ extern void mxc_timer_init(struct clk *t - extern int mx1_clocks_init(unsigned long fref); - extern int mx21_clocks_init(unsigned long lref, unsigned long fref); - extern int mx27_clocks_init(unsigned long fref); -+extern int mx25_clocks_init(unsigned long fref); - 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 -@@ -0,0 +1,259 @@ -+/* -+ * Copyright 2004-2008 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_DMA_H__ -+#define __ASM_ARCH_MXC_DMA_H__ -+ -+#include -+ -+#define MXC_DMA_DYNAMIC_CHANNEL 255 -+ -+#define MXC_DMA_DONE 0x0 -+#define MXC_DMA_REQUEST_TIMEOUT 0x1 -+#define MXC_DMA_TRANSFER_ERROR 0x2 -+ -+/*! This defines the list of device ID's for DMA */ -+typedef enum mxc_dma_device { -+ MXC_DMA_UART1_RX, -+ MXC_DMA_UART1_TX, -+ MXC_DMA_UART2_RX, -+ MXC_DMA_UART2_TX, -+ MXC_DMA_UART3_RX, -+ MXC_DMA_UART3_TX, -+ MXC_DMA_UART4_RX, -+ MXC_DMA_UART4_TX, -+ MXC_DMA_UART5_RX, -+ MXC_DMA_UART5_TX, -+ MXC_DMA_UART6_RX, -+ MXC_DMA_UART6_TX, -+ MXC_DMA_MMC1_WIDTH_1, -+ MXC_DMA_MMC1_WIDTH_4, -+ MXC_DMA_MMC2_WIDTH_1, -+ MXC_DMA_MMC2_WIDTH_4, -+ MXC_DMA_SSI1_8BIT_RX0, -+ MXC_DMA_SSI1_8BIT_TX0, -+ MXC_DMA_SSI1_16BIT_RX0, -+ MXC_DMA_SSI1_16BIT_TX0, -+ MXC_DMA_SSI1_24BIT_RX0, -+ MXC_DMA_SSI1_24BIT_TX0, -+ MXC_DMA_SSI1_8BIT_RX1, -+ MXC_DMA_SSI1_8BIT_TX1, -+ MXC_DMA_SSI1_16BIT_RX1, -+ MXC_DMA_SSI1_16BIT_TX1, -+ MXC_DMA_SSI1_24BIT_RX1, -+ MXC_DMA_SSI1_24BIT_TX1, -+ MXC_DMA_SSI2_8BIT_RX0, -+ MXC_DMA_SSI2_8BIT_TX0, -+ MXC_DMA_SSI2_16BIT_RX0, -+ MXC_DMA_SSI2_16BIT_TX0, -+ MXC_DMA_SSI2_24BIT_RX0, -+ MXC_DMA_SSI2_24BIT_TX0, -+ MXC_DMA_SSI2_8BIT_RX1, -+ MXC_DMA_SSI2_8BIT_TX1, -+ MXC_DMA_SSI2_16BIT_RX1, -+ MXC_DMA_SSI2_16BIT_TX1, -+ MXC_DMA_SSI2_24BIT_RX1, -+ MXC_DMA_SSI2_24BIT_TX1, -+ MXC_DMA_FIR_RX, -+ MXC_DMA_FIR_TX, -+ MXC_DMA_CSPI1_RX, -+ MXC_DMA_CSPI1_TX, -+ MXC_DMA_CSPI2_RX, -+ MXC_DMA_CSPI2_TX, -+ MXC_DMA_CSPI3_RX, -+ MXC_DMA_CSPI3_TX, -+ MXC_DMA_ATA_RX, -+ MXC_DMA_ATA_TX, -+ MXC_DMA_MEMORY, -+ MXC_DMA_FIFO_MEMORY, -+ MXC_DMA_DSP_PACKET_DATA0_RD, -+ MXC_DMA_DSP_PACKET_DATA0_WR, -+ MXC_DMA_DSP_PACKET_DATA1_RD, -+ MXC_DMA_DSP_PACKET_DATA1_WR, -+ MXC_DMA_DSP_LOG0_CHNL, -+ MXC_DMA_DSP_LOG1_CHNL, -+ MXC_DMA_DSP_LOG2_CHNL, -+ MXC_DMA_DSP_LOG3_CHNL, -+ MXC_DMA_CSI_RX, -+ MXC_DMA_SPDIF_16BIT_TX, -+ MXC_DMA_SPDIF_16BIT_RX, -+ MXC_DMA_SPDIF_32BIT_TX, -+ MXC_DMA_SPDIF_32BIT_RX, -+ MXC_DMA_ASRC_A_RX, -+ MXC_DMA_ASRC_A_TX, -+ MXC_DMA_ASRC_B_RX, -+ MXC_DMA_ASRC_B_TX, -+ MXC_DMA_ASRC_C_RX, -+ MXC_DMA_ASRC_C_TX, -+ MXC_DMA_ESAI_16BIT_RX, -+ MXC_DMA_ESAI_16BIT_TX, -+ MXC_DMA_ESAI_24BIT_RX, -+ MXC_DMA_ESAI_24BIT_TX, -+ MXC_DMA_TEST_RAM2D2RAM, -+ MXC_DMA_TEST_RAM2RAM2D, -+ MXC_DMA_TEST_RAM2D2RAM2D, -+ MXC_DMA_TEST_RAM2RAM, -+ MXC_DMA_TEST_HW_CHAINING, -+ MXC_DMA_TEST_SW_CHAINING -+} mxc_dma_device_t; -+ -+/*! This defines the prototype of callback funtion registered by the drivers */ -+typedef void (*mxc_dma_callback_t) (void *arg, int error_status, -+ unsigned int count); -+ -+/*! This defines the type of DMA transfer requested */ -+typedef enum mxc_dma_mode { -+ MXC_DMA_MODE_READ, -+ MXC_DMA_MODE_WRITE, -+} mxc_dma_mode_t; -+ -+/*! This defines the DMA channel parameters */ -+typedef struct mxc_dma_channel { -+ unsigned int active:1; /*!< When there has a active tranfer, it is set to 1 */ -+ unsigned int lock; /*!< Defines the channel is allocated or not */ -+ int curr_buf; /*!< Current buffer */ -+ mxc_dma_mode_t mode; /*!< Read or Write */ -+ unsigned int channel; /*!< Channel info */ -+ unsigned int dynamic:1; /*!< Channel not statically allocated when 1 */ -+ char *dev_name; /*!< Device name */ -+ void *private; /*!< Private structure for platform */ -+ mxc_dma_callback_t cb_fn; /*!< The callback function */ -+ void *cb_args; /*!< The argument of callback function */ -+} mxc_dma_channel_t; -+ -+/*! This structure contains the information about a dma transfer */ -+typedef struct mxc_dma_requestbuf { -+ dma_addr_t src_addr; /*!< source address */ -+ dma_addr_t dst_addr; /*!< destination address */ -+ int num_of_bytes; /*!< the length of this transfer : bytes */ -+} mxc_dma_requestbuf_t; -+ -+/*! -+ * This function is generally called by the driver at open time. -+ * The DMA driver would do any initialization steps that is required -+ * to get the channel ready for data transfer. -+ * -+ * @param channel_id a pre-defined id. The peripheral driver would specify -+ * the id associated with its peripheral. This would be -+ * used by the DMA driver to identify the peripheral -+ * requesting DMA and do the necessary setup on the -+ * channel associated with the particular peripheral. -+ * The DMA driver could use static or dynamic DMA channel -+ * allocation. -+ * @param dev_name module name or device name -+ * @return returns a negative number on error if request for a DMA channel did not -+ * succeed, returns the channel number to be used on success. -+ */ -+extern int mxc_dma_request(mxc_dma_device_t channel_id, char *dev_name); -+ -+/*! -+ * This function is generally called by the driver at close time. The DMA -+ * driver would do any cleanup associated with this channel. -+ * -+ * @param channel_num the channel number returned at request time. This -+ * would be used by the DMA driver to identify the calling -+ * driver and do the necessary cleanup on the channel -+ * associated with the particular peripheral -+ * @return returns a negative number on error or 0 on success -+ */ -+extern int mxc_dma_free(int channel_num); -+ -+/*! -+ * This function would just configure the buffers specified by the user into -+ * dma channel. The caller must call mxc_dma_enable to start this transfer. -+ * -+ * @param channel_num the channel number returned at request time. This -+ * would be used by the DMA driver to identify the calling -+ * driver and do the necessary cleanup on the channel -+ * associated with the particular peripheral -+ * @param dma_buf an array of physical addresses to the user defined -+ * buffers. The caller must guarantee the dma_buf is -+ * available until the transfer is completed. -+ * @param num_buf number of buffers in the array -+ * @param mode specifies whether this is READ or WRITE operation -+ * @return This function returns a negative number on error if buffer could not be -+ * added with DMA for transfer. On Success, it returns 0 -+ */ -+extern int mxc_dma_config(int channel_num, mxc_dma_requestbuf_t * dma_buf, -+ int num_buf, mxc_dma_mode_t mode); -+ -+/*! -+ * This function would just configure the scatterlist specified by the -+ * user into dma channel. This is a slight variation of mxc_dma_config(), -+ * it is provided for the convenience of drivers that have a scatterlist -+ * passed into them. It is the calling driver's responsibility to have the -+ * correct physical address filled in the "dma_address" field of the -+ * scatterlist. -+ * -+ * @param channel_num the channel number returned at request time. This -+ * would be used by the DMA driver to identify the calling -+ * driver and do the necessary cleanup on the channel -+ * associated with the particular peripheral -+ * @param sg a scatterlist of buffers. The caller must guarantee -+ * the dma_buf is available until the transfer is -+ * completed. -+ * @param num_buf number of buffers in the array -+ * @param num_of_bytes total number of bytes to transfer. If set to 0, this -+ * would imply to use the length field of the scatterlist -+ * for each DMA transfer. Else it would calculate the size -+ * for each DMA transfer. -+ * @param mode specifies whether this is READ or WRITE operation -+ * @return This function returns a negative number on error if buffer could not -+ * be added with DMA for transfer. On Success, it returns 0 -+ */ -+extern int mxc_dma_sg_config(int channel_num, struct scatterlist *sg, -+ int num_buf, int num_of_bytes, -+ mxc_dma_mode_t mode); -+ -+/*! -+ * This function is provided if the driver would like to set/change its -+ * callback function. -+ * -+ * @param channel_num the channel number returned at request time. This -+ * would be used by the DMA driver to identify the calling -+ * driver and do the necessary cleanup on the channel -+ * associated with the particular peripheral -+ * @param callback a callback function to provide notification on transfer -+ * completion, user could specify NULL if he does not wish -+ * to be notified -+ * @param arg an argument that gets passed in to the callback -+ * function, used by the user to do any driver specific -+ * operations. -+ * @return this function returns a negative number on error if the callback -+ * could not be set for the channel or 0 on success -+ */ -+extern int mxc_dma_callback_set(int channel_num, mxc_dma_callback_t callback, -+ void *arg); -+ -+/*! -+ * This stops the DMA channel and any ongoing transfers. Subsequent use of -+ * mxc_dma_enable() will restart the channel and restart the transfer. -+ * -+ * @param channel_num the channel number returned at request time. This -+ * would be used by the DMA driver to identify the calling -+ * driver and do the necessary cleanup on the channel -+ * associated with the particular peripheral -+ * @return returns a negative number on error or 0 on success -+ */ -+extern int mxc_dma_disable(int channel_num); -+ -+/*! -+ * This starts DMA transfer. Or it restarts DMA on a stopped channel -+ * previously stopped with mxc_dma_disable(). -+ * -+ * @param channel_num the channel number returned at request time. This -+ * would be used by the DMA driver to identify the calling -+ * driver and do the necessary cleanup on the channel -+ * associated with the particular peripheral -+ * @return returns a negative number on error or 0 on success -+ */ -+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 -@@ -29,13 +29,18 @@ - #endif - - #ifdef CONFIG_ARCH_MX2 -+#ifndef CONFIG_MACH_MX25 - # include -+#endif - # ifdef CONFIG_MACH_MX21 - # include - # endif - # ifdef CONFIG_MACH_MX27 - # include - # endif -+# ifdef CONFIG_MACH_MX25 -+# include -+# endif - #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 -@@ -13,7 +13,8 @@ - #define PCR_BPIX_4 (2 << 25) - #define PCR_BPIX_8 (3 << 25) - #define PCR_BPIX_12 (4 << 25) --#define PCR_BPIX_16 (4 << 25) -+#define PCR_BPIX_16 (5 << 25) -+#define PCR_BPIX_18 (6 << 25) - #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 @@ -+/* -+ * arch/arm/plat-mxc/include/mach/iomux-mx25.h -+ * -+ * Copyright (C) 2009 by Lothar Wassmann -+ * -+ * based on arch/arm/mach-mx25/mx25_pins.h -+ * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved. -+ * and -+ * arch/arm/plat-mxc/include/mach/iomux-mx35.h -+ * Copyright (C, NO_PAD_CTRL) 2009 by Jan Weitzel Phytec Messtechnik GmbH -+ * -+ * 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 __IOMUX_MX25_H__ -+#define __IOMUX_MX25_H__ -+ -+#include -+ -+/* -+ * -+ * @brief MX25 I/O Pin List -+ * -+ * @ingroup GPIO_MX25 -+ */ -+ -+#ifndef __ASSEMBLY__ -+ -+/* -+ * 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 IOMUX_TO_GPIO(__pad_desc) ({ \ -+ int __gpio = -1; \ -+ struct pad_desc *__pd = __pad_desc; \ -+ \ -+ switch (__pd->mux_ctrl_ofs) { \ -+ case MX25_PAD_GPIO_A__GPIO_A: \ -+ __gpio = GPIO_A; \ -+ break; \ -+ case MX25_PAD_GPIO_B__GPIO_B: \ -+ __gpio = GPIO_B; \ -+ break; \ -+ case MX25_PAD_GPIO_C__GPIO_C: \ -+ __gpio = GPIO_C; \ -+ break; \ -+ case MX25_PAD_GPIO_D__GPIO_D: \ -+ __gpio = GPIO_D; \ -+ break; \ -+ case MX25_PAD_GPIO_E__GPIO_E: \ -+ __gpio = GPIO_E; \ -+ break; \ -+ case MX25_PAD_GPIO_F__GPIO_F: \ -+ __gpio = GPIO_F; \ -+ break; \ -+ case MX25_PAD_CSI_D7__GPIO_1_6: \ -+ __gpio = GPIO_1_6; \ -+ break; \ -+ case MX25_PAD_CSI_D8__GPIO_1_7: \ -+ __gpio = GPIO_1_7; \ -+ break; \ -+ case MX25_PAD_CSI_MCLK__GPIO_1_8: \ -+ __gpio = GPIO_1_8; \ -+ break; \ -+ case MX25_PAD_CSI_VSYNC__GPIO_1_9: \ -+ __gpio = GPIO_1_9; \ -+ break; \ -+ case MX25_PAD_CSI_HSYNC__GPIO_1_10: \ -+ __gpio = GPIO_1_10; \ -+ break; \ -+ case MX25_PAD_CSI_PIXCLK__GPIO_1_11: \ -+ __gpio = GPIO_1_11; \ -+ break; \ -+ case MX25_PAD_I2C1_CLK__GPIO_1_12: \ -+ __gpio = GPIO_1_12; \ -+ break; \ -+ case MX25_PAD_I2C1_DAT__GPIO_1_13: \ -+ __gpio = GPIO_1_13; \ -+ break; \ -+ case MX25_PAD_CSPI1_MOSI__GPIO_1_14: \ -+ __gpio = GPIO_1_14; \ -+ break; \ -+ case MX25_PAD_CSPI1_MISO__GPIO_1_15: \ -+ __gpio = GPIO_1_15; \ -+ break; \ -+ case MX25_PAD_CSPI1_SS0__GPIO_1_16: \ -+ __gpio = GPIO_1_16; \ -+ break; \ -+ case MX25_PAD_CSPI1_SS1__GPIO_1_17: \ -+ __gpio = GPIO_1_17; \ -+ break; \ -+ case MX25_PAD_CSPI1_SCLK__GPIO_1_18: \ -+ __gpio = GPIO_1_18; \ -+ break; \ -+ case MX25_PAD_LD5__GPIO_1_19: \ -+ __gpio = GPIO_1_19; \ -+ break; \ -+ case MX25_PAD_LD6__GPIO_1_20: \ -+ __gpio = GPIO_1_20; \ -+ break; \ -+ case MX25_PAD_LD7__GPIO_1_21: \ -+ __gpio = GPIO_1_21; \ -+ break; \ -+ case MX25_PAD_HSYNC__GPIO_1_22: \ -+ __gpio = GPIO_1_22; \ -+ break; \ -+ case MX25_PAD_VSYNC__GPIO_1_23: \ -+ __gpio = GPIO_1_23; \ -+ break; \ -+ case MX25_PAD_LSCLK__GPIO_1_24: \ -+ __gpio = GPIO_1_24; \ -+ break; \ -+ case MX25_PAD_OE_ACD__GPIO_1_25: \ -+ __gpio = GPIO_1_25; \ -+ break; \ -+ case MX25_PAD_PWM__GPIO_1_26: \ -+ __gpio = GPIO_1_26; \ -+ break; \ -+ case MX25_PAD_CSI_D2__GPIO_1_27: \ -+ __gpio = GPIO_1_27; \ -+ break; \ -+ case MX25_PAD_CSI_D3__GPIO_1_28: \ -+ __gpio = GPIO_1_28; \ -+ break; \ -+ case MX25_PAD_CSI_D4__GPIO_1_29: \ -+ __gpio = GPIO_1_29; \ -+ break; \ -+ case MX25_PAD_CSI_D5__GPIO_1_30: \ -+ __gpio = GPIO_1_30; \ -+ break; \ -+ case MX25_PAD_CSI_D6__GPIO_1_31: \ -+ __gpio = GPIO_1_31; \ -+ break; \ -+ \ -+ case MX25_PAD_A14__GPIO_2_0: \ -+ __gpio = GPIO_2_0; \ -+ break; \ -+ case MX25_PAD_A15__GPIO_2_1: \ -+ __gpio = GPIO_2_1; \ -+ break; \ -+ case MX25_PAD_A16__GPIO_2_2: \ -+ __gpio = GPIO_2_2; \ -+ break; \ -+ case MX25_PAD_A17__GPIO_2_3: \ -+ __gpio = GPIO_2_3; \ -+ break; \ -+ case MX25_PAD_A18__GPIO_2_4: \ -+ __gpio = GPIO_2_4; \ -+ break; \ -+ case MX25_PAD_A19__GPIO_2_5: \ -+ __gpio = GPIO_2_5; \ -+ break; \ -+ case MX25_PAD_A20__GPIO_2_6: \ -+ __gpio = GPIO_2_6; \ -+ break; \ -+ case MX25_PAD_A21__GPIO_2_7: \ -+ __gpio = GPIO_2_7; \ -+ break; \ -+ case MX25_PAD_A22__GPIO_2_8: \ -+ __gpio = GPIO_2_8; \ -+ break; \ -+ case MX25_PAD_A23__GPIO_2_9: \ -+ __gpio = GPIO_2_9; \ -+ break; \ -+ case MX25_PAD_A24__GPIO_2_10: \ -+ __gpio = GPIO_2_10; \ -+ break; \ -+ case MX25_PAD_A25__GPIO_2_11: \ -+ __gpio = GPIO_2_11; \ -+ break; \ -+ case MX25_PAD_EB0__GPIO_2_12: \ -+ __gpio = GPIO_2_12; \ -+ break; \ -+ case MX25_PAD_EB1__GPIO_2_13: \ -+ __gpio = GPIO_2_13; \ -+ break; \ -+ case MX25_PAD_OE__GPIO_2_14: \ -+ __gpio = GPIO_2_14; \ -+ break; \ -+ case MX25_PAD_LD0__GPIO_2_15: \ -+ __gpio = GPIO_2_15; \ -+ break; \ -+ case MX25_PAD_LD1__GPIO_2_16: \ -+ __gpio = GPIO_2_16; \ -+ break; \ -+ case MX25_PAD_LD2__GPIO_2_17: \ -+ __gpio = GPIO_2_17; \ -+ break; \ -+ case MX25_PAD_LD3__GPIO_2_18: \ -+ __gpio = GPIO_2_18; \ -+ break; \ -+ case MX25_PAD_LD4__GPIO_2_19: \ -+ __gpio = GPIO_2_19; \ -+ break; \ -+ case MX25_PAD_DE_B__GPIO_2_20: \ -+ __gpio = GPIO_2_20; \ -+ break; \ -+ case MX25_PAD_CLKO__GPIO_2_21: \ -+ __gpio = GPIO_2_21; \ -+ break; \ -+ case MX25_PAD_CSPI1_RDY__GPIO_2_22: \ -+ __gpio = GPIO_2_22; \ -+ break; \ -+ case MX25_PAD_SD1_CMD__GPIO_2_23: \ -+ __gpio = GPIO_2_23; \ -+ break; \ -+ case MX25_PAD_SD1_CLK__GPIO_2_24: \ -+ __gpio = GPIO_2_24; \ -+ break; \ -+ case MX25_PAD_SD1_DATA0__GPIO_2_25: \ -+ __gpio = GPIO_2_25; \ -+ break; \ -+ case MX25_PAD_SD1_DATA1__GPIO_2_26: \ -+ __gpio = GPIO_2_26; \ -+ break; \ -+ case MX25_PAD_SD1_DATA2__GPIO_2_27: \ -+ __gpio = GPIO_2_27; \ -+ break; \ -+ case MX25_PAD_SD1_DATA3__GPIO_2_28: \ -+ __gpio = GPIO_2_28; \ -+ break; \ -+ case MX25_PAD_KPP_ROW0__GPIO_2_29: \ -+ __gpio = GPIO_2_29; \ -+ break; \ -+ case MX25_PAD_KPP_ROW1__GPIO_2_30: \ -+ __gpio = GPIO_2_30; \ -+ break; \ -+ case MX25_PAD_KPP_ROW2__GPIO_2_31: \ -+ __gpio = GPIO_2_31; \ -+ break; \ -+ \ -+ case MX25_PAD_KPP_ROW3__GPIO_3_0: \ -+ __gpio = GPIO_3_0; \ -+ break; \ -+ case MX25_PAD_KPP_COL0__GPIO_3_1: \ -+ __gpio = GPIO_3_1; \ -+ break; \ -+ case MX25_PAD_KPP_COL1__GPIO_3_2: \ -+ __gpio = GPIO_3_2; \ -+ break; \ -+ case MX25_PAD_KPP_COL2__GPIO_3_3: \ -+ __gpio = GPIO_3_3; \ -+ break; \ -+ case MX25_PAD_KPP_COL3__GPIO_3_4: \ -+ __gpio = GPIO_3_4; \ -+ break; \ -+ case MX25_PAD_FEC_MDC__GPIO_3_5: \ -+ __gpio = GPIO_3_5; \ -+ break; \ -+ case MX25_PAD_FEC_MDIO__GPIO_3_6: \ -+ __gpio = GPIO_3_6; \ -+ break; \ -+ case MX25_PAD_FEC_TDATA0__GPIO_3_7: \ -+ __gpio = GPIO_3_7; \ -+ break; \ -+ case MX25_PAD_FEC_TDATA1__GPIO_3_8: \ -+ __gpio = GPIO_3_8; \ -+ break; \ -+ case MX25_PAD_FEC_TX_EN__GPIO_3_9: \ -+ __gpio = GPIO_3_9; \ -+ break; \ -+ case MX25_PAD_FEC_RDATA0__GPIO_3_10: \ -+ __gpio = GPIO_3_10; \ -+ break; \ -+ case MX25_PAD_FEC_RDATA1__GPIO_3_11: \ -+ __gpio = GPIO_3_11; \ -+ break; \ -+ case MX25_PAD_FEC_RX_DV__GPIO_3_12: \ -+ __gpio = GPIO_3_12; \ -+ break; \ -+ case MX25_PAD_FEC_TX_CLK__GPIO_3_13: \ -+ __gpio = GPIO_3_13; \ -+ break; \ -+ case MX25_PAD_RTCK__GPIO_3_14: \ -+ __gpio = GPIO_3_14; \ -+ break; \ -+ case MX25_PAD_EXT_ARMCLK__GPIO_3_15: \ -+ __gpio = GPIO_3_15; \ -+ break; \ -+ case MX25_PAD_UPLL_BYPCLK__GPIO_3_16: \ -+ __gpio = GPIO_3_16; \ -+ break; \ -+ case MX25_PAD_VSTBY_REQ__GPIO_3_17: \ -+ __gpio = GPIO_3_17; \ -+ break; \ -+ case MX25_PAD_VSTBY_ACK__GPIO_3_18: \ -+ __gpio = GPIO_3_18; \ -+ break; \ -+ case MX25_PAD_POWER_FAIL__GPIO_3_19: \ -+ __gpio = GPIO_3_19; \ -+ break; \ -+ case MX25_PAD_CS4__GPIO_3_20: \ -+ __gpio = GPIO_3_20; \ -+ break; \ -+ case MX25_PAD_CS5__GPIO_3_21: \ -+ __gpio = GPIO_3_21; \ -+ break; \ -+ case MX25_PAD_NF_CE0__GPIO_3_22: \ -+ __gpio = GPIO_3_22; \ -+ break; \ -+ case MX25_PAD_ECB__GPIO_3_23: \ -+ __gpio = GPIO_3_23; \ -+ break; \ -+ case MX25_PAD_LBA__GPIO_3_24: \ -+ __gpio = GPIO_3_24; \ -+ break; \ -+ case MX25_PAD_RW__GPIO_3_25: \ -+ __gpio = GPIO_3_25; \ -+ break; \ -+ case MX25_PAD_NFWE_B__GPIO_3_26: \ -+ __gpio = GPIO_3_26; \ -+ break; \ -+ case MX25_PAD_NFRE_B__GPIO_3_27: \ -+ __gpio = GPIO_3_27; \ -+ break; \ -+ case MX25_PAD_NFALE__GPIO_3_28: \ -+ __gpio = GPIO_3_28; \ -+ break; \ -+ case MX25_PAD_NFCLE__GPIO_3_29: \ -+ __gpio = GPIO_3_29; \ -+ break; \ -+ case MX25_PAD_NFWP_B__GPIO_3_30: \ -+ __gpio = GPIO_3_30; \ -+ break; \ -+ case MX25_PAD_NFRB__GPIO_3_31: \ -+ __gpio = GPIO_3_31; \ -+ break; \ -+ \ -+ case MX25_PAD_A10__GPIO_4_0: \ -+ __gpio = GPIO_4_0; \ -+ break; \ -+ case MX25_PAD_A13__GPIO_4_1: \ -+ __gpio = GPIO_4_1; \ -+ break; \ -+ case MX25_PAD_CS0__GPIO_4_2: \ -+ __gpio = GPIO_4_2; \ -+ break; \ -+ case MX25_PAD_CS1__GPIO_4_3: \ -+ __gpio = GPIO_4_3; \ -+ break; \ -+ case MX25_PAD_BCLK__GPIO_4_4: \ -+ __gpio = GPIO_4_4; \ -+ break; \ -+ case MX25_PAD_D15__GPIO_4_5: \ -+ __gpio = GPIO_4_5; \ -+ break; \ -+ case MX25_PAD_D14__GPIO_4_6: \ -+ __gpio = GPIO_4_6; \ -+ break; \ -+ case MX25_PAD_D13__GPIO_4_7: \ -+ __gpio = GPIO_4_7; \ -+ break; \ -+ case MX25_PAD_D12__GPIO_4_8: \ -+ __gpio = GPIO_4_8; \ -+ break; \ -+ case MX25_PAD_D11__GPIO_4_9: \ -+ __gpio = GPIO_4_9; \ -+ break; \ -+ case MX25_PAD_D10__GPIO_4_10: \ -+ __gpio = GPIO_4_10; \ -+ break; \ -+ case MX25_PAD_D9__GPIO_4_11: \ -+ __gpio = GPIO_4_11; \ -+ break; \ -+ case MX25_PAD_D8__GPIO_4_12: \ -+ __gpio = GPIO_4_12; \ -+ break; \ -+ case MX25_PAD_D7__GPIO_4_13: \ -+ __gpio = GPIO_4_13; \ -+ break; \ -+ case MX25_PAD_D6__GPIO_4_14: \ -+ __gpio = GPIO_4_14; \ -+ break; \ -+ case MX25_PAD_D5__GPIO_4_15: \ -+ __gpio = GPIO_4_15; \ -+ break; \ -+ case MX25_PAD_D4__GPIO_4_16: \ -+ __gpio = GPIO_4_16; \ -+ break; \ -+ case MX25_PAD_D3__GPIO_4_17: \ -+ __gpio = GPIO_4_17; \ -+ break; \ -+ case MX25_PAD_D2__GPIO_4_18: \ -+ __gpio = GPIO_4_18; \ -+ break; \ -+ case MX25_PAD_D1__GPIO_4_19: \ -+ __gpio = GPIO_4_19; \ -+ break; \ -+ case MX25_PAD_D0__GPIO_4_20: \ -+ __gpio = GPIO_4_20; \ -+ break; \ -+ case MX25_PAD_CSI_D9__GPIO_4_21: \ -+ __gpio = GPIO_4_21; \ -+ break; \ -+ case MX25_PAD_UART1_RXD__GPIO_4_22: \ -+ __gpio = GPIO_4_22; \ -+ break; \ -+ case MX25_PAD_UART1_TXD__GPIO_4_23: \ -+ __gpio = GPIO_4_23; \ -+ break; \ -+ case MX25_PAD_UART1_RTS__GPIO_4_24: \ -+ __gpio = GPIO_4_24; \ -+ break; \ -+ case MX25_PAD_UART1_CTS__GPIO_4_25: \ -+ __gpio = GPIO_4_25; \ -+ break; \ -+ case MX25_PAD_UART2_RXD__GPIO_4_26: \ -+ __gpio = GPIO_4_26; \ -+ break; \ -+ case MX25_PAD_UART2_TXD__GPIO_4_27: \ -+ __gpio = GPIO_4_27; \ -+ break; \ -+ case MX25_PAD_UART2_RTS__GPIO_4_28: \ -+ __gpio = GPIO_4_28; \ -+ break; \ -+ case MX25_PAD_UART2_CTS__GPIO_4_29: \ -+ __gpio = GPIO_4_29; \ -+ break; \ -+ case MX25_PAD_BOOT_MODE0__GPIO_4_30: \ -+ __gpio = GPIO_4_30; \ -+ break; \ -+ case MX25_PAD_BOOT_MODE1__GPIO_4_31: \ -+ __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 { - unsigned select_input:3; - }; - --#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 { - /* - * 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_DRIVE_VOLTAGE_3_3_V (0 << 13) -+#define PAD_CTL_DRIVE_VOLTAGE_1_8_V (1 << 13) - --#define PAD_CTL_NO_HYSTERESIS 0 --#define PAD_CTL_HYSTERESIS 1 -+#define PAD_CTL_NO_HYSTERESIS (0 << 8) -+#define PAD_CTL_HYSTERESIS (1 << 8) - --#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_PULL_DISABLED (0x0 << 4) -+#define PAD_CTL_PULL_KEEPER (0x8 << 4) -+#define PAD_CTL_PULL_DOWN_100K (0xc << 4) -+#define PAD_CTL_PULL_UP_47K (0xd << 4) -+#define PAD_CTL_PULL_UP_100K (0xe << 4) -+#define PAD_CTL_PULL_UP_22K (0xf << 4) -+ -+#define PAD_CTL_OUTPUT_CMOS (0 << 3) -+#define PAD_CTL_OUTPUT_OPEN_DRAIN (1 << 3) -+ -+#define PAD_CTL_DRIVE_STRENGTH_NORM (0 << 1) -+#define PAD_CTL_DRIVE_STRENGTH_HIGH (1 << 1) -+#define PAD_CTL_DRIVE_STRENGTH_MAX (2 << 1) - --#define PAD_CTL_SLEW_RATE_SLOW 0 --#define PAD_CTL_SLEW_RATE_FAST 1 -+#define PAD_CTL_SLEW_RATE_SLOW (0 << 0) -+#define PAD_CTL_SLEW_RATE_FAST (1 << 0) - - /* - * 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 -@@ -24,10 +24,14 @@ - * GPIO Module and I/O Multiplexer - * x = 0..3 for reg_A, reg_B, reg_C, reg_D - */ -+#ifndef CONFIG_MACH_MX25 - #define VA_GPIO_BASE IO_ADDRESS(GPIO_BASE_ADDR) -+#endif - #define MXC_DDIR(x) (0x00 + ((x) << 8)) -+#ifndef CONFIG_MACH_MX25 - #define MXC_OCR1(x) (0x04 + ((x) << 8)) - #define MXC_OCR2(x) (0x08 + ((x) << 8)) -+#endif - #define MXC_ICONFA1(x) (0x0c + ((x) << 8)) - #define MXC_ICONFA2(x) (0x10 + ((x) << 8)) - #define MXC_ICONFB1(x) (0x14 + ((x) << 8)) -@@ -96,16 +100,20 @@ - - - #ifdef CONFIG_ARCH_MX1 --#include -+# include - #endif - #ifdef CONFIG_ARCH_MX2 --#include --#ifdef CONFIG_MACH_MX21 --#include --#endif --#ifdef CONFIG_MACH_MX27 --#include --#endif -+# ifndef CONFIG_MACH_MX25 -+# include -+# ifdef CONFIG_MACH_MX21 -+# include -+# endif -+# endif -+# ifdef CONFIG_MACH_MX27 -+# include -+# else -+# include -+# endif - #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 -@@ -21,7 +21,11 @@ - #if defined CONFIG_ARCH_MX1 - #define MXC_GPIO_IRQS (32 * 4) - #elif defined CONFIG_ARCH_MX2 -+#ifndef CONFIG_MACH_MX25 - #define MXC_GPIO_IRQS (32 * 6) -+#else -+#define MXC_GPIO_IRQS (32 * 4) -+#endif - #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 -@@ -14,12 +14,13 @@ - #if defined CONFIG_ARCH_MX1 - #define PHYS_OFFSET UL(0x08000000) - #elif defined CONFIG_ARCH_MX2 --#ifdef CONFIG_MACH_MX21 -+# if defined(CONFIG_MACH_MX21) - #define PHYS_OFFSET UL(0xC0000000) --#endif --#ifdef CONFIG_MACH_MX27 -+# elif defined(CONFIG_MACH_MX27) - #define PHYS_OFFSET UL(0xA0000000) --#endif -+# elif defined(CONFIG_MACH_MX25) -+#define PHYS_OFFSET UL(0x80000000) -+# endif - #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 @@ -+/* -+ * Copyright 2008-2009 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 -+ */ -+ -+/*! -+ * @file arch-mxc/mx25.h -+ * @brief This file contains register definitions. -+ * -+ * @ingroup MSL_MX25 -+ */ -+ -+#ifndef __ASM_ARCH_MXC_MX25_H__ -+#define __ASM_ARCH_MXC_MX25_H__ -+ -+#ifndef __ASM_ARCH_MXC_HARDWARE_H__ -+#error "Do not include directly." -+#endif -+ -+#ifdef CONFIG_DEBUG_LL -+#ifdef CONFIG_MACH_TX25 -+#include -+#endif -+#endif // CONFIG_DEBUG_LL -+ -+/* -+ * MX25 memory map: -+ * -+ * Virt Phys Size What -+ * --------------------------------------------------------------------------- -+ * FC000000 43F00000 1M AIPS 1 -+ * FC100000 50000000 1M SPBA -+ * FC200000 53F00000 1M AIPS 2 -+ * FC300000 60000000 1M ROMPATCH (128M) -+ * FC400000 68000000 1M ASIC (128M) -+ * FC500000 78000000 128K FBC RAM (IRAM) -+ * 80000000 256M SDRAM0 -+ * 90000000 256M SDRAM1 -+ * A0000000 128M CS0 Flash -+ * A8000000 128M CS1 Flash -+ * B0000000 32M CS2 SRAM -+ * B2000000 32M CS3 -+ * B4000000 32M CS4 -+ * B6000000 32M CS5 -+ * FC520000 B8000000 64K SDRAM, WEIM, M3IF, EMI controllers -+ * FC530000 BB000000 8K NFC -+ */ -+ -+#include -+#define VA(x) _AT(void __force __iomem *,x) -+ -+/* -+ * IRAM -+ */ -+#define IRAM_BASE_ADDR UL(0x78000000) /* internal ram */ -+#define IRAM_BASE_ADDR_VIRT VA(0xFC500000) -+#define IRAM_SIZE SZ_128K -+ -+/* -+ * AIPS 1 -+ */ -+#define AIPS1_BASE_ADDR UL(0x43F00000) -+#define AIPS1_BASE_ADDR_VIRT VA(0xFC000000) -+#define AIPS1_SIZE SZ_1M -+ -+#define MAX_BASE_ADDR (AIPS1_BASE_ADDR + 0x00004000) -+#define CLKCTL_BASE_ADDR (AIPS1_BASE_ADDR + 0x00008000) -+#define ETB_SLOT4_BASE_ADDR (AIPS1_BASE_ADDR + 0x0000C000) -+#define ETB_SLOT5_BASE_ADDR (AIPS1_BASE_ADDR + 0x00010000) -+#define AAPE_BASE_ADDR (AIPS1_BASE_ADDR + 0x00014000) -+#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 UART1_BASE_ADDR (AIPS1_BASE_ADDR + 0x00090000) -+#define UART2_BASE_ADDR (AIPS1_BASE_ADDR + 0x00094000) -+#define I2C2_BASE_ADDR (AIPS1_BASE_ADDR + 0x00098000) -+#define OWIRE_BASE_ADDR (AIPS1_BASE_ADDR + 0x0009C000) -+#define ATA_BASE_ADDR (AIPS1_BASE_ADDR + 0x000A0000) -+#define CSPI1_BASE_ADDR (AIPS1_BASE_ADDR + 0x000A4000) -+#define KPP_BASE_ADDR (AIPS1_BASE_ADDR + 0x000A8000) -+#define IOMUXC_BASE_ADDR (AIPS1_BASE_ADDR + 0x000AC000) -+#define AUDMUX_BASE_ADDR (AIPS1_BASE_ADDR + 0x000B0000) -+#define ECT_A_BASE_ADDR (AIPS1_BASE_ADDR + 0x000B8000) -+#define ECT_B_BASE_ADDR (AIPS1_BASE_ADDR + 0x000BC000) -+ -+/* -+ * SPBA global module enabled #0 -+ */ -+#define SPBA0_BASE_ADDR UL(0x50000000) -+#define SPBA0_BASE_ADDR_VIRT VA(0xFC100000) -+#define SPBA0_SIZE SZ_1M -+ -+#define CSPI3_BASE_ADDR (SPBA0_BASE_ADDR + 0x00004000) -+#define UART4_BASE_ADDR (SPBA0_BASE_ADDR + 0x00008000) -+#define UART3_BASE_ADDR (SPBA0_BASE_ADDR + 0x0000C000) -+#define CSPI2_BASE_ADDR (SPBA0_BASE_ADDR + 0x00010000) -+#define SSI2_BASE_ADDR (SPBA0_BASE_ADDR + 0x00014000) -+#define ESAI_BASE_ADDR (SPBA0_BASE_ADDR + 0x00018000) -+#define ATA_DMA_BASE_ADDR (SPBA0_BASE_ADDR + 0x00020000) -+#define SIM1_BASE_ADDR (SPBA0_BASE_ADDR + 0x00024000) -+#define SIM2_BASE_ADDR (SPBA0_BASE_ADDR + 0x00028000) -+#define UART5_BASE_ADDR (SPBA0_BASE_ADDR + 0x0002C000) -+#define TSC_BASE_ADDR (SPBA0_BASE_ADDR + 0x00030000) -+#define SSI1_BASE_ADDR (SPBA0_BASE_ADDR + 0x00034000) -+#define FEC_BASE_ADDR (SPBA0_BASE_ADDR + 0x00038000) -+#define SPBA_CTRL_BASE_ADDR (SPBA0_BASE_ADDR + 0x0003C000) -+ -+/*! -+ * defines for SPBA modules -+ */ -+#define SPBA_CSPI3 (0x1 << 2) -+#define SPBA_UART4 (0x2 << 2) -+#define SPBA_UART3 (0x3 << 2) -+#define SPBA_CSPI2 (0x4 << 2) -+#define SPBA_SSI2 (0x5 << 2) -+#define SPBA_ESAI (0x6 << 2) -+#define SPBA_ATA (0x8 << 2) -+#define SPBA_SIM1 (0x9 << 2) -+#define SPBA_SIM2 (0xA << 2) -+#define SPBA_UART5 (0xB << 2) -+#define SPBA_ANALOG (0xC << 2) -+#define SPBA_SSI1 (0xD << 2) -+#define SPBA_FEC (0xE << 2) -+ -+/*! -+ * Defines for modules using static and dynamic DMA channels -+ */ -+#define MXC_DMA_CHANNEL_IRAM 30 -+#define MXC_DMA_CHANNEL_UART1_RX MXC_DMA_DYNAMIC_CHANNEL -+#define MXC_DMA_CHANNEL_UART1_TX MXC_DMA_DYNAMIC_CHANNEL -+#define MXC_DMA_CHANNEL_UART2_RX MXC_DMA_DYNAMIC_CHANNEL -+#define MXC_DMA_CHANNEL_UART2_TX MXC_DMA_DYNAMIC_CHANNEL -+#define MXC_DMA_CHANNEL_UART3_RX MXC_DMA_DYNAMIC_CHANNEL -+#define MXC_DMA_CHANNEL_UART3_TX MXC_DMA_DYNAMIC_CHANNEL -+#define MXC_DMA_CHANNEL_UART4_RX MXC_DMA_DYNAMIC_CHANNEL -+#define MXC_DMA_CHANNEL_UART4_TX MXC_DMA_DYNAMIC_CHANNEL -+#define MXC_DMA_CHANNEL_UART5_RX MXC_DMA_DYNAMIC_CHANNEL -+#define MXC_DMA_CHANNEL_UART5_TX MXC_DMA_DYNAMIC_CHANNEL -+#define MXC_DMA_CHANNEL_MMC1 MXC_DMA_DYNAMIC_CHANNEL -+#define MXC_DMA_CHANNEL_SSI1_RX MXC_DMA_DYNAMIC_CHANNEL -+#ifdef CONFIG_SDMA_IRAM -+#define MXC_DMA_CHANNEL_SSI1_TX (MXC_DMA_CHANNEL_IRAM + 1) -+#else -+#define MXC_DMA_CHANNEL_SSI1_TX MXC_DMA_DYNAMIC_CHANNEL -+#endif -+#define MXC_DMA_CHANNEL_SSI2_RX MXC_DMA_DYNAMIC_CHANNEL -+#define MXC_DMA_CHANNEL_SSI2_TX MXC_DMA_DYNAMIC_CHANNEL -+#define MXC_DMA_CHANNEL_CSPI1_RX MXC_DMA_DYNAMIC_CHANNEL -+#define MXC_DMA_CHANNEL_CSPI1_TX MXC_DMA_DYNAMIC_CHANNEL -+#define MXC_DMA_CHANNEL_CSPI2_RX MXC_DMA_DYNAMIC_CHANNEL -+#define MXC_DMA_CHANNEL_CSPI2_TX MXC_DMA_DYNAMIC_CHANNEL -+#define MXC_DMA_CHANNEL_CSPI3_RX MXC_DMA_DYNAMIC_CHANNEL -+#define MXC_DMA_CHANNEL_CSPI3_TX MXC_DMA_DYNAMIC_CHANNEL -+#define MXC_DMA_CHANNEL_ATA_RX MXC_DMA_DYNAMIC_CHANNEL -+#define MXC_DMA_CHANNEL_ATA_TX MXC_DMA_DYNAMIC_CHANNEL -+#define MXC_DMA_CHANNEL_MEMORY MXC_DMA_DYNAMIC_CHANNEL -+#define MXC_DMA_CHANNEL_ESAI_RX MXC_DMA_DYNAMIC_CHANNEL -+#define MXC_DMA_CHANNEL_ESAI_TX MXC_DMA_DYNAMIC_CHANNEL -+ -+/* -+ * AIPS 2 -+ */ -+#define AIPS2_BASE_ADDR UL(0x53F00000) -+#define AIPS2_BASE_ADDR_VIRT VA(0xFC200000) -+#define AIPS2_SIZE SZ_1M -+ -+#define CCM_BASE_ADDR (AIPS2_BASE_ADDR + 0x00080000) -+#define GPT4_BASE_ADDR (AIPS2_BASE_ADDR + 0x00084000) -+#define GPT3_BASE_ADDR (AIPS2_BASE_ADDR + 0x00088000) -+#define GPT2_BASE_ADDR (AIPS2_BASE_ADDR + 0x0008C000) -+#define GPT1_BASE_ADDR (AIPS2_BASE_ADDR + 0x00090000) -+#define EPIT1_BASE_ADDR (AIPS2_BASE_ADDR + 0x00094000) -+#define EPIT2_BASE_ADDR (AIPS2_BASE_ADDR + 0x00098000) -+#define GPIO4_BASE_ADDR (AIPS2_BASE_ADDR + 0x0009C000) -+#define PWM2_BASE_ADDR (AIPS2_BASE_ADDR + 0x000A0000) -+#define GPIO3_BASE_ADDR (AIPS2_BASE_ADDR + 0x000A4000) -+#define PWM3_BASE_ADDR (AIPS2_BASE_ADDR + 0x000A8000) -+#define SCC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000AC000) -+#define RNGD_BASE_ADDR (AIPS2_BASE_ADDR + 0x000B0000) -+#define MMC_SDHC1_BASE_ADDR (AIPS2_BASE_ADDR + 0x000B4000) -+#define MMC_SDHC2_BASE_ADDR (AIPS2_BASE_ADDR + 0x000B8000) -+#define LCDC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000BC000) -+#define SLCDC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000C0000) -+#define PWM4_BASE_ADDR (AIPS2_BASE_ADDR + 0x000C8000) -+#define GPIO1_BASE_ADDR (AIPS2_BASE_ADDR + 0x000CC000) -+#define GPIO2_BASE_ADDR (AIPS2_BASE_ADDR + 0x000D0000) -+#define SDMA_BASE_ADDR (AIPS2_BASE_ADDR + 0x000D4000) -+#define WDOG_BASE_ADDR (AIPS2_BASE_ADDR + 0x000DC000) -+#define PWM1_BASE_ADDR (AIPS2_BASE_ADDR + 0x000E0000) -+#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 CSI_BASE_ADDR (AIPS2_BASE_ADDR + 0x000F8000) -+#define DRYICE_BASE_ADDR (AIPS2_BASE_ADDR + 0x000FC000) -+ -+/* -+ * ROMP and ASIC -+ */ -+#define ROMP_BASE_ADDR UL(0x60000000) -+#define ROMP_BASE_ADDR_VIRT VA(0xFC300000) -+#define ROMP_SIZE SZ_1M -+ -+#define ASIC_BASE_ADDR UL(0x68000000) -+#define ASIC_BASE_ADDR_VIRT VA(0xFC400000) -+#define ASIC_SIZE SZ_1M -+#define AVIC_BASE_ADDR ASIC_BASE_ADDR -+#define AVIC_BASE_ADDR_VIRT ASIC_BASE_ADDR_VIRT -+#define AVIC_SIZE ASIC_SIZE -+ -+/* -+ * SDRAM, WEIM, M3IF, EMI controllers -+ */ -+#define X_MEMC_BASE_ADDR UL(0xB8000000) -+#define X_MEMC_BASE_ADDR_VIRT VA(0xFC520000) -+#define X_MEMC_SIZE SZ_64K -+ -+#define SDRAMC_BASE_ADDR (X_MEMC_BASE_ADDR + 0x1000) -+#define WEIM_BASE_ADDR (X_MEMC_BASE_ADDR + 0x2000) -+#define M3IF_BASE_ADDR (X_MEMC_BASE_ADDR + 0x3000) -+#define EMI_CTL_BASE_ADDR (X_MEMC_BASE_ADDR + 0x4000) -+ -+/* -+ * NFC controller -+ */ -+#define NFC_BASE_ADDR UL(0xBB000000) -+#define NFC_BASE_ADDR_VIRT VA(0xFC530000) -+#define NFC_SIZE SZ_8K -+ -+/* -+ * Memory regions and CS -+ */ -+#define CSD0_BASE_ADDR UL(0x80000000) -+#define CSD1_BASE_ADDR UL(0x90000000) -+ -+#define SDRAM_BASE_ADDR CSD0_BASE_ADDR -+ -+#define CS0_BASE_ADDR UL(0xA0000000) -+#define CS1_BASE_ADDR UL(0xA8000000) -+#define CS2_BASE_ADDR UL(0xB0000000) -+#define CS3_BASE_ADDR UL(0xB2000000) -+#define CS4_BASE_ADDR UL(0xB4000000) -+#define CS4_SIZE SZ_32M -+#define CS5_BASE_ADDR UL(0xB6000000) -+#define CS5_SIZE SZ_32M -+ -+/*! -+ * 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 -+ * and returning the virtual address. If the physical address is not mapped, -+ * it returns 0 -+ */ -+#define IO_ADDRESS(x) \ -+ VA((((x) >= AIPS1_BASE_ADDR) && ((x) < (AIPS1_BASE_ADDR + AIPS1_SIZE))) ? AIPS1_IO_ADDRESS(x): \ -+ (((x) >= SPBA0_BASE_ADDR) && ((x) < (SPBA0_BASE_ADDR + SPBA0_SIZE))) ? SPBA0_IO_ADDRESS(x): \ -+ (((x) >= AIPS2_BASE_ADDR) && ((x) < (AIPS2_BASE_ADDR + AIPS2_SIZE))) ? AIPS2_IO_ADDRESS(x): \ -+ (((x) >= ROMP_BASE_ADDR) && ((x) < (ROMP_BASE_ADDR + ROMP_SIZE))) ? ROMP_IO_ADDRESS(x): \ -+ (((x) >= ASIC_BASE_ADDR) && ((x) < (ASIC_BASE_ADDR + AVIC_SIZE))) ? ASIC_IO_ADDRESS(x): \ -+ (((x) >= IRAM_BASE_ADDR) && ((x) < (IRAM_BASE_ADDR + IRAM_SIZE))) ? IRAM_IO_ADDRESS(x): \ -+ (((x) >= X_MEMC_BASE_ADDR) && ((x) < (X_MEMC_BASE_ADDR + X_MEMC_SIZE))) ? X_MEMC_IO_ADDRESS(x): \ -+ (((x) >= NFC_BASE_ADDR) && ((x) < (NFC_BASE_ADDR + NFC_SIZE))) ? NFC_IO_ADDRESS(x): \ -+ 0) -+ -+#define MXC_VADDR_RANGE(v,n) \ -+ (((v)) >= n##_BASE_ADDR_VIRT) && \ -+ (((v)) < n##_BASE_ADDR_VIRT + n##_SIZE) ? \ -+ ((v)-n##_BASE_ADDR_VIRT + n##_BASE_ADDR) : -+ -+#define MXC_PHYS_ADDRESS(v) \ -+ UL(MXC_VADDR_RANGE(v,AIPS1) \ -+ MXC_VADDR_RANGE(v,AIPS2) \ -+ MXC_VADDR_RANGE(v,SPBA0) \ -+ MXC_VADDR_RANGE(v,ROMP) \ -+ MXC_VADDR_RANGE(v,ASIC) \ -+ MXC_VADDR_RANGE(v,IRAM) \ -+ MXC_VADDR_RANGE(v,X_MEMC) \ -+ MXC_VADDR_RANGE(v,NFC) \ -+ 0) -+ -+#define GPIO_BASE_ADDR(port) \ -+ ((port == 1 ? GPIO1_BASE_ADDR : \ -+ (port == 2 ? GPIO2_BASE_ADDR : \ -+ (port == 3 ? GPIO3_BASE_ADDR : \ -+ (port == 4 ? GPIO4_BASE_ADDR : 0))))) -+ -+/* -+ * define the address mapping macros: in physical address order -+ */ -+ -+#define AIPS1_IO_ADDRESS(x) \ -+ (((x) - AIPS1_BASE_ADDR) + AIPS1_BASE_ADDR_VIRT) -+ -+#define SPBA0_IO_ADDRESS(x) \ -+ (((x) - SPBA0_BASE_ADDR) + SPBA0_BASE_ADDR_VIRT) -+ -+#define AIPS2_IO_ADDRESS(x) \ -+ (((x) - AIPS2_BASE_ADDR) + AIPS2_BASE_ADDR_VIRT) -+ -+#define ROMP_IO_ADDRESS(x) \ -+ (((x) - ROMP_BASE_ADDR) + ROMP_BASE_ADDR_VIRT) -+ -+#define ASIC_IO_ADDRESS(x) \ -+ (((x) - ASIC_BASE_ADDR) + ASIC_BASE_ADDR_VIRT) -+ -+/* for entry-macro.S */ -+#define AVIC_IO_ADDRESS(x) ASIC_IO_ADDRESS(x) -+ -+#define IRAM_IO_ADDRESS(x) \ -+ (((x) - IRAM_BASE_ADDR) + IRAM_BASE_ADDR_VIRT) -+ -+#define X_MEMC_IO_ADDRESS(x) \ -+ (((x) - X_MEMC_BASE_ADDR) + X_MEMC_BASE_ADDR_VIRT) -+ -+#define NFC_IO_ADDRESS(x) \ -+ (((x) - NFC_BASE_ADDR) + NFC_BASE_ADDR_VIRT) -+ -+/* -+ * DMA request assignments -+ */ -+#define DMA_REQ_EXTREQ0 0 -+#define DMA_REQ_CCM 1 -+#define DMA_REQ_ATA_TX_END 2 -+#define DMA_REQ_ATA_TX 3 -+#define DMA_REQ_ATA_RX 4 -+#define DMA_REQ_CSPI2_RX 6 -+#define DMA_REQ_CSPI2_TX 7 -+#define DMA_REQ_CSPI1_RX 8 -+#define DMA_REQ_CSPI1_TX 9 -+#define DMA_REQ_UART3_RX 10 -+#define DMA_REQ_UART3_TX 11 -+#define DMA_REQ_UART4_RX 12 -+#define DMA_REQ_UART4_TX 13 -+#define DMA_REQ_EXTREQ1 14 -+#define DMA_REQ_EXTREQ2 15 -+#define DMA_REQ_UART2_RX 16 -+#define DMA_REQ_UART2_TX 17 -+#define DMA_REQ_UART1_RX 18 -+#define DMA_REQ_UART1_TX 19 -+#define DMA_REQ_SSI2_RX1 22 -+#define DMA_REQ_SSI2_TX1 23 -+#define DMA_REQ_SSI2_RX0 24 -+#define DMA_REQ_SSI2_TX0 25 -+#define DMA_REQ_SSI1_RX1 26 -+#define DMA_REQ_SSI1_TX1 27 -+#define DMA_REQ_SSI1_RX0 28 -+#define DMA_REQ_SSI1_TX0 29 -+#define DMA_REQ_NFC 30 -+#define DMA_REQ_ECT 31 -+#define DMA_REQ_ESAI_RX 32 -+#define DMA_REQ_ESAI_TX 33 -+#define DMA_REQ_CSPI3_RX 34 -+#define DMA_REQ_CSPI3_TX 35 -+#define DMA_REQ_SIM2_RX 36 -+#define DMA_REQ_SIM2_TX 37 -+#define DMA_REQ_SIM1_RX 38 -+#define DMA_REQ_SIM1_TX 39 -+#define DMA_REQ_TSC_GCQ 44 -+#define DMA_REQ_TSC_TCQ 45 -+#define DMA_REQ_UART5_RX 46 -+#define DMA_REQ_UART5_TX 47 -+ -+/* -+ * Interrupt numbers -+ */ -+#define MXC_INT_CSPI3 0 -+#define MXC_INT_GPT4 1 -+#define MXC_INT_OWIRE 2 -+#define MXC_INT_I2C 3 -+#define MXC_INT_I2C2 4 -+#define MXC_INT_UART4 5 -+#define MXC_INT_RTIC 6 -+#define MXC_INT_ESAI 7 -+#define MXC_INT_SDHC2 8 -+#define MXC_INT_SDHC1 9 -+#define MXC_INT_I2C3 10 -+#define MXC_INT_SSI2 11 -+#define MXC_INT_SSI1 12 -+#define MXC_INT_CSPI2 13 -+#define MXC_INT_CSPI1 14 -+#define MXC_INT_ATA 15 -+#define MXC_INT_GPIO3 16 -+#define MXC_INT_CSI 17 -+#define MXC_INT_UART3 18 -+#define MXC_INT_IIM 19 -+#define MXC_INT_SIM1 20 -+#define MXC_INT_SIM2 21 -+#define MXC_INT_RNGD 22 -+#define MXC_INT_GPIO4 23 -+#define MXC_INT_KPP 24 -+#define MXC_INT_DRYICE_RTC 25 -+#define MXC_INT_PWM 26 -+#define MXC_INT_EPIT2 27 -+#define MXC_INT_EPIT1 28 -+#define MXC_INT_GPT3 29 -+#define MXC_INT_POWER_FAIL 30 -+#define MXC_INT_CRM 31 -+#define MXC_INT_UART2 32 -+#define MXC_INT_NANDFC 33 -+#define MXC_INT_SDMA 34 -+#define MXC_INT_USB_HTG 35 -+#define MXC_INT_PWM2 36 -+#define MXC_INT_USB_OTG 37 -+#define MXC_INT_SLCDC 38 -+#define MXC_INT_LCDC 39 -+#define MXC_INT_UART5 40 -+#define MXC_INT_PWM3 41 -+#define MXC_INT_PWM4 42 -+#define MXC_INT_CAN1 43 -+#define MXC_INT_CAN2 44 -+#define MXC_INT_UART1 45 -+#define MXC_INT_TSC 46 -+#define MXC_INT_ECT 48 -+#define MXC_INT_SCC_SCM 49 -+#define MXC_INT_SCC_SMN 50 -+#define MXC_INT_GPIO2 51 -+#define MXC_INT_GPIO1 52 -+#define MXC_INT_GPT2 53 -+#define MXC_INT_GPT1 54 -+#define MXC_INT_WDOG 55 -+#define MXC_INT_DRYICE 56 -+#define MXC_INT_FEC 57 -+#define MXC_INT_EXT_INT5 58 -+#define MXC_INT_EXT_INT4 59 -+#define MXC_INT_EXT_INT3 60 -+#define MXC_INT_EXT_INT2 61 -+#define MXC_INT_EXT_INT1 62 -+#define MXC_INT_EXT_INT0 63 -+ -+#define MXC_INT_GPT MXC_INT_GPT1 -+ -+/* silicon revisions specific to i.MX25 */ -+#define CHIP_REV_1_0 0x00 -+#define CHIP_REV_1_1 0x01 -+ -+/* gpio and gpio based interrupt handling */ -+#define GPIO_DR 0x00 -+#define GPIO_GDIR 0x04 -+#define GPIO_PSR 0x08 -+#define GPIO_ICR1 0x0C -+#define GPIO_ICR2 0x10 -+#define GPIO_IMR 0x14 -+#define GPIO_ISR 0x18 -+#define GPIO_INT_LOW_LEV 0x0 -+#define GPIO_INT_HIGH_LEV 0x1 -+#define GPIO_INT_RISE_EDGE 0x2 -+#define GPIO_INT_FALL_EDGE 0x3 -+#define GPIO_INT_NONE 0x4 -+ -+/* Mandatory defines used globally */ -+ -+/* this CPU supports up to 96 GPIOs */ -+#define ARCH_NR_GPIOS 128 -+ -+#define MXC_TIMER_GPT1 1 -+#define MXC_TIMER_GPT2 2 -+#define MXC_TIMER_GPT3 3 -+#define MXC_TIMER_GPT4 4 -+ -+/*! -+ * NFMS bit in RCSR register for pagesize of nandflash -+ */ -+#define NFMS_REG IO_ADDRESS(CCM_BASE_ADDR + 0x28) -+#define NFMS_NF_DWIDTH 14 -+#define NFMS_NF_PG_SZ 8 -+ -+#if !defined(__ASSEMBLY__) && !defined(__MXC_BOOT_UNCOMPRESS) -+#include -+ -+extern int mx25_revision(void); -+ -+#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 -@@ -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 - * and returning the virtual address. If the physical address is not mapped, -- * it returns 0xDEADBEEF -+ * it returns 0 - */ - #define IO_ADDRESS(x) \ - (void __force __iomem *) \ -@@ -88,7 +88,7 @@ - ((x >= SAHB1_BASE_ADDR) && (x < (SAHB1_BASE_ADDR + SAHB1_SIZE))) ? \ - SAHB1_IO_ADDRESS(x) : \ - ((x >= X_MEMC_BASE_ADDR) && (x < (X_MEMC_BASE_ADDR + X_MEMC_SIZE))) ? \ -- X_MEMC_IO_ADDRESS(x) : 0xDEADBEEF) -+ X_MEMC_IO_ADDRESS(x) : 0) - - /* 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 -@@ -27,6 +27,7 @@ - #define MXC_CPU_MX1 1 - #define MXC_CPU_MX21 21 - #define MXC_CPU_MX27 27 -+#define MXC_CPU_MX25 25 - #define MXC_CPU_MX31 31 - #define MXC_CPU_MX35 35 - -@@ -70,6 +71,18 @@ extern unsigned int __mxc_cpu_type; - # define cpu_is_mx27() (0) - #endif - -+#ifdef CONFIG_MACH_MX25 -+# ifdef mxc_cpu_type -+# undef mxc_cpu_type -+# define mxc_cpu_type __mxc_cpu_type -+# else -+# define mxc_cpu_type MXC_CPU_MX25 -+# endif -+# define cpu_is_mx25() (mxc_cpu_type == MXC_CPU_MX25) -+#else -+# define cpu_is_mx25() (0) -+#endif -+ - #ifdef CONFIG_ARCH_MX31 - # ifdef mxc_cpu_type - # undef mxc_cpu_type -@@ -101,6 +114,6 @@ extern unsigned int __mxc_cpu_type; - #endif - - #define cpu_is_mx3() (cpu_is_mx31() || cpu_is_mx35()) --#define cpu_is_mx2() (cpu_is_mx21() || cpu_is_mx27()) -+#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 -@@ -0,0 +1,504 @@ -+ -+/* -+ * Copyright 2004-2008 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_SDMA_H__ -+#define __ASM_ARCH_MXC_SDMA_H__ -+ -+/*! -+ * @defgroup SDMA Smart Direct Memory Access (SDMA) Driver -+ */ -+ -+/*! -+ * @file arch-mxc/sdma.h -+ * -+ * @brief This file contains the SDMA API declarations. -+ * -+ * SDMA is responsible on moving data between peripherals and memories (MCU, EMI and DSP). -+ * -+ * @ingroup SDMA -+ */ -+ -+#include -+#include -+#include -+#include -+ -+/*! -+ * This defines maximum DMA address -+ */ -+#define MAX_DMA_ADDRESS 0xffffffff -+ -+/*! -+ * This defines maximum number of DMA channels -+ */ -+#ifdef CONFIG_MXC_SDMA_API -+#define MAX_DMA_CHANNELS 32 -+#define MAX_BD_NUMBER 16 -+#define MXC_SDMA_DEFAULT_PRIORITY 1 -+#define MXC_SDMA_MIN_PRIORITY 1 -+#define MXC_SDMA_MAX_PRIORITY 7 -+#else -+#define MAX_DMA_CHANNELS 0 -+#endif -+ -+#define MXC_FIFO_MEM_DEST_FIXED 0x1 -+#define MXC_FIFO_MEM_SRC_FIXED 0x2 -+/*! -+ * This enumerates transfer types -+ */ -+typedef enum { -+ emi_2_per = 0, /*!< EMI memory to peripheral */ -+ emi_2_int, /*!< EMI memory to internal RAM */ -+ emi_2_emi, /*!< EMI memory to EMI memory */ -+ emi_2_dsp, /*!< EMI memory to DSP memory */ -+ per_2_int, /*!< Peripheral to internal RAM */ -+ per_2_emi, /*!< Peripheral to internal EMI memory */ -+ per_2_dsp, /*!< Peripheral to DSP memory */ -+ per_2_per, /*!< Peripheral to Peripheral */ -+ int_2_per, /*!< Internal RAM to peripheral */ -+ int_2_int, /*!< Internal RAM to Internal RAM */ -+ int_2_emi, /*!< Internal RAM to EMI memory */ -+ int_2_dsp, /*!< Internal RAM to DSP memory */ -+ dsp_2_per, /*!< DSP memory to peripheral */ -+ dsp_2_int, /*!< DSP memory to internal RAM */ -+ dsp_2_emi, /*!< DSP memory to EMI memory */ -+ dsp_2_dsp, /*!< DSP memory to DSP memory */ -+ emi_2_dsp_loop, /*!< EMI memory to DSP memory loopback */ -+ dsp_2_emi_loop, /*!< DSP memory to EMI memory loopback */ -+ dvfs_pll, /*!< DVFS script with PLL change */ -+ dvfs_pdr /*!< DVFS script without PLL change */ -+} sdma_transferT; -+ -+/*! -+ * This enumerates peripheral types -+ */ -+typedef enum { -+ SSI, /*!< MCU domain SSI */ -+ SSI_SP, /*!< Shared SSI */ -+ MMC, /*!< MMC */ -+ SDHC, /*!< SDHC */ -+ UART, /*!< MCU domain UART */ -+ UART_SP, /*!< Shared UART */ -+ FIRI, /*!< FIRI */ -+ CSPI, /*!< MCU domain CSPI */ -+ CSPI_SP, /*!< Shared CSPI */ -+ SIM, /*!< SIM */ -+ ATA, /*!< ATA */ -+ CCM, /*!< CCM */ -+ EXT, /*!< External peripheral */ -+ MSHC, /*!< Memory Stick Host Controller */ -+ MSHC_SP, /*!< Shared Memory Stick Host Controller */ -+ DSP, /*!< DSP */ -+ MEMORY, /*!< Memory */ -+ FIFO_MEMORY, /*!< FIFO type Memory */ -+ SPDIF, /*!< SPDIF */ -+ IPU_MEMORY, /*!< IPU Memory */ -+ ASRC, /*!< ASRC */ -+ ESAI, /*!< ESAI */ -+} sdma_periphT; -+ -+#ifndef TRANSFER_32BIT -+/*! -+ * This defines SDMA access data size -+ */ -+#define TRANSFER_32BIT 0x00 -+#define TRANSFER_8BIT 0x01 -+#define TRANSFER_16BIT 0x02 -+#define TRANSFER_24BIT 0x03 -+ -+#endif -+ -+/*! -+ * This defines maximum device name length passed during mxc_request_dma(). -+ */ -+#define MAX_DEVNAME_LENGTH 32 -+ -+/*! -+ * This defines SDMA interrupt callback function prototype. -+ */ -+typedef void (*dma_callback_t) (void *arg); -+ -+/*! -+ * Structure containing sdma channel parameters. -+ */ -+typedef struct { -+ __u32 watermark_level; /*!< Lower/upper threshold that -+ * triggers SDMA event -+ */ -+ __u32 per_address; /*!< Peripheral source/destination -+ * physical address -+ */ -+ sdma_periphT peripheral_type; /*!< Peripheral type */ -+ sdma_transferT transfer_type; /*!< Transfer type */ -+ int event_id; /*!< Event number, -+ * needed by all channels -+ * that started by peripherals dma -+ * request (per_2_*,*_2_per) -+ * Not used for memory and DSP -+ * transfers. -+ */ -+ int event_id2; /*!< Second event number, -+ * used in ATA scripts only. -+ */ -+ int bd_number; /*!< Buffer descriptors number. -+ * If not set, single buffer -+ * descriptor will be used. -+ */ -+ dma_callback_t callback; /*! callback function */ -+ void *arg; /*! callback argument */ -+ unsigned long word_size:8; /*!< SDMA data access word size */ -+} dma_channel_params; -+ -+/*! -+ * Structure containing sdma request parameters. -+ */ -+typedef struct { -+ /*! physical source memory address */ -+ __u8 *sourceAddr; -+ /*! physical destination memory address */ -+ __u8 *destAddr; -+ /*! amount of data to transfer, -+ * updated during mxc_dma_get_config -+ */ -+ __u16 count; -+ /*!< DONE bit of the buffer descriptor, -+ * updated during mxc_dma_get_config -+ * 0 - means the BD is done and closed by SDMA -+ * 1 - means the BD is still being processed by SDMA -+ */ -+ int bd_done; -+ /*!< CONT bit of the buffer descriptor, -+ * set it if full multi-buffer descriptor mechanism -+ * required. -+ */ -+ int bd_cont; -+ /*!< ERROR bit of the buffer descriptor, -+ * updated during mxc_dma_get_config. -+ * If it is set - there was an error during BD processing. -+ */ -+ int bd_error; -+} dma_request_t; -+ -+/*! -+ * Structure containing sdma request parameters. -+ */ -+typedef struct { -+ /*! address of ap_2_ap script */ -+ int mxc_sdma_ap_2_ap_addr; -+ /*! address of ap_2_bp script */ -+ int mxc_sdma_ap_2_bp_addr; -+ /*! address of ap_2_ap_fixed script */ -+ int mxc_sdma_ap_2_ap_fixed_addr; -+ /*! address of bp_2_ap script */ -+ int mxc_sdma_bp_2_ap_addr; -+ /*! address of loopback_on_dsp_side script */ -+ int mxc_sdma_loopback_on_dsp_side_addr; -+ /*! address of mcu_interrupt_only script */ -+ int mxc_sdma_mcu_interrupt_only_addr; -+ -+ /*! address of firi_2_per script */ -+ int mxc_sdma_firi_2_per_addr; -+ /*! address of firi_2_mcu script */ -+ int mxc_sdma_firi_2_mcu_addr; -+ /*! address of per_2_firi script */ -+ int mxc_sdma_per_2_firi_addr; -+ /*! address of mcu_2_firi script */ -+ int mxc_sdma_mcu_2_firi_addr; -+ -+ /*! address of uart_2_per script */ -+ int mxc_sdma_uart_2_per_addr; -+ /*! address of uart_2_mcu script */ -+ int mxc_sdma_uart_2_mcu_addr; -+ /*! address of per_2_app script */ -+ int mxc_sdma_per_2_app_addr; -+ /*! address of mcu_2_app script */ -+ int mxc_sdma_mcu_2_app_addr; -+ /*! address of per_2_per script */ -+ int mxc_sdma_per_2_per_addr; -+ -+ /*! address of uartsh_2_per script */ -+ int mxc_sdma_uartsh_2_per_addr; -+ /*! address of uartsh_2_mcu script */ -+ int mxc_sdma_uartsh_2_mcu_addr; -+ /*! address of per_2_shp script */ -+ int mxc_sdma_per_2_shp_addr; -+ /*! address of mcu_2_shp script */ -+ int mxc_sdma_mcu_2_shp_addr; -+ -+ /*! address of ata_2_mcu script */ -+ int mxc_sdma_ata_2_mcu_addr; -+ /*! address of mcu_2_ata script */ -+ int mxc_sdma_mcu_2_ata_addr; -+ -+ /*! address of app_2_per script */ -+ int mxc_sdma_app_2_per_addr; -+ /*! address of app_2_mcu script */ -+ int mxc_sdma_app_2_mcu_addr; -+ /*! address of shp_2_per script */ -+ int mxc_sdma_shp_2_per_addr; -+ /*! address of shp_2_mcu script */ -+ int mxc_sdma_shp_2_mcu_addr; -+ -+ /*! address of mshc_2_mcu script */ -+ int mxc_sdma_mshc_2_mcu_addr; -+ /*! address of mcu_2_mshc script */ -+ int mxc_sdma_mcu_2_mshc_addr; -+ -+ /*! address of spdif_2_mcu script */ -+ int mxc_sdma_spdif_2_mcu_addr; -+ /*! address of mcu_2_spdif script */ -+ int mxc_sdma_mcu_2_spdif_addr; -+ -+ /*! address of asrc_2_mcu script */ -+ int mxc_sdma_asrc_2_mcu_addr; -+ -+ /*! address of ext_mem_2_ipu script */ -+ int mxc_sdma_ext_mem_2_ipu_addr; -+ -+ /*! address of descrambler script */ -+ int mxc_sdma_descrambler_addr; -+ -+ /*! address of dptc_dvfs script */ -+ int mxc_sdma_dptc_dvfs_addr; -+ -+ int mxc_sdma_utra_addr; -+ -+ /*! address where ram code starts */ -+ int mxc_sdma_ram_code_start_addr; -+ /*! size of the ram code */ -+ int mxc_sdma_ram_code_size; -+ /*! RAM image address */ -+ unsigned short *mxc_sdma_start_addr; -+} sdma_script_start_addrs; -+ -+/*! Structure to store the initialized dma_channel parameters */ -+typedef struct mxc_sdma_channel_params { -+ /*! Channel params */ -+ dma_channel_params chnl_params; -+ /*! Channel type (static channel number or dynamic channel) */ -+ unsigned int channel_num; -+ /*! Channel priority [0x1(lowest) - 0x7(highest)] */ -+ unsigned int chnl_priority; -+} mxc_sdma_channel_params_t; -+ -+/*! Private SDMA data structure */ -+typedef struct mxc_dma_channel_private { -+ /*! ID of the buffer that was processed */ -+ unsigned int buf_tail; -+ /*! Tasklet for the channel */ -+ struct tasklet_struct chnl_tasklet; -+ /*! Flag indicates if interrupt is required after every BD transfer */ -+ int intr_after_every_bd; -+} mxc_dma_channel_private_t; -+ -+/*! -+ * Setup channel according to parameters. -+ * Must be called once after mxc_request_dma() -+ * -+ * @param channel channel number -+ * @param p channel parameters pointer -+ * @return 0 on success, error code on fail -+ */ -+int mxc_dma_setup_channel(int channel, dma_channel_params * p); -+ -+/*! -+ * Setup the channel priority. This can be used to change the default priority -+ * for the channel. -+ * -+ * @param channel channel number -+ * @param priority priority to be set for the channel -+ * -+ * @return 0 on success, error code on failure -+ */ -+int mxc_dma_set_channel_priority(unsigned int channel, unsigned int priority); -+ -+/*! -+ * Allocates dma channel. -+ * If channel's value is 0, then the function allocates a free channel -+ * dynamically and sets its value to channel. -+ * Else allocates requested channel if it is free. -+ * If the channel is busy or no free channels (in dynamic allocation) -EBUSY returned. -+ * -+ * @param channel pointer to channel number -+ * @param devicename device name -+ * @return 0 on success, error code on fail -+ */ -+int mxc_request_dma(int *channel, const char *devicename); -+ -+/*! -+ * Configures request parameters. Can be called multiple times after -+ * mxc_request_dma() and mxc_dma_setup_channel(). -+ * -+ * -+ * @param channel channel number -+ * @param p request parameters pointer -+ * @param bd_index index of buffer descriptor to set -+ * @return 0 on success, error code on fail -+ */ -+/* int mxc_dma_set_config(int channel, dma_request_t *p, int bd_index); */ -+int mxc_dma_set_config(int channel, dma_request_t * p, int bd_index); -+ -+/*! -+ * Returns request parameters. -+ * -+ * @param channel channel number -+ * @param p request parameters pointer -+ * @param bd_index index of buffer descriptor to get -+ * @return 0 on success, error code on fail -+ */ -+/* int mxc_dma_get_config(int channel, dma_request_t *p, int bd_index); */ -+int mxc_dma_get_config(int channel, dma_request_t * p, int bd_index); -+ -+/*! -+ * This function is used by MXC IPC's write_ex2. It passes the a pointer to the -+ * data control structure to iapi_write_ipcv2() -+ * -+ * @param channel SDMA channel number -+ * @param ctrl_ptr Data Control structure pointer -+ */ -+int mxc_sdma_write_ipcv2(int channel, void *ctrl_ptr); -+ -+/*! -+ * This function is used by MXC IPC's read_ex2. It passes the a pointer to the -+ * data control structure to iapi_read_ipcv2() -+ * -+ * @param channel SDMA channel number -+ * @param ctrl_ptr Data Control structure pointer -+ */ -+int mxc_sdma_read_ipcv2(int channel, void *ctrl_ptr); -+ -+/*! -+ * Starts dma channel. -+ * -+ * @param channel channel number -+ */ -+int mxc_dma_start(int channel); -+ -+/*! -+ * Stops dma channel. -+ * -+ * @param channel channel number -+ */ -+int mxc_dma_stop(int channel); -+ -+/*! -+ * Frees dma channel. -+ * -+ * @param channel channel number -+ */ -+void mxc_free_dma(int channel); -+ -+/*! -+ * Sets callback function. Used with standard dma api -+ * for supporting interrupts -+ * -+ * @param channel channel number -+ * @param callback callback function pointer -+ * @param arg argument for callback function -+ */ -+void mxc_dma_set_callback(int channel, dma_callback_t callback, void *arg); -+ -+/*! -+ * Allocates uncachable buffer. Uses hash table. -+ * -+ * @param size size of allocated buffer -+ * @return pointer to buffer -+ */ -+void *sdma_malloc(size_t size); -+ -+#ifdef CONFIG_SDMA_IRAM -+/*! -+ * Allocates uncachable buffer from IRAM.. -+ * -+ * @param size size of allocated buffer -+ * @return pointer to buffer -+ */ -+void *sdma_iram_malloc(size_t size); -+#endif /*CONFIG_SDMA_IRAM */ -+ -+/*! -+ * Frees uncachable buffer. Uses hash table. -+ */ -+void sdma_free(void *buf); -+ -+/*! -+ * Converts virtual to physical address. Uses hash table. -+ * -+ * @param buf virtual address pointer -+ * @return physical address value -+ */ -+unsigned long sdma_virt_to_phys(void *buf); -+ -+/*! -+ * Converts physical to virtual address. Uses hash table. -+ * -+ * @param buf physical address value -+ * @return virtual address pointer -+ */ -+void *sdma_phys_to_virt(unsigned long buf); -+ -+/*! -+ * Configures the BD_INTR bit on a buffer descriptor parameters. -+ * -+ * -+ * @param channel channel number -+ * @param bd_index index of buffer descriptor to set -+ * @param bd_intr flag to set or clear the BD_INTR bit -+ */ -+void mxc_dma_set_bd_intr(int channel, int bd_index, int bd_intr); -+ -+/*! -+ * Gets the BD_INTR bit on a buffer descriptor. -+ * -+ * -+ * @param channel channel number -+ * @param bd_index index of buffer descriptor to set -+ * -+ * @return returns the BD_INTR bit status -+ */ -+int mxc_dma_get_bd_intr(int channel, int bd_index); -+ -+/*! -+ * Stop the current transfer -+ * -+ * @param channel channel number -+ * @param buffer_number number of buffers (beginning with 0), -+ * whose done bits should be reset to 0 -+ */ -+int mxc_dma_reset(int channel, int buffer_number); -+ -+/*! -+ * This functions Returns the SDMA paramaters associated for a module -+ * -+ * @param channel_id the ID of the module requesting DMA -+ * @return returns the sdma parameters structure for the device -+ */ -+mxc_sdma_channel_params_t *mxc_sdma_get_channel_params(mxc_dma_device_t -+ channel_id); -+ -+/*! -+ * This functions marks the SDMA channels that are statically allocated -+ * -+ * @param chnl the channel array used to store channel information -+ */ -+void mxc_get_static_channels(mxc_dma_channel_t * chnl); -+ -+/*! -+ * Initializes SDMA driver -+ */ -+int __init sdma_init(void); -+ -+#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 -@@ -0,0 +1,66 @@ -+ -+/* -+ * Copyright 2004-2008 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 -+ */ -+ -+/*! -+ * @defgroup SPBA Shared Peripheral Bus Arbiter (SPBA) -+ * @ingroup MSL_MX31 MSL_MX35 MSL_MX37 MSL_MX51 MSL_MXC91321 -+ */ -+ -+/*! -+ * @file arch-mxc/spba.h -+ * @brief This file contains the Shared Peripheral Bus Arbiter (spba) API. -+ * -+ * @ingroup SPBA -+ */ -+ -+#ifndef __ASM_ARCH_MXC_SPBA_H__ -+#define __ASM_ARCH_MXC_SPBA_H__ -+ -+#ifdef __KERNEL__ -+ -+#define MXC_SPBA_RAR_MASK 0x7 -+ -+/*! -+ * Defines three SPBA masters: A - ARM, C - SDMA (no master B for MX31) -+ */ -+enum spba_masters { -+ SPBA_MASTER_A = 1, -+ SPBA_MASTER_B = 2, -+ SPBA_MASTER_C = 4, -+}; -+ -+/*! -+ * This function allows the three masters (A, B, C) to take ownership of a -+ * shared peripheral. -+ * -+ * @param mod specified module as defined in \b enum \b #spba_module -+ * @param master one of more (or-ed together) masters as defined in \b enum \b #spba_masters -+ * -+ * @return 0 if successful; -1 otherwise. -+ */ -+int spba_take_ownership(int mod, int master); -+ -+/*! -+ * This function releases the ownership for a shared peripheral. -+ * -+ * @param mod specified module as defined in \b enum \b #spba_module -+ * @param master one of more (or-ed together) masters as defined in \b enum \b #spba_masters -+ * -+ * @return 0 if successful; -1 otherwise. -+ */ -+int spba_rel_ownership(int mod, int master); -+ -+#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 -@@ -23,7 +23,11 @@ - #if defined CONFIG_ARCH_MX1 - #define CLOCK_TICK_RATE 16000000 - #elif defined CONFIG_ARCH_MX2 -+#ifndef CONFIG_MACH_MX25 - #define CLOCK_TICK_RATE 13300000 -+#else -+#define CLOCK_TICK_RATE 12000000 -+#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 -@@ -74,11 +74,12 @@ void mxc_gpio_mode(int gpio_mode) - __raw_writel(tmp, VA_GPIO_BASE + MXC_GIUS(port)); - - if (pin < 16) { -+#ifndef CONFIG_MACH_MX25 - tmp = __raw_readl(VA_GPIO_BASE + MXC_OCR1(port)); - tmp &= ~(3 << (pin * 2)); - tmp |= (ocr << (pin * 2)); - __raw_writel(tmp, VA_GPIO_BASE + MXC_OCR1(port)); -- -+#endif - tmp = __raw_readl(VA_GPIO_BASE + MXC_ICONFA1(port)); - tmp &= ~(3 << (pin * 2)); - tmp |= ((gpio_mode >> GPIO_AOUT_SHIFT) & 3) << (pin * 2); -@@ -90,12 +91,12 @@ void mxc_gpio_mode(int gpio_mode) - __raw_writel(tmp, VA_GPIO_BASE + MXC_ICONFB1(port)); - } else { - pin -= 16; -- -+#ifndef CONFIG_MACH_MX25 - tmp = __raw_readl(VA_GPIO_BASE + MXC_OCR2(port)); - tmp &= ~(3 << (pin * 2)); - tmp |= (ocr << (pin * 2)); - __raw_writel(tmp, VA_GPIO_BASE + MXC_OCR2(port)); -- -+#endif - 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 -@@ -31,7 +31,24 @@ - - #define IOMUX_BASE IO_ADDRESS(IOMUXC_BASE_ADDR) - --static unsigned long iomux_v3_pad_alloc_map[0x200 / BITS_PER_LONG]; -+#ifdef CONFIG_MACH_MX25 -+#define NUM_PADS 0x228 -+#else -+#define NUM_PADS 0x200 -+#endif -+ -+static unsigned long iomux_v3_pad_alloc_map[NUM_PADS / BITS_PER_LONG]; -+ -+static inline int mxc_iomux_v3_pad_offset(struct pad_desc *pad) -+{ -+ int pad_ofs; -+ if (cpu_is_mx25()) -+ pad_ofs = pad->mux_ctrl_ofs; -+ else -+ pad_ofs = pad->pad_ctrl_ofs; -+ BUG_ON((pad_ofs >> 7) >= ARRAY_SIZE(iomux_v3_pad_alloc_map)); -+ return pad_ofs; -+} - - /* - * setups a single pin: -@@ -40,7 +57,7 @@ static unsigned long iomux_v3_pad_alloc_ - */ - int mxc_iomux_v3_setup_pad(struct pad_desc *pad) - { -- unsigned int pad_ofs = pad->pad_ctrl_ofs; -+ unsigned int pad_ofs = mxc_iomux_v3_pad_offset(pad); - - if (test_and_set_bit(pad_ofs >> 2, iomux_v3_pad_alloc_map)) - return -EBUSY; -@@ -65,8 +82,10 @@ int mxc_iomux_v3_setup_multiple_pads(str - - for (i = 0; i < count; i++) { - ret = mxc_iomux_v3_setup_pad(p); -- if (ret) -+ if (ret) { -+ printk(KERN_ERR "Failed to setup PAD[%d]: %d\n", i, ret); - goto setup_error; -+ } - p++; - } - return 0; -@@ -79,7 +98,7 @@ EXPORT_SYMBOL(mxc_iomux_v3_setup_multipl - - void mxc_iomux_v3_release_pad(struct pad_desc *pad) - { -- unsigned int pad_ofs = pad->pad_ctrl_ofs; -+ unsigned int pad_ofs = mxc_iomux_v3_pad_offset(pad); - - 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 -@@ -55,7 +55,7 @@ int pwm_config(struct pwm_device *pwm, i - if (pwm == NULL || period_ns == 0 || duty_ns > period_ns) - return -EINVAL; - -- if (cpu_is_mx27() || cpu_is_mx3()) { -+ if (cpu_is_mx27() || cpu_is_mx3() || cpu_is_mx25()) { - 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 -@@ -0,0 +1,143 @@ -+/* -+ * Copyright 2004-2008 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 -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+/*! -+ * @file plat-mxc/spba.c -+ * -+ * @brief This file contains the SPBA API implementation details. -+ * -+ * @ingroup SPBA -+ */ -+ -+static DEFINE_SPINLOCK(spba_lock); -+ -+#define SPBA_MASTER_MIN 1 -+#define SPBA_MASTER_MAX 7 -+ -+/*! -+ * the base addresses for the SPBA modules -+ */ -+static unsigned long spba_base = (unsigned long)IO_ADDRESS(SPBA_CTRL_BASE_ADDR); -+ -+/*! -+ * SPBA clock -+ */ -+static struct clk *spba_clk; -+/*! -+ * This function allows the three masters (A, B, C) to take ownership of a -+ * shared peripheral. -+ * -+ * @param mod specified module as defined in \b enum \b #spba_module -+ * @param master one of more (or-ed together) masters as defined in \b enum \b #spba_masters -+ * -+ * @return 0 if successful; a negative errno value otherwise. -+ */ -+int spba_take_ownership(int mod, int master) -+{ -+ unsigned long spba_flags; -+ int rtn_val = -EIO; -+ -+ if (master < SPBA_MASTER_MIN || master > SPBA_MASTER_MAX) { -+ printk("%s() invalid master %d\n", __FUNCTION__, master); -+ return -EINVAL; -+ } -+ -+ if (spba_clk == NULL) { -+ spba_clk = clk_get(NULL, "spba"); -+ if (IS_ERR(spba_clk)) { -+ int ret = PTR_ERR(spba_clk); -+ -+ spba_clk = NULL; -+ return ret; -+ } -+ } -+ clk_enable(spba_clk); -+ -+ spin_lock_irqsave(&spba_lock, spba_flags); -+ __raw_writel(master, spba_base + mod); -+ -+ if ((__raw_readl(spba_base + mod) & MXC_SPBA_RAR_MASK) == master) { -+ rtn_val = 0; -+ } -+ -+ spin_unlock_irqrestore(&spba_lock, spba_flags); -+ -+ clk_disable(spba_clk); -+ return rtn_val; -+} -+ -+/*! -+ * This function releases the ownership for a shared peripheral. -+ * -+ * @param mod specified module as defined in \b enum \b #spba_module -+ * @param master one of more (or-ed together) masters as defined in \b enum \b #spba_masters -+ * -+ * @return 0 if successful; a negativ errno value otherwise. -+ */ -+int spba_rel_ownership(int mod, int master) -+{ -+ unsigned long spba_flags; -+ volatile unsigned long rar; -+ -+ if (master < SPBA_MASTER_MIN || master > SPBA_MASTER_MAX) { -+ printk("%s() invalid master %d\n", __FUNCTION__, master); -+ return -EINVAL; -+ } -+ -+ if (spba_clk == NULL) { -+ spba_clk = clk_get(NULL, "spba"); -+ if (IS_ERR(spba_clk)) { -+ int ret = PTR_ERR(spba_clk); -+ spba_clk = NULL; -+ return ret; -+ } -+ } -+ clk_enable(spba_clk); -+ -+ if ((__raw_readl(spba_base + mod) & master) == 0) { -+ clk_disable(spba_clk); -+ return -EBUSY; /* does not own it */ -+ } -+ -+ spin_lock_irqsave(&spba_lock, spba_flags); -+ -+ /* Since only the last 3 bits are writeable, doesn't need to mask off -+ bits 31-3 */ -+ rar = __raw_readl(spba_base + mod) & (~master); -+ __raw_writel(rar, spba_base + mod); -+ -+ if ((__raw_readl(spba_base + mod) & master) != 0) { -+ spin_unlock_irqrestore(&spba_lock, spba_flags); -+ clk_disable(spba_clk); -+ return -EIO; -+ } -+ spin_unlock_irqrestore(&spba_lock, spba_flags); -+ -+ clk_disable(spba_clk); -+ return 0; -+} -+ -+EXPORT_SYMBOL(spba_take_ownership); -+EXPORT_SYMBOL(spba_rel_ownership); -+ -+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 -@@ -66,7 +66,7 @@ static inline void gpt_irq_disable(void) - { - unsigned int tmp; - -- if (cpu_is_mx3()) -+ if (cpu_is_mx3() || cpu_is_mx25()) - __raw_writel(0, timer_base + MX3_IR); - else { - tmp = __raw_readl(timer_base + MXC_TCTL); -@@ -76,7 +76,7 @@ static inline void gpt_irq_disable(void) - - static inline void gpt_irq_enable(void) - { -- if (cpu_is_mx3()) -+ if (cpu_is_mx3() || cpu_is_mx25()) - __raw_writel(1<<0, timer_base + MX3_IR); - else { - __raw_writel(__raw_readl(timer_base + MXC_TCTL) | MX1_2_TCTL_IRQEN, -@@ -88,9 +88,9 @@ static void gpt_irq_acknowledge(void) - { - if (cpu_is_mx1()) - __raw_writel(0, timer_base + MX1_2_TSTAT); -- if (cpu_is_mx2()) -+ if (cpu_is_mx2() && !cpu_is_mx25()) - __raw_writel(MX2_TSTAT_CAPT | MX2_TSTAT_COMP, timer_base + MX1_2_TSTAT); -- if (cpu_is_mx3()) -+ if (cpu_is_mx3() || cpu_is_mx25()) - __raw_writel(MX3_TSTAT_OF1, timer_base + MX3_TSTAT); - } - -@@ -117,7 +117,7 @@ static int __init mxc_clocksource_init(s - { - unsigned int c = clk_get_rate(timer_clk); - -- if (cpu_is_mx3()) -+ if (cpu_is_mx3() || cpu_is_mx25()) - clocksource_mxc.read = mx3_get_cycles; - - clocksource_mxc.mult = clocksource_hz2mult(c, -@@ -180,7 +180,7 @@ static void mxc_set_mode(enum clock_even - - if (mode != clockevent_mode) { - /* Set event time into far-far future */ -- if (cpu_is_mx3()) -+ if (cpu_is_mx3() || cpu_is_mx25()) - __raw_writel(__raw_readl(timer_base + MX3_TCN) - 3, - timer_base + MX3_TCMP); - else -@@ -233,7 +233,7 @@ static irqreturn_t mxc_timer_interrupt(i - struct clock_event_device *evt = &clockevent_mxc; - uint32_t tstat; - -- if (cpu_is_mx3()) -+ if (cpu_is_mx3() || cpu_is_mx25()) - tstat = __raw_readl(timer_base + MX3_TSTAT); - else - tstat = __raw_readl(timer_base + MX1_2_TSTAT); -@@ -264,7 +264,7 @@ static int __init mxc_clockevent_init(st - { - unsigned int c = clk_get_rate(timer_clk); - -- if (cpu_is_mx3()) -+ if (cpu_is_mx3() || cpu_is_mx25()) - 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 - __raw_writel(0, timer_base + MXC_TCTL); - __raw_writel(0, timer_base + MXC_TPRER); /* see datasheet note */ - -- if (cpu_is_mx3()) -+ if (cpu_is_mx3() || cpu_is_mx25()) - 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 -@@ -12,7 +12,7 @@ - # - # http://www.arm.linux.org.uk/developer/machines/?action=new - # --# Last update: Mon Mar 23 20:09:01 2009 -+# Last update: Mon Apr 20 10:31:38 2009 - # - # machine_is_xxx CONFIG_xxxx MACH_TYPE_xxx number - # -@@ -1721,7 +1721,7 @@ sapphire MACH_SAPPHIRE SAPPHIRE 1729 - csb637xo MACH_CSB637XO CSB637XO 1730 - evisiong MACH_EVISIONG EVISIONG 1731 - stmp37xx MACH_STMP37XX STMP37XX 1732 --stmp378x MACH_STMP38XX STMP38XX 1733 -+stmp378x MACH_STMP378X STMP378X 1733 - tnt MACH_TNT TNT 1734 - tbxt MACH_TBXT TBXT 1735 - playmate MACH_PLAYMATE PLAYMATE 1736 -@@ -2132,3 +2132,41 @@ apollo MACH_APOLLO APOLLO 2141 - at91cap9stk MACH_AT91CAP9STK AT91CAP9STK 2142 - spc300 MACH_SPC300 SPC300 2143 - eko MACH_EKO EKO 2144 -+ccw9m2443 MACH_CCW9M2443 CCW9M2443 2145 -+ccw9m2443js MACH_CCW9M2443JS CCW9M2443JS 2146 -+m2m_router_device MACH_M2M_ROUTER_DEVICE M2M_ROUTER_DEVICE 2147 -+str9104nas MACH_STAR9104NAS STAR9104NAS 2148 -+pca100 MACH_PCA100 PCA100 2149 -+z3_dm365_mod_01 MACH_Z3_DM365_MOD_01 Z3_DM365_MOD_01 2150 -+hipox MACH_HIPOX HIPOX 2151 -+omap3_piteds MACH_OMAP3_PITEDS OMAP3_PITEDS 2152 -+bm150r MACH_BM150R BM150R 2153 -+tbone MACH_TBONE TBONE 2154 -+merlin MACH_MERLIN MERLIN 2155 -+falcon MACH_FALCON FALCON 2156 -+davinci_da850_evm MACH_DAVINCI_DA850_EVM DAVINCI_DA850_EVM 2157 -+s5p6440 MACH_S5P6440 S5P6440 2158 -+at91sam9g10ek MACH_AT91SAM9G10EK AT91SAM9G10EK 2159 -+omap_4430sdp MACH_OMAP_4430SDP OMAP_4430SDP 2160 -+lpc313x MACH_LPC313X LPC313X 2161 -+magx_zn5 MACH_MAGX_ZN5 MAGX_ZN5 2162 -+magx_em30 MACH_MAGX_EM30 MAGX_EM30 2163 -+magx_ve66 MACH_MAGX_VE66 MAGX_VE66 2164 -+meesc MACH_MEESC MEESC 2165 -+otc570 MACH_OTC570 OTC570 2166 -+bcu2412 MACH_BCU2412 BCU2412 2167 -+beacon MACH_BEACON BEACON 2168 -+actia_tgw MACH_ACTIA_TGW ACTIA_TGW 2169 -+e4430 MACH_E4430 E4430 2170 -+ql300 MACH_QL300 QL300 2171 -+btmavb101 MACH_BTMAVB101 BTMAVB101 2172 -+btmawb101 MACH_BTMAWB101 BTMAWB101 2173 -+sq201 MACH_SQ201 SQ201 2174 -+quatro45xx MACH_QUATRO45XX QUATRO45XX 2175 -+openpad MACH_OPENPAD OPENPAD 2176 -+tx25 MACH_TX25 TX25 2177 -+omap3_torpedo MACH_OMAP3_TORPEDO OMAP3_TORPEDO 2178 -+htcraphael_k MACH_HTCRAPHAEL_K HTCRAPHAEL_K 2179 -+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 -@@ -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", - template->gpio, template->name); -- return 0; -+ return -EINVAL; - } - - 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 -@@ -420,6 +420,27 @@ config MTD_NAND_MXC - This enables the driver for the NAND flash controller on the - MXC processors. - -+config MTD_NAND_MXC_FLASH_BBT -+ bool "Support a flash based bad block table" -+ depends on MTD_NAND_MXC -+ -+config ARCH_MXC_HAS_NFC_V1 -+ bool -+ -+config ARCH_MXC_HAS_NFC_V1_1 -+ select ARCH_MXC_HAS_NFC_V1 -+ bool -+ -+config ARCH_MXC_HAS_NFC_V2 -+ bool -+ -+config ARCH_MXC_HAS_NFC_V2_1 -+ bool -+ select ARCH_MXC_HAS_NFC_V2 -+ -+config ARCH_MXC_HAS_NFC_V3 -+ bool -+ - 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 -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 - #include - -+#ifdef CONFIG_MTD_DEBUG -+static int debug = 3; -+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(l, fmt...) DBG(l, fmt) -+#else -+static int debug; -+module_param(debug, int, 0); -+ -+#define dbg_lvl(n) 0 -+#define DBG(lvl, fmt...) do { } while (0) -+#endif -+ -+ - #define DRIVER_NAME "mxc_nand" - - /* Addresses for NFC registers */ --#define NFC_BUF_SIZE 0xE00 --#define NFC_BUF_ADDR 0xE04 --#define NFC_FLASH_ADDR 0xE06 --#define NFC_FLASH_CMD 0xE08 --#define NFC_CONFIG 0xE0A --#define NFC_ECC_STATUS_RESULT 0xE0C --#define NFC_RSLTMAIN_AREA 0xE0E --#define NFC_RSLTSPARE_AREA 0xE10 --#define NFC_WRPROT 0xE12 --#define NFC_UNLOCKSTART_BLKADDR 0xE14 --#define NFC_UNLOCKEND_BLKADDR 0xE16 --#define NFC_NF_WRPRST 0xE18 --#define NFC_CONFIG1 0xE1A --#define NFC_CONFIG2 0xE1C -+#define NFC_BUF_SIZE 0x000 -+#define NFC_BUF_ADDR 0x004 -+#define NFC_FLASH_ADDR 0x006 -+#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_UNLOCKSTART_BLKADDR 0x014 -+#define NFC_UNLOCKEND_BLKADDR 0x016 -+#endif -+#define NFC_NF_WRPRST 0x018 -+#define NFC_CONFIG1 0x01A -+#define NFC_CONFIG2 0x01C -+#ifdef CONFIG_ARCH_MXC_HAS_NFC_V1_1 -+#define NFC_UNLOCKSTART_BLKADDR 0x020 -+#define NFC_UNLOCKEND_BLKADDR 0x022 -+#define NFC_UNLOCKSTART_BLKADDR1 0x024 -+#define NFC_UNLOCKEND_BLKADDR1 0x026 -+#define NFC_UNLOCKSTART_BLKADDR2 0x028 -+#define NFC_UNLOCKEND_BLKADDR2 0x02a -+#define NFC_UNLOCKSTART_BLKADDR3 0x02c -+#define NFC_UNLOCKEND_BLKADDR3 0x02e -+#endif - - /* Addresses for NFC RAM BUFFER Main area 0 */ - #define MAIN_AREA0 0x000 -@@ -59,10 +88,27 @@ - #define MAIN_AREA3 0x600 - - /* Addresses for NFC SPARE BUFFER Spare area 0 */ -+#ifndef CONFIG_ARCH_MXC_HAS_NFC_V1_1 -+#define SPARE_AREA_SIZE 16 - #define SPARE_AREA0 0x800 - #define SPARE_AREA1 0x810 - #define SPARE_AREA2 0x820 - #define SPARE_AREA3 0x830 -+#else -+#define SPARE_AREA_SIZE 64 -+#define MAIN_AREA4 0x800 -+#define MAIN_AREA5 0xa00 -+#define MAIN_AREA6 0xc00 -+#define MAIN_AREA7 0xe00 -+#define SPARE_AREA0 0x1000 -+#define SPARE_AREA1 0x1040 -+#define SPARE_AREA2 0x1080 -+#define SPARE_AREA3 0x10c0 -+#define SPARE_AREA4 0x1100 -+#define SPARE_AREA5 0x1140 -+#define SPARE_AREA6 0x1180 -+#define SPARE_AREA7 0x11c0 -+#endif - - /* 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 { - struct device *dev; - - void __iomem *regs; -+ void __iomem *nfc_buf; - 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 - -+#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}} -+}; -+ - static struct nand_ecclayout nand_hw_eccoob_8 = { - .eccbytes = 5, - .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}} -+}; -+ -+#ifdef CONFIG_MTD_NAND_MXC_FLASH_BBT -+static u8 bbt_pattern[] = {'B', 'b', 't', '0' }; -+static u8 mirror_pattern[] = {'1', 't', 'b', 'B' }; -+ -+static struct nand_bbt_descr bbt_main_descr = { -+ .options = (NAND_BBT_LASTBLOCK | NAND_BBT_WRITE | -+ NAND_BBT_2BIT | NAND_BBT_VERSION | NAND_BBT_PERCHIP), -+ .offs = 12, -+ .len = 4, -+ .veroffs = 11, -+ .maxblocks = 4, -+ .pattern = bbt_pattern, -+}; -+ -+static struct nand_bbt_descr bbt_mirror_descr = { -+ .options = (NAND_BBT_LASTBLOCK | NAND_BBT_WRITE | -+ NAND_BBT_2BIT | NAND_BBT_VERSION | NAND_BBT_PERCHIP), -+ .offs = 12, -+ .len = 4, -+ .veroffs = 11, -+ .maxblocks = 4, -+ .pattern = mirror_pattern, -+}; -+#endif -+#else -+/* -+ * 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}}, -+}; -+ -+static struct nand_ecclayout nand_hw_eccoob_8 = { -+ .eccbytes = 9, -+ .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 -+*/ -+static u8 bbt_pattern[] = { 'B', 'b', 't', '0' }; -+static u8 mirror_pattern[] = { '1', 't', 'b', 'B' }; -+ -+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 -+}; -+ -+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 -+}; -+#endif -+#endif -+ - #ifdef CONFIG_MTD_PARTITIONS - static const char *part_probes[] = { "RedBoot", "cmdlinepart", NULL }; - #endif - -+#ifdef CONFIG_MTD_DEBUG -+#define nfc_read_reg(b, r) __nfc_read_reg(b, r, #r, __FUNCTION__) -+static inline u16 __nfc_read_reg(void __iomem *base, unsigned int reg, -+ const char *name, const char *fn) -+{ -+ u16 val = readw(base + reg); -+ DBG(3, "%s: Read %04x from %s[%02x]\n", fn, val, name, reg); -+ return val; -+} -+ -+#define nfc_write_reg(v, b, r) __nfc_write_reg(v, b, r, #r, __FUNCTION__) -+static inline void __nfc_write_reg(u16 val, void __iomem *base, unsigned int reg, -+ const char *name, const char *fn) -+{ -+ DBG(3, "%s: Writing %04x to %s[%02x]\n", fn, val, name, reg); -+ writew(val, base + reg); -+} -+#else -+#define nfc_read_reg(b, r) readw(b + r) -+#define nfc_write_reg(v, b, r) writew(v, b + r) -+#endif -+ - 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); -+ -+ tmp = nfc_read_reg(host->regs, NFC_CONFIG1); - tmp |= NFC_INT_MSK; /* Disable interrupt */ -- writew(tmp, host->regs + NFC_CONFIG1); -+ nfc_write_reg(tmp, host->regs, NFC_CONFIG1); - - wake_up(&host->irq_waitq); - -@@ -166,36 +330,31 @@ 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) { -- -- tmp = readw(host->regs + NFC_CONFIG1); -- tmp &= ~NFC_INT_MSK; /* Enable interrupt */ -- writew(tmp, host->regs + NFC_CONFIG1); -- -- wait_event(host->irq_waitq, -- readw(host->regs + NFC_CONFIG2) & NFC_INT); -- -- tmp = readw(host->regs + NFC_CONFIG2); -- tmp &= ~NFC_INT; -- writew(tmp, host->regs + NFC_CONFIG2); -+ if (!(nfc_stat & NFC_INT)) { -+ uint32_t cfg1; -+ const unsigned long timeout = 10; -+ -+ 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); - } - } else { -- while (max_retries-- > 0) { -- if (readw(host->regs + NFC_CONFIG2) & NFC_INT) { -- tmp = readw(host->regs + NFC_CONFIG2); -- tmp &= ~NFC_INT; -- writew(tmp, host->regs + NFC_CONFIG2); -- break; -- } -+ while (!(nfc_stat & NFC_INT) && max_retries-- > 0) { -+ nfc_stat = nfc_read_reg(host->regs, NFC_CONFIG2); - udelay(1); - } -- if (max_retries <= 0) -- DEBUG(MTD_DEBUG_LEVEL0, "%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 - { - 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); -+ 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 - { - 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); -+ 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); - - /* NANDFC buffer 0 is used for page read/write */ -- writew(buf_id, host->regs + NFC_BUF_ADDR); -+ nfc_write_reg(buf_id, host->regs, NFC_BUF_ADDR); - - /* Configure spare or page+spare access */ - if (!host->pagesize_2k) { -- uint16_t config1 = readw(host->regs + NFC_CONFIG1); -+ uint16_t config1 = nfc_read_reg(host->regs, NFC_CONFIG1); - if (spare_only) - config1 |= NFC_SP_EN; - else - config1 &= ~(NFC_SP_EN); -- writew(config1, host->regs + NFC_CONFIG1); -+ nfc_write_reg(config1, host->regs, NFC_CONFIG1); - } - -- writew(NFC_INPUT, 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 - DEBUG(MTD_DEBUG_LEVEL3, "send_read_page (%d)\n", spare_only); - - /* NANDFC buffer 0 is used for page read/write */ -- writew(buf_id, host->regs + NFC_BUF_ADDR); -+ nfc_write_reg(buf_id, host->regs, NFC_BUF_ADDR); - - /* Configure spare or page+spare access */ - if (!host->pagesize_2k) { -- uint32_t config1 = readw(host->regs + NFC_CONFIG1); -+ uint32_t config1 = nfc_read_reg(host->regs, NFC_CONFIG1); - if (spare_only) - config1 |= NFC_SP_EN; - else - config1 &= ~NFC_SP_EN; -- writew(config1, host->regs + NFC_CONFIG1); -+ nfc_write_reg(config1, host->regs, NFC_CONFIG1); - } - -- writew(NFC_OUTPUT, 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 - 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 */ -- tmp = readw(host->regs + NFC_CONFIG1); -+ tmp = nfc_read_reg(host->regs, NFC_CONFIG1); - tmp &= ~NFC_SP_EN; -- writew(tmp, host->regs + NFC_CONFIG1); -+ nfc_write_reg(tmp, host->regs, NFC_CONFIG1); - -- writew(NFC_ID, host->regs + NFC_CONFIG2); -+ nfc_write_reg(NFC_ID, host->regs, NFC_CONFIG2); - - /* Wait for operation to complete */ - wait_op_done(host, TROP_US_DELAY, 0, true); - - if (this->options & NAND_BUSWIDTH_16) { -- void __iomem *main_buf = host->regs + MAIN_AREA0; -+ 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 - * 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; - uint32_t store; - uint16_t ret, tmp; - /* 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 - * corruption of read/write buffer on status requests. */ -- writew(1, host->regs + NFC_BUF_ADDR); -+ nfc_write_reg(0, host->regs, NFC_BUF_ADDR); - - /* Read status into main buffer */ -- tmp = readw(host->regs + NFC_CONFIG1); -+ tmp = nfc_read_reg(host->regs, NFC_CONFIG1); - tmp &= ~NFC_SP_EN; -- writew(tmp, host->regs + NFC_CONFIG1); -+ nfc_write_reg(tmp, host->regs, NFC_CONFIG1); - -- writew(NFC_STATUS, host->regs + NFC_CONFIG2); -+ nfc_write_reg(NFC_STATUS, host->regs, NFC_CONFIG2); - - /* Wait for operation to complete */ - wait_op_done(host, TROP_US_DELAY, 0, true); - - /* Status is placed in first word of main buffer */ -- /* get status, then recovery area 1 data */ -+ /* get status, then recover area 0 data */ - ret = readw(main_buf); - writel(store, main_buf); - -@@ -369,7 +528,7 @@ static int mxc_nand_correct_data(struct - * 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, -@@ -392,8 +551,8 @@ 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; -- uint16_t __iomem *main_buf = host->regs + MAIN_AREA0; -- 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; - - /* Check for status request */ - if (host->status_request) -@@ -436,9 +595,9 @@ static uint16_t mxc_nand_read_word(struc - col += mtd->writesize; - - if (col < mtd->writesize) -- p = (host->regs + MAIN_AREA0) + (col >> 1); -+ p = (host->nfc_buf + MAIN_AREA0) + (col >> 1); - else -- p = (host->regs + SPARE_AREA0) + ((col - mtd->writesize) >> 1); -+ 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; - 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 - /* 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 -+ 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); - - while (n) { - void __iomem *p; -+ int si = (col - mtd->writesize) / 16; - - if (col < mtd->writesize) -- p = host->regs + MAIN_AREA0 + (col & ~3); -+ p = host->nfc_buf + MAIN_AREA0 + (col & ~3); - else -- p = host->regs + SPARE_AREA0 - -- mtd->writesize + (col & ~3); -+ p = host->nfc_buf + SPARE_AREA0 + -+ si * SPARE_AREA_SIZE + -+ (col - mtd->writesize) % ss; - - 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); - - 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; - 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); - - 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); -+ } - - /* 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 -+ /* 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; - - if (col < mtd->writesize) -- p = host->regs + MAIN_AREA0 + (col & ~3); -+ p = host->nfc_buf + MAIN_AREA0 + (col & ~3); - else -- 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); -+ } - - 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; - } - } -+ 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 - } - - 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); - 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); - #endif - - switch (chip) { -@@ -831,6 +1028,7 @@ static void mxc_nand_command(struct mtd_ - break; - - case NAND_CMD_READID: -+ host->col_addr = 0; - send_read_id(host); - break; - -@@ -851,9 +1049,12 @@ 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; -- struct resource *res; -+ struct resource *res1, *res2; - 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 - mtd->owner = THIS_MODULE; - mtd->dev.parent = &pdev->dev; - -- /* 50 us command delay time */ -- this->chip_delay = 5; -- - 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 - this->write_buf = mxc_nand_write_buf; - this->read_buf = mxc_nand_read_buf; - this->verify_buf = mxc_nand_verify_buf; -+#ifdef CONFIG_MTD_NAND_MXC_FLASH_BBT -+ this->bbt_td = &bbt_main_descr; -+ this->bbt_md = &bbt_mirror_descr; -+ this->options |= NAND_USE_FLASH_BBT; -+#endif - -- host->clk = clk_get(&pdev->dev, "nfc"); -- if (IS_ERR(host->clk)) -+ host->clk = clk_get(&pdev->dev, "nfc_clk"); -+ if (IS_ERR(host->clk)) { -+ 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; - -- res = platform_get_resource(pdev, IORESOURCE_MEM, 0); -- if (!res) { -+ res1 = platform_get_resource(pdev, IORESOURCE_MEM, 0); -+ if (!res1) { - err = -ENODEV; - goto eres; - } -+ if (!request_mem_region(res1->start, resource_size(res1), "mxc_nand")) { -+ 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; -+ } -+ } -+ -+ host->regs = ioremap(res1->start, resource_size(res1)); - if (!host->regs) { -- err = -EIO; -- goto eres; -+ err = -ENOMEM; -+ goto eunmap1; - } - -- 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) { -+ 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); - - 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); - 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; -- tmp = readw(host->regs + NFC_CONFIG1); -+ tmp = nfc_read_reg(host->regs, NFC_CONFIG1); - 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; -- tmp = readw(host->regs + NFC_CONFIG1); -+ tmp = nfc_read_reg(host->regs, NFC_CONFIG1); - 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); - - /* preset operation */ - /* Unlock the internal RAM Buffer */ -- writew(0x2, host->regs + NFC_CONFIG); -+ nfc_write_reg(0x2, host->regs, NFC_CONFIG); - - /* Blocks to be unlocked */ -- writew(0x0, host->regs + NFC_UNLOCKSTART_BLKADDR); -- writew(0x4000, host->regs + NFC_UNLOCKEND_BLKADDR); -+ nfc_write_reg(0x0, host->regs, NFC_UNLOCKSTART_BLKADDR); -+ nfc_write_reg(0x4000, host->regs, NFC_UNLOCKEND_BLKADDR); - - /* Unlock Block Command for given address range */ -- writew(0x4, host->regs + NFC_WRPROT); -+ nfc_write_reg(0x4, host->regs, NFC_WRPROT); - - /* NAND bus width determines access funtions used by upper layer */ - if (pdata->width == 2) { - this->options |= NAND_BUSWIDTH_16; -- this->ecc.layout = &nand_hw_eccoob_16; - } - -- host->pagesize_2k = 0; -- - /* Scan to find existence of the device */ -- if (nand_scan(mtd, 1)) { -+ err = nand_scan_ident(mtd, 1); -+ if (err) { - DEBUG(MTD_DEBUG_LEVEL0, - "MXC_ND: Unable to find any NAND device.\n"); -- err = -ENXIO; -+ goto escan; -+ } -+ /* this is required before completing the scan */ -+ host->pagesize_2k = (mtd->writesize == 2048); -+ -+ if (pdata->width == 2) { -+ if (host->pagesize_2k) { -+ this->ecc.layout = &nand_hw_eccoob2k_16; -+ } else { -+ this->ecc.layout = &nand_hw_eccoob_16; -+ } -+ } 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; -+ nfc_write_reg(tmp, host->regs, NFC_CONFIG1); -+ } -+ -+ err = nand_scan_tail(mtd); -+ if (err) { - goto escan; - } - -+ 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 - return 0; - - escan: -- free_irq(host->irq, NULL); -+ free_irq(host->irq, host); - eirq: -+ if (host->regs != host->nfc_buf) -+ iounmap(host->nfc_buf); -+eunmap2: - iounmap(host->regs); -+eunmap1: -+ release_mem_region(res2->start, resource_size(res2)); -+ereq2: -+ release_mem_region(res1->start, resource_size(res1)); -+ereq1: - eres: -+ clk_disable(host->clk); - clk_put(host->clk); - eclk: - kfree(host); -@@ -995,46 +1274,63 @@ eclk: - static int __devexit mxcnd_remove(struct platform_device *pdev) - { - struct mxc_nand_host *host = platform_get_drvdata(pdev); -+ struct resource *res; - -+ if (host->clk_act) -+ clk_disable(host->clk); - clk_put(host->clk); - -- platform_set_drvdata(pdev, NULL); -- - nand_release(&host->mtd); -- free_irq(host->irq, NULL); -+ free_irq(host->irq, host); - iounmap(host->regs); - kfree(host); - -+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0); -+ if (res) { -+ release_mem_region(res->start, resource_size(res)); -+ } -+ res = platform_get_resource(pdev, IORESOURCE_MEM, 1); -+ if (res) { -+ release_mem_region(res->start, resource_size(res)); -+ } - return 0; - } - - #ifdef CONFIG_PM - static int mxcnd_suspend(struct platform_device *pdev, pm_message_t state) - { -- struct mtd_info *info = platform_get_drvdata(pdev); -+ struct mtd_info *mtd = platform_get_drvdata(pdev); -+ struct nand_chip *nand_chip = mtd->priv; -+ struct mxc_nand_host *host = nand_chip->priv; - int ret = 0; - - DEBUG(MTD_DEBUG_LEVEL0, "MXC_ND : NAND suspend\n"); -- if (info) -- ret = info->suspend(info); -+ if (mtd) -+ ret = mtd->suspend(mtd); - -+ if (host->clk_act) { - /* Disable the NFC clock */ -- clk_disable(nfc_clk); /* FIXME */ -+ clk_disable(host->clk); -+ } - - return ret; - } - - static int mxcnd_resume(struct platform_device *pdev) - { -- struct mtd_info *info = platform_get_drvdata(pdev); -+ struct mtd_info *mtd = platform_get_drvdata(pdev); -+ struct nand_chip *nand_chip = mtd->priv; -+ struct mxc_nand_host *host = nand_chip->priv; - int ret = 0; - - DEBUG(MTD_DEBUG_LEVEL0, "MXC_ND : NAND resume\n"); -- /* Enable the NFC clock */ -- clk_enable(nfc_clk); /* FIXME */ - -- if (info) -- info->resume(info); -+ if (host->clk_act) { -+ /* Enable the NFC clock */ -+ clk_enable(host->clk); -+ } -+ if (mtd) -+ mtd->resume(mtd); - - return ret; - } -@@ -1047,7 +1343,7 @@ static int mxcnd_resume(struct platform_ - static struct platform_driver mxcnd_driver = { - .driver = { - .name = DRIVER_NAME, -- }, -+ }, - .remove = __exit_p(mxcnd_remove), - .suspend = mxcnd_suspend, - .resume = mxcnd_resume, -@@ -1055,13 +1351,14 @@ static struct platform_driver mxcnd_driv - - static int __init mxc_nd_init(void) - { -+ int ret; -+ - /* Register the device driver structure. */ -- pr_info("MXC MTD nand Driver\n"); -- if (platform_driver_probe(&mxcnd_driver, mxcnd_probe) != 0) { -+ ret = platform_driver_probe(&mxcnd_driver, mxcnd_probe); -+ if (ret != 0) { - printk(KERN_ERR "Driver register failed for mxcnd_driver\n"); -- return -ENODEV; - } -- return 0; -+ return ret; - } - - 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 @@ -+/* -+ * Copyright 2004-2009 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 -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#ifdef CONFIG_MTD_DEBUG -+static int debug = 0; -+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; -+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" -+ -+ -+/* 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; -+}; -+ -+/* -+ * Define delays in microsec for NAND device operations -+ */ -+#define TROP_US_DELAY 2000 -+ -+#ifdef CONFIG_MTD_NAND_MXC_SWECC -+static int hardware_ecc = 0; -+#else -+static int hardware_ecc = 1; -+#endif -+ -+static u8 num_of_interleave = 1; -+ -+/* -+ * 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 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 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}}, -+}; -+ -+/*! -+ * @defgroup NAND_MTD NAND Flash MTD Driver for MXC processors -+ */ -+ -+/*! -+ * @file mxc_nd2.c -+ * -+ * @brief This file contains the hardware specific layer for NAND Flash on -+ * MXC processor -+ * -+ * @ingroup NAND_MTD -+ */ -+ -+#ifdef CONFIG_MTD_PARTITIONS -+static const char *part_probes[] = { "RedBoot", "cmdlinepart", NULL }; -+#endif -+ -+static irqreturn_t mxc_nfc_irq(int irq, void *dev_id) -+{ -+ 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; -+} -+ -+/* -+ * Functions to transfer data to/from spare erea. -+ */ -+static void -+copy_spare(struct mtd_info *mtd, void *pbuf, void *pspare, int len, bool bfrom) -+{ -+ 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); -+ -+ /* the last section */ -+ memcpy(&s[i * t], &d[i * j], len - i * j); -+ } -+} -+ -+/*! -+ * 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) -+{ -+ 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); -+ } -+ } -+ 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]); -+ } -+ } -+ 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); -+ } -+} -+ -+static inline void send_atomic_cmd(struct mxc_mtd_s *mxc_nand_data, u16 cmd, bool useirq) -+{ -+ /* 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); -+} -+ -+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); -+ -+#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) -+{ -+ 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; -+ -+ 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++); -+ -+ /* data transfer */ -+ memcpy(mxc_nand_data->main_buf, dbuf, dlen); -+ copy_spare(mtd, obuf, mxc_nand_data->spare_buf, olen, false); -+ -+ /* update the value */ -+ dbuf += dlen; -+ obuf += olen; -+ -+ NFC_SET_RBA(0); -+ ACK_OPS; -+ nfc_write_reg(mxc_nand_data, NFC_AUTO_PROG, REG_NFC_OPS); -+ -+ /* wait auto_prog_done bit set */ -+ while (!(raw_read(REG_NFC_OPS_STAT) & NFC_OP_DONE)) ; -+ } -+ -+ 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; -+ } -+ break; -+ case NAND_CMD_ERASE2: -+ for (i = 0; i < j; i++) { -+ if (!i) { -+ page_addr = addr_low; -+ page_addr *= (j > 1 ? j : this->numchips); -+ } -+ 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); -+ } -+ 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); -+ break; -+ case NAND_CMD_SEQIN: -+ case NAND_CMD_ERASE1: -+ nfc_write_reg(mxc_nand_data, cmd, REG_NFC_FLASH_CMD); -+ 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); -+ break; -+ case NAND_CMD_READID: -+ send_atomic_cmd(mxc_nand_data, cmd, useirq); -+ send_addr(mxc_nand_data, 0, false); -+ break; -+ case NAND_CMD_RESET: -+ auto_cmd_interleave(mtd, cmd); -+ case NAND_CMD_STATUS: -+ break; -+ } -+#else -+ send_atomic_cmd(mxc_nand_data, cmd, useirq); -+#endif -+} -+ -+/*! -+ * 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) -+{ -+ DEBUG(MTD_DEBUG_LEVEL3, "send_addr(0x%x %d)\n", addr, useirq); -+ -+ /* fill address */ -+ nfc_write_reg(mxc_nand_data, (addr << NFC_FLASH_ADDR_SHIFT), -+ REG_NFC_FLASH_ADDR); -+ -+ /* clear status */ -+ ACK_OPS; -+ -+ /* send out address */ -+ nfc_write_reg(mxc_nand_data, NFC_ADDR, REG_NFC_OPS); -+ -+ /* Wait for operation to complete */ -+ wait_op_done(mxc_nand_data, TROP_US_DELAY, useirq); -+} -+ -+/*! -+ * 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__); -+ -+ /* set ram buffer id */ -+ NFC_SET_RBA(buf_id); -+ -+ /* clear status */ -+ ACK_OPS; -+ -+ /* transfer data from NFC ram to nand */ -+ nfc_write_reg(mxc_nand_data, NFC_INPUT, REG_NFC_OPS); -+ -+ /* Wait for operation to complete */ -+ wait_op_done(mxc_nand_data, TROP_US_DELAY, true); -+#endif -+} -+ -+/*! -+ * 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) -+{ -+#ifndef NFC_AUTO_MODE_ENABLE -+ DEBUG(MTD_DEBUG_LEVEL2, "%s(%d)\n", __FUNCTION__, buf_id); -+ -+ /* set ram buffer id */ -+ NFC_SET_RBA(buf_id); -+ -+ /* clear status */ -+ ACK_OPS; -+ -+ /* transfer data from nand to NFC ram */ -+ nfc_write_reg(mxc_nand_data, NFC_OUTPUT, REG_NFC_OPS); -+ -+ /* Wait for operation to complete */ -+ wait_op_done(mxc_nand_data, TROP_US_DELAY, true); -+#endif -+} -+ -+/*! -+ * 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) -+{ -+ DBG(2, "%s: \n", __FUNCTION__); -+ -+ /* Set RBA bits for BUFFER0 */ -+ NFC_SET_RBA(0); -+ -+ /* clear status */ -+ ACK_OPS; -+ -+ /* Read ID into main buffer */ -+ nfc_write_reg(mxc_nand_data, NFC_ID, REG_NFC_OPS); -+ -+ /* Wait for operation to complete */ -+ wait_op_done(mxc_nand_data, TROP_US_DELAY, true); -+} -+ -+#ifdef NFC_AUTO_MODE_ENABLE -+static inline void read_dev_status(u16 *status) -+{ -+ u32 mask = 0xFF << 16; -+ -+ /* clear status */ -+ ACK_OPS; -+ -+ 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); -+} -+#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) -+{ -+#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; -+ } -+ -+ 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); -+ } -+ } -+ -+ /* Read status into main buffer */ -+ nfc_write_reg(mxc_nand_data, NFC_STATUS, REG_NFC_OPS); -+ -+ /* Wait for operation to complete */ -+ wait_op_done(mxc_nand_data, TROP_US_DELAY, true); -+ -+ 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); -+ } -+ } -+ -+ /* Status is placed in first word of main buffer */ -+ /* get status, then recover area 1 data */ -+ ret = *main_buf; -+ *main_buf = save; -+ -+ return ret; -+#endif -+} -+ -+static void mxc_nand_enable_hwecc(struct mtd_info *mtd, int mode) -+{ -+ struct nand_chip *nand_chip = mtd->priv; -+ struct mxc_mtd_s *mxc_nand_data = nand_chip->priv; -+ -+ nfc_write_reg(mxc_nand_data, -+ (nfc_read_reg(mxc_nand_data, REG_NFC_ECC_EN) | NFC_ECC_EN), -+ REG_NFC_ECC_EN); -+ return; -+} -+ -+/* -+ * 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) -+{ -+ 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; -+} -+ -+/* -+ * 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) -+{ -+ return 0; -+} -+ -+/* -+ * 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) -+{ -+ return 0; -+} -+ -+/*! -+ * 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) -+{ -+ struct nand_chip *nand_chip = mtd->priv; -+ struct mxc_mtd_s *mxc_nand_data = nand_chip->priv; -+ u16 col = mxc_nand_data->col_addr; -+ -+ if (mtd->writesize) { -+ int j = mtd->writesize - col; -+ int n = min((int)mtd->oobsize + j, len); -+ -+ 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); -+ } -+ } else { -+ col -= mtd->writesize; -+ memcpy(buf, &mxc_nand_data->oob_buf[col], len); -+ } -+ -+ /* update */ -+ mxc_nand_data->col_addr += n; -+ } 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); -+ -+ /* update */ -+ mxc_nand_data->col_addr += len; -+ } -+} -+ -+/*! -+ * 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) -+{ -+ 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; -+ } -+ -+ mxc_nand_read_buf(mtd, &ret, 1); -+ return ret; -+} -+ -+/*! -+ * 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) -+{ -+ u16 ret; -+ -+ mxc_nand_read_buf(mtd, (u8 *)&ret, sizeof(u16)); -+ return ret; -+} -+ -+/*! -+ * 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; -+ -+ /* Check for status request */ -+ if (mxc_nand_data->status_req) { -+ return get_dev_status(mxc_nand_data) & 0xFF; -+ } -+ -+ return mxc_nand_read_word(mtd) & 0xFF; -+} -+ -+/*! -+ * 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) -+{ -+ 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; -+ -+ n = min(n, len); -+ -+ 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); -+ } -+ } else { -+ col -= mtd->writesize; -+ memcpy(&mxc_nand_data->oob_buf[col], buf, len); -+ } -+ -+ /* update */ -+ mxc_nand_data->col_addr += n; -+} -+ -+/*! -+ * 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) -+{ -+ 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; -+ -+ for (; len > 0; len--) { -+ if (*p++ != *s++) -+ return -EFAULT; -+ } -+ -+ return 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; -+ } -+ 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); -+ } -+ -+ 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 -+ -+ u32 page_mask = nand_chip->pagemask; -+ -+ 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); -+ } -+ } -+ if (page_addr != -1) { -+ do { -+ send_addr(mxc_nand_data, (page_addr & 0xff), false); -+ page_mask >>= 8; -+ page_addr >>= 8; -+ } while (page_mask != 0); -+ } -+#endif -+} -+ -+/*! -+ * 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) -+{ -+ struct nand_chip *nand_chip = mtd->priv; -+ struct mxc_mtd_s *mxc_nand_data = nand_chip->priv; -+ bool useirq = false; -+ -+ 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; -+ -+ /* -+ * Command pre-processing step -+ */ -+ switch (command) { -+ case NAND_CMD_STATUS: -+ mxc_nand_data->col_addr = 0; -+ mxc_nand_data->status_req = true; -+ break; -+ -+ case NAND_CMD_READ0: -+ mxc_nand_data->col_addr = column; -+ break; -+ -+ case NAND_CMD_READOOB: -+ mxc_nand_data->col_addr = column; -+ command = NAND_CMD_READ0; -+ break; -+ -+ 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); -+ } -+ -+ mxc_nand_data->col_addr = column; -+ break; -+ -+ 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 -+ -+ if (IS_LARGE_PAGE_NAND) -+ PROG_PAGE(mxc_nand_data); -+ else -+ send_prog_page(mxc_nand_data, 0); -+ useirq = true; -+ break; -+ -+ case NAND_CMD_ERASE1: -+ break; -+ case NAND_CMD_ERASE2: -+ useirq = true; -+ -+ break; -+ } -+ -+ /* -+ * Write out the command to the device. -+ */ -+ send_cmd(mtd, command, useirq); -+ -+ mxc_do_addr_cycle(mtd, column, page_addr); -+ -+ /* -+ * 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); -+ } -+ -+#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 -+ -+ break; -+ -+ 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; -+ } -+} -+ -+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 (sndcmd) { -+ chip->cmdfunc(mtd, NAND_CMD_READ0, 0x00, page); -+ sndcmd = 0; -+ } -+ -+ memcpy(chip->oob_poi, mxc_nand_data->oob_buf, mtd->oobsize); -+ -+ return sndcmd; -+} -+ -+static int mxc_nand_read_page(struct mtd_info *mtd, struct nand_chip *chip, -+ u8 *buf) -+{ -+ struct nand_chip *nand_chip = mtd->priv; -+ struct mxc_mtd_s *mxc_nand_data = nand_chip->priv; -+ -+#ifndef NFC_AUTO_MODE_ENABLE -+ if (mxc_check_ecc_status(mtd) < 0) { -+ //printk(KERN_ERR "ECC error in block %u page %u\n",); -+ } -+#endif -+ -+ memcpy(buf, mxc_nand_data->data_buf, mtd->writesize); -+ memcpy(chip->oob_poi, mxc_nand_data->oob_buf, mtd->oobsize); -+ -+ return 0; -+} -+ -+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; -+ -+ memcpy(mxc_nand_data->data_buf, buf, mtd->writesize); -+ memcpy(mxc_nand_data->oob_buf, chip->oob_poi, mtd->oobsize); -+} -+ -+/* 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 }; -+ -+static struct nand_bbt_descr smallpage_memorybased = { -+ .options = NAND_BBT_SCAN2NDPAGE, -+ .offs = 5, -+ .len = 1, -+ .pattern = scan_ff_pattern -+}; -+ -+static struct nand_bbt_descr largepage_memorybased = { -+ .options = 0, -+ .offs = 0, -+ .len = 2, -+ .pattern = scan_ff_pattern -+}; -+ -+/* Generic flash bbt decriptors -+*/ -+static u8 bbt_pattern[] = { 'B', 'b', 't', '0' }; -+static u8 mirror_pattern[] = { '1', 't', 'b', 'B' }; -+ -+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 -+}; -+ -+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 -+}; -+ -+static int mxc_nand_scan_bbt(struct mtd_info *mtd) -+{ -+ struct nand_chip *nand_chip = mtd->priv; -+ struct mxc_mtd_s *mxc_nand_data = nand_chip->priv; -+ -+ 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 { -+ } -+ -+ /* reconfig for interleave mode */ -+#ifdef NFC_AUTO_MODE_ENABLE -+ if (nand_chip->numchips > 1) { -+ num_of_interleave = nand_chip->numchips; -+ nand_chip->numchips = 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; -+ -+ /* use flash based bbt */ -+ nand_chip->bbt_td = &bbt_main_descr; -+ nand_chip->bbt_md = &bbt_mirror_descr; -+ -+ /* update flash based bbt */ -+ nand_chip->options |= NAND_USE_FLASH_BBT; -+ -+ if (!nand_chip->badblock_pattern) { -+ nand_chip->badblock_pattern = (mtd->writesize > 512) ? -+ &largepage_memorybased : &smallpage_memorybased; -+ } -+ -+ /* Build bad block table */ -+ return nand_scan_bbt(mtd, nand_chip->badblock_pattern); -+} -+ -+static void mxc_nfc_init(struct mxc_mtd_s *mxc_nand_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); -+ } -+} -+ -+static int mxc_alloc_buf(struct mxc_mtd_s *mxc_nand_data) -+{ -+ u8 *buf; -+ -+ 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; -+ } -+ mxc_nand_data->data_buf = buf; -+ mxc_nand_data->oob_buf = &buf[NAND_MAX_PAGESIZE]; -+ return 0; -+} -+ -+static void mxc_free_buf(struct mxc_mtd_s *mxc_nand_data) -+{ -+ kfree(mxc_nand_data->data_buf); -+} -+ -+/*! -+ * 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 -+ -+static int __init mxcnd_probe(struct platform_device *pdev) -+{ -+ 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; -+ -+ if (!pdata) { -+ dev_err(&pdev->dev, "No platform_data\n"); -+ return -ENODEV; -+ } -+ -+ /* 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; -+ } -+ -+ /* allocate data buffer */ -+ if (mxc_alloc_buf(mxc_nand_data)) { -+ err = -ENOMEM; -+ goto out; -+ } -+ -+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0); -+ if (!res) { -+ dev_err(&pdev->dev, "no memory resource\n"); -+ err = -ENODEV; -+ goto out1; -+ } -+ if (!request_mem_region(res->start, resource_size(res), DRV_NAME)) { -+ err = -EBUSY; -+ goto out1; -+ } -+ 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; -+ } -+ DBG(0, "%s: %08lx..%08lx remapped to %p\n", __FUNCTION__, -+ (unsigned long)res->start, (unsigned long)res->end, -+ nfc_ip_base); -+ -+ 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; -+ -+ 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); -+ -+ 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; -+ } -+ 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; -+ } -+ 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); -+ } -+ -+ 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; -+ } -+ mxc_nand_data->clk = clk; -+ clk_enable(clk); -+ mxc_nand_data->clk_act = 1; -+ -+ 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; -+ } -+ -+ 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; -+ } -+ } -+ -+ DBG(0, "%s: Resetting NAND chip\n", __FUNCTION__); -+ /* Reset NAND */ -+ this->cmdfunc(mtd, NAND_CMD_RESET, -1, -1); -+ -+ /* 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; -+ } -+ -+ 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); -+ } -+ -+ DBG(0, "%s: Scanning for NAND devices\n", __FUNCTION__); -+ err = nand_scan_tail(mtd); -+ if (err) { -+ goto out9; -+ } -+ -+ 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); -+ } -+ -+ platform_set_drvdata(pdev, mtd); -+ 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; -+} -+ -+ /*! -+ * 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) -+{ -+ 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; -+ -+ if (pdata->exit) -+ pdata->exit(); -+ -+ nand_release(mtd); -+ -+ free_irq(mxc_nand_data->irq, mxc_nand_data); -+ clk_disable(mxc_nand_data->clk); -+ clk_put(mxc_nand_data->clk); -+ -+ 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); -+ 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 int mxcnd_suspend(struct platform_device *pdev, pm_message_t state) -+{ -+ 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; -+ -+ 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); -+ } -+ 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) -+{ -+ 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; -+ -+ DEBUG(MTD_DEBUG_LEVEL0, "MXC_ND2 : NAND resume\n"); -+ /* Enable the NFC clock */ -+ clk_enable(mxc_nand_data->clk); -+ -+ mtd->resume(mtd); -+ -+ return ret; -+} -+ -+#else -+#define mxcnd_suspend NULL -+#define mxcnd_resume NULL -+#endif /* CONFIG_PM */ -+ -+/*! -+ * This structure contains pointers to the power management callback functions. -+ */ -+static struct platform_driver mxcnd_driver = { -+ .driver = { -+ .name = DRV_NAME, -+ }, -+ .probe = mxcnd_probe, -+ .remove = __exit_p(mxcnd_remove), -+ .suspend = mxcnd_suspend, -+ .resume = mxcnd_resume, -+}; -+ -+/*! -+ * Main initialization routine -+ * @return 0 if successful; non-zero otherwise -+ */ -+static int __init mxc_nd_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; -+} -+ -+/*! -+ * Clean up routine -+ */ -+static void __exit mxc_nd_cleanup(void) -+{ -+ /* Unregister the device structure */ -+ platform_driver_unregister(&mxcnd_driver); -+} -+ -+module_init(mxc_nd_init); -+module_exit(mxc_nd_cleanup); -+ -+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 @@ -+/* -+ * Copyright 2004-2009 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 -+ */ -+ -+/*! -+ * @file mxc_nd2.h -+ * -+ * @brief This file contains the NAND Flash Controller register information. -+ * -+ * -+ * @ingroup NAND_MTD -+ */ -+ -+#ifndef __MXC_ND2_H__ -+#define __MXC_ND2_H__ -+ -+#include -+ -+#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 -+ */ -+/* 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); \ -+} -+ -+#define NFC_SET_NFC_ACTIVE_CS(val) -+#define NFC_GET_MAXCHIP_SP() 1 -+#define NFC_SET_WPC(val) (val) -+ -+#define ACK_OPS -+#define NFC_SET_RBA(val) nfc_write_reg(mxc_nand_data, val, REG_NFC_SET_RBA); -+ -+#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 -@@ -2,6 +2,12 @@ - * Fast Ethernet Controller (FEC) driver for Motorola MPC8xx. - * Copyright (c) 1997 Dan Malek (dmalek@jlc.net) - * -+ * This version of the driver is specific to the FADS implementation, -+ * since the board contains control registers external to the processor -+ * for the control of the LevelOne LXT970 transceiver. The MPC860T manual -+ * describes connections using the internal parallel port I/O, which -+ * is basically all of Port D. -+ * - * Right now, I am very wasteful with the buffers. I allocate memory - * pages and then divide them into 2K frame buffers. This way I know I - * have buffers large enough to hold one frame within one buffer descriptor. -@@ -18,77 +24,123 @@ - * Bug fixes and cleanup by Philippe De Muyter (phdm@macqel.be) - * Copyright (c) 2004-2006 Macq Electronique SA. - */ -+/* -+ * Copyright 2006-2007 Freescale Semiconductor, Inc. All Rights Reserved. -+ */ - - #include - #include --#include --#include -+#include - #include - #include - #include - #include --#include --#include -+#include - #include -+#include - #include - #include - #include - #include --#include --#include --#include --#include -+#include - #include --#include -+#include -+#include - --#include -+#include -+#include - --#ifndef CONFIG_ARCH_MXC --#include --#include -+#define DRV_NAME "fec" -+#define DEBUG -+ -+#ifdef DEBUG -+static int debug = 0; -+#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 - -+#if defined(CONFIG_M523x) || defined(CONFIG_M527x) || \ -+ defined(CONFIG_M5272) || defined(CONFIG_M528x) || \ -+ defined(CONFIG_M520x) || defined(CONFIG_M532x) -+#include -+#include - #include "fec.h" -- --#ifdef CONFIG_ARCH_MXC -+#define FEC_ALIGNMENT (0x03) /*FEC needs 4bytes alignment*/ -+#elif defined(CONFIG_ARCH_MXC) - #include --#define FEC_ALIGNMENT 0xf -+#include -+#include "fec.h" -+#define FEC_ALIGNMENT (0x0F) /*FEC needs 128bits(16bytes) alignment*/ - #else --#define FEC_ALIGNMENT 0x3 -+#include -+#include -+#include "commproc.h" -+#define FEC_ALIGNMENT (0x03) /*FEC needs 4bytes alignment */ - #endif - -+#define FEC_ADDR_ALIGNMENT(x) ((unsigned char *)(((unsigned long)(x) + (FEC_ALIGNMENT)) & (~FEC_ALIGNMENT))) -+ -+#if 0 - /* - * Define the fixed address of the FEC hardware. - */ -+/* USE resources provided by platform_device! */ -+static unsigned int fec_hw[] = { - #if defined(CONFIG_M5272) --#define HAVE_mii_link_interrupt -- --static unsigned char fec_mac_default[] = { -- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ (MCF_MBAR + 0x840), -+#elif defined(CONFIG_M527x) -+ (MCF_MBAR + 0x1000), -+ (MCF_MBAR + 0x1800), -+#elif defined(CONFIG_M523x) || defined(CONFIG_M528x) -+ (MCF_MBAR + 0x1000), -+#elif defined(CONFIG_M520x) -+ (MCF_MBAR+0x30000), -+#elif defined(CONFIG_M532x) -+ (MCF_MBAR+0xfc030000), -+#elif defined(CONFIG_ARCH_MXC) -+ (IO_ADDRESS(FEC_BASE_ADDR)), -+#else -+ &(((immap_t *)IMAP_ADDR)->im_cpm.cp_fec), -+#endif - }; -+#endif - -+#if 0 - /* - * Some hardware gets it MAC address out of local flash memory. - * if this is non-zero then assume it is the address to get MAC from. - */ -+/* implemented using platform_data! */ - #if defined(CONFIG_NETtel) - #define FEC_FLASHMAC 0xf0006006 - #elif defined(CONFIG_GILBARCONAP) || defined(CONFIG_SCALES) - #define FEC_FLASHMAC 0xf0006000 -+#elif defined (CONFIG_MTD_KeyTechnology) -+#define FEC_FLASHMAC 0xffe04000 - #elif defined(CONFIG_CANCam) - #define FEC_FLASHMAC 0xf0020000 - #elif defined (CONFIG_M5272C3) - #define FEC_FLASHMAC (0xffe04000 + 4) - #elif defined(CONFIG_MOD5272) --#define FEC_FLASHMAC 0xffc0406b -+#define FEC_FLASHMAC 0xffc0406b - #else - #define FEC_FLASHMAC 0 - #endif --#endif /* CONFIG_M5272 */ -+#endif -+ -+#define platform_func(p, args...) ((p) ? (p)(args) : 0) - - /* Forward declarations of some structures to support different PHYs - */ -- -+#ifndef CONFIG_PHYLIB - typedef struct { - uint mii_data; - void (*funct)(uint mii_reg, struct net_device *dev); -@@ -103,6 +155,7 @@ typedef struct { - const phy_cmd_t *ack_int; - const phy_cmd_t *shutdown; - } phy_info_t; -+#endif - - /* The number of Tx and Rx buffers. These are allocated from the page - * pool. The code may assume these are power of two, so it it best -@@ -116,12 +169,13 @@ typedef struct { - #define RX_RING_SIZE (FEC_ENET_RX_FRPPG * FEC_ENET_RX_PAGES) - #define FEC_ENET_TX_FRSIZE 2048 - #define FEC_ENET_TX_FRPPG (PAGE_SIZE / FEC_ENET_TX_FRSIZE) --#define TX_RING_SIZE 16 /* Must be power of two */ --#define TX_RING_MOD_MASK 15 /* for this to work */ -+#define TX_RING_SIZE 16 /* Must be power of two */ -+#define TX_RING_MOD_MASK (TX_RING_SIZE - 1) /* for this to work */ - - #if (((RX_RING_SIZE + TX_RING_SIZE) * 8) > PAGE_SIZE) - #error "FEC: descriptor ring size constants too large" - #endif -+#define CBD_BUF_SIZE ((RX_RING_SIZE + TX_RING_SIZE) * sizeof(cbd_t)) - - /* Interrupt events/masks. - */ -@@ -136,6 +190,17 @@ typedef struct { - #define FEC_ENET_MII ((uint)0x00800000) /* MII interrupt */ - #define FEC_ENET_EBERR ((uint)0x00400000) /* SDMA bus error */ - -+/* MXC arch interrupt bits */ -+#define FEC_ENET_LC ((uint)0x00200000) /* Late collision */ -+#define FEC_ENET_RL ((uint)0x00100000) /* Collision retry limit exceeded */ -+#define FEC_ENET_UN ((uint)0x00080000) /* TX Fifo underrun */ -+ -+#ifndef CONFIG_ARCH_MXC -+#define FEC_ENET_MASK ((uint)0xffc00000) -+#else -+#define FEC_ENET_MASK ((uint)0xfff80000) -+#endif -+ - /* The FEC stores dest/src/type, data, and checksum for receive packets. - */ - #define PKT_MAXBUF_SIZE 1518 -@@ -150,7 +215,7 @@ typedef struct { - */ - #if defined(CONFIG_M523x) || defined(CONFIG_M527x) || defined(CONFIG_M528x) || \ - defined(CONFIG_M520x) || defined(CONFIG_M532x) || defined(CONFIG_ARCH_MXC) --#define OPT_FRAME_SIZE (PKT_MAXBUF_SIZE << 16) -+#define OPT_FRAME_SIZE (RCR_MAX_FL_set(PKT_MAXBUF_SIZE)) - #else - #define OPT_FRAME_SIZE 0 - #endif -@@ -165,31 +230,45 @@ typedef struct { - */ - struct fec_enet_private { - /* Hardware registers of the FEC device */ -- volatile fec_t *hwp; -- -- struct net_device *netdev; -- -- struct clk *clk; -+ void __iomem *reg_base; -+ void __iomem *mib_base; -+ struct resource *res_mem1; -+ struct resource *res_mem2; -+ int etn_irq; -+ int mii_irq; -+#ifndef CONFIG_PHYLIB -+ struct timer_list *phy_timer; -+#else -+ struct mii_bus *mii; -+ int mii_complete; -+#endif -+ u32 msg_enable; - - /* The saved address of a sent-in-place packet/buffer, for skfree(). */ -- unsigned char *tx_bounce[TX_RING_SIZE]; -+ void *tx_bounce[TX_RING_SIZE]; - struct sk_buff* tx_skbuff[TX_RING_SIZE]; -+ struct sk_buff* rx_skbuff[RX_RING_SIZE]; - ushort skb_cur; - ushort skb_dirty; - - /* CPM dual port RAM relative addresses. - */ -- dma_addr_t bd_dma; -+ struct device *dma_dev; /* pointer to (platform_)device for dma_sync*() functions */ -+ void *cbd_mem_base; /* save the virtual base address of rx&tx buffer descriptor */ -+ dma_addr_t cbd_phys_base; /* physical address of buffer descriptor memory for access by FEC HW */ -+ - cbd_t *rx_bd_base; /* Address of Rx and Tx buffers. */ - cbd_t *tx_bd_base; -- cbd_t *cur_rx, *cur_tx; /* The next free ring entry */ -- cbd_t *dirty_tx; /* The ring entries to be free()ed. */ -+ cbd_t *cur_rx, *cur_tx; /* The next free ring entry */ -+ cbd_t *dirty_tx; /* The ring entries to be free()ed. */ -+ struct net_device_stats stats; - uint tx_full; -- /* hold while accessing the HW like ringbuffer for tx/rx but not MAC */ -- spinlock_t hw_lock; -- /* hold while accessing the mii_list_t() elements */ -- spinlock_t mii_lock; -+ spinlock_t lock; - -+#ifdef CONFIG_PHYLIB -+ struct phy_device *phy; -+ uint phy_speed; -+#else - uint phy_id; - uint phy_id_done; - uint phy_status; -@@ -199,28 +278,41 @@ struct fec_enet_private { - - uint sequence_done; - uint mii_phy_task_queued; -- -+#endif - uint phy_addr; - -- int index; -- int opened; -- int link; -- int old_link; -- int full_duplex; -+ unsigned int opened:1; -+ unsigned int phy_int_enabled:1; -+ unsigned int linkstatus:1; -+#ifndef CONFIG_PHYLIB -+ unsigned int old_linkstatus:1; -+#endif -+ unsigned int full_duplex:1; -+ -+ struct clk *clk; - }; - --static int fec_enet_open(struct net_device *dev); --static int fec_enet_start_xmit(struct sk_buff *skb, struct net_device *dev); --static void fec_enet_mii(struct net_device *dev); --static irqreturn_t fec_enet_interrupt(int irq, void * dev_id); -+#ifdef CONFIG_PHYLIB -+static int fec_connect_phy(struct net_device *dev, struct fec_enet_private *fep); -+#else -+static irqreturn_t mii_link_interrupt(int irq, void *dev_id); -+#endif -+static void fec_restart(struct net_device *dev, int duplex); - static void fec_enet_tx(struct net_device *dev); - static void fec_enet_rx(struct net_device *dev); --static int fec_enet_close(struct net_device *dev); --static void set_multicast_list(struct net_device *dev); --static void fec_restart(struct net_device *dev, int duplex); -+static void fec_enet_mii(struct net_device *dev); - static void fec_stop(struct net_device *dev); --static void fec_set_mac_address(struct net_device *dev); -+static void _fec_set_mac_address(struct net_device *dev); - -+/* -+ * fec_copy_threshold controls the copy when receiving ethernet frame. -+ * If ethernet header is aligned on a 4byte boundary, the ip header and -+ * higher level header will not be aligned. -+ * The reason is, that an ethernet header is 14bytes long. -+ * And the max size of tcp & ip header is 128bytes. Normally it is 40bytes. -+ * So I set the default value between 128 to 256. -+ */ -+static int fec_copy_threshold = 192; - - /* MII processing. We keep this as simple as possible. Requests are - * placed on the list (if there is room). When the request is finished -@@ -232,14 +324,16 @@ typedef struct mii_list { - struct mii_list *mii_next; - } mii_list_t; - -+#ifndef CONFIG_PHYLIB - #define NMII 20 - static mii_list_t mii_cmds[NMII]; - static mii_list_t *mii_free; - static mii_list_t *mii_head; - static mii_list_t *mii_tail; - --static int mii_queue(struct net_device *dev, int request, -- void (*func)(uint, struct net_device *)); -+static int mii_queue(struct net_device *dev, int request, -+ void (*func)(uint, struct net_device *)); -+#endif - - /* Make MII read/write commands for the FEC. - */ -@@ -284,87 +378,233 @@ 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 */ - -+#ifndef DEBUG -+static inline unsigned long fec_reg_read(struct fec_enet_private *fep, unsigned int reg) -+{ -+ return readl(fep->reg_base + reg); -+} -+ -+static inline void fec_reg_write(struct fec_enet_private *fep, unsigned int reg, unsigned long val) -+{ -+ writel(val, fep->reg_base + reg); -+} -+#else -+#define fec_reg_read(fep, reg) __fec_reg_read(fep, reg, __FUNCTION__, #reg) -+#define fec_reg_write(fep, reg, val) __fec_reg_write(fep, reg, val, __FUNCTION__, #reg) -+ -+static inline unsigned long __fec_reg_read(struct fec_enet_private *fep, unsigned int reg, -+ const char *func, const char *reg_name) -+{ -+ unsigned long val = readl(fep->reg_base + reg); -+ DBG(3, "%s: Read %08lx from %s(%03x)\n", func, val, reg_name, reg); -+ return val; -+} -+ -+static inline void __fec_reg_write(struct fec_enet_private *fep, unsigned int reg, -+ unsigned long val, const char *func, const char *reg_name) -+{ -+ DBG(3, "%s: Writing %08lx to %s(%03x)\n", func, val, reg_name, reg); -+ writel(val, fep->reg_base + reg); -+} -+#endif -+ -+static inline void fec_enet_cbd_get(struct fec_enet_private *fep) -+{ -+ DBG(2, "%s: Requesting cbd area: %08lx\n", __FUNCTION__, -+ (unsigned long)fep->cbd_phys_base); -+ dma_sync_single_for_cpu(fep->dma_dev, fep->cbd_phys_base, -+ CBD_BUF_SIZE, DMA_BIDIRECTIONAL); -+} -+ -+static inline void fec_enet_cbd_put(struct fec_enet_private *fep) -+{ -+ DBG(2, "%s: Flushing changes to cbd area\n", __FUNCTION__); -+ dma_sync_single_for_device(fep->dma_dev, fep->cbd_phys_base, -+ CBD_BUF_SIZE, DMA_BIDIRECTIONAL); -+} -+ -+static inline void fec_enet_rxbuf_get(struct fec_enet_private *fep, cbd_t *bdp, ushort len) -+{ -+ DBG(2, "%s: Requesting RX buffer %08lx(%u)\n", __FUNCTION__, -+ (unsigned long)bdp->cbd_bufaddr, len); -+ dma_sync_single_for_cpu(fep->dma_dev, bdp->cbd_bufaddr, -+ len, DMA_FROM_DEVICE); -+} -+ -+static inline void fec_enet_rxbuf_put(struct fec_enet_private *fep, cbd_t *bdp, ushort len) -+{ -+ DBG(2, "%s: Releasing RX buffer %08lx(%u)\n", __FUNCTION__, (ulong)bdp->cbd_bufaddr, len); -+ dma_sync_single_for_device(fep->dma_dev, bdp->cbd_bufaddr, len, DMA_FROM_DEVICE); -+} -+ -+static inline void fec_enet_rxbuf_map(struct fec_enet_private *fep, cbd_t *bdp, -+ void *buf, ushort len) -+{ -+ BUG_ON(!dma_mapping_error(fep->dma_dev, bdp->cbd_bufaddr)); -+ bdp->cbd_bufaddr = dma_map_single(fep->dma_dev, buf, -+ len, DMA_FROM_DEVICE); -+ DBG(2, "%s: RX buffer %p(%u) mapped to %08lx\n", __FUNCTION__, -+ buf, len, (unsigned long)bdp->cbd_bufaddr); -+} -+ -+static inline void fec_enet_rxbuf_unmap(struct fec_enet_private *fep, cbd_t *bdp, ushort len) -+{ -+ DBG(2, "%s: Unmapping RX buffer %08lx(%u)\n", __FUNCTION__, -+ (unsigned long)bdp->cbd_bufaddr, len); -+ BUG_ON(dma_mapping_error(fep->dma_dev, bdp->cbd_bufaddr)); -+ dma_unmap_single(fep->dma_dev, bdp->cbd_bufaddr, -+ len, DMA_FROM_DEVICE); -+ bdp->cbd_bufaddr = ~0; -+} -+ -+static inline void fec_enet_txbuf_map(struct fec_enet_private *fep, cbd_t *bdp, -+ void *buf, ushort len) -+{ -+ BUG_ON(!dma_mapping_error(fep->dma_dev, bdp->cbd_bufaddr)); -+ bdp->cbd_bufaddr = dma_map_single(fep->dma_dev, buf, -+ len, DMA_TO_DEVICE); -+ DBG(2, "%s: TX buffer %p(%u) mapped to %08lx\n", __FUNCTION__, -+ buf, len, (unsigned long)bdp->cbd_bufaddr); -+} -+ -+static inline void fec_enet_txbuf_unmap(struct fec_enet_private *fep, cbd_t *bdp, ushort len) -+{ -+ DBG(2, "%s: Unmapping TX buffer %08lx(%u)\n", __FUNCTION__, -+ (unsigned long)bdp->cbd_bufaddr, len); -+ BUG_ON(dma_mapping_error(fep->dma_dev, bdp->cbd_bufaddr)); -+ dma_unmap_single(fep->dma_dev, bdp->cbd_bufaddr, -+ len, DMA_TO_DEVICE); -+ bdp->cbd_bufaddr = ~0; -+} -+ -+static inline void fec_enet_txbuf_get(struct fec_enet_private *fep, cbd_t *bdp, ushort len) -+{ -+ DBG(2, "%s: Requesting TX buffer %08lx(%u)\n", __FUNCTION__, -+ (unsigned long)bdp->cbd_bufaddr, len); -+ dma_sync_single_for_cpu(fep->dma_dev, bdp->cbd_bufaddr, -+ len, DMA_TO_DEVICE); -+} -+ -+static inline void fec_enet_txbuf_put(struct fec_enet_private *fep, cbd_t *bdp, ushort len) -+{ -+ DBG(2, "%s: Releasing TX buffer %08lx(%u)\n", __FUNCTION__, -+ (unsigned long)bdp->cbd_bufaddr, len); -+ 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) - { -- struct fec_enet_private *fep; -- volatile fec_t *fecp; -- volatile cbd_t *bdp; -- unsigned short status; -+ struct fec_enet_private *fep = netdev_priv(dev); -+ cbd_t *bdp; -+ unsigned short status; - unsigned long flags; - -- fep = netdev_priv(dev); -- fecp = (volatile fec_t*)dev->base_addr; -- -- if (!fep->link) { -+ if (!fep->linkstatus) { -+ DBG(0, "%s: Cannot send packet; link is down\n", __FUNCTION__); - /* Link is down or autonegotiation is in progress. */ - return 1; - } - -- 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 */ - bdp = fep->cur_tx; - - status = bdp->cbd_sc; --#ifndef final_version -+#ifdef DEBUG - if (status & BD_ENET_TX_READY) { - /* Ooops. All transmit buffers are full. Bail out. - * This should not happen, since dev->tbusy should be set. - */ - printk("%s: tx queue full!.\n", dev->name); -- spin_unlock_irqrestore(&fep->hw_lock, flags); -+ fec_enet_cbd_put(fep); -+ spin_unlock_irqrestore(&fep->lock, flags); - return 1; - } - #endif -- - /* Clear all of the status flags. - */ - status &= ~BD_ENET_TX_STATS; - - /* Set buffer length and buffer pointer. - */ -- 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 - * 4-byte boundaries. Use bounce buffers to copy data - * and get it aligned. Ugh. - */ -- if (bdp->cbd_bufaddr & FEC_ALIGNMENT) { -+ if (unlikely((bdp->cbd_bufaddr) & FEC_ALIGNMENT)) { - unsigned int index; - index = bdp - fep->tx_bd_base; -- memcpy(fep->tx_bounce[index], (void *)skb->data, skb->len); -- bdp->cbd_bufaddr = __pa(fep->tx_bounce[index]); -+ memcpy(fep->tx_bounce[index], skb->data, skb->len); -+ fec_enet_txbuf_map(fep, bdp, fep->tx_bounce[index], skb->len); -+ } else { -+ fec_enet_txbuf_map(fep, bdp, skb->data, skb->len); - } - - /* Save skb pointer. - */ - fep->tx_skbuff[fep->skb_cur] = skb; - -- dev->stats.tx_bytes += skb->len; -- fep->skb_cur = (fep->skb_cur+1) & TX_RING_MOD_MASK; -- -- /* Push the data cache so the CPM does not get stale memory -- * data. -- */ -- dma_sync_single(NULL, bdp->cbd_bufaddr, -- bdp->cbd_datlen, DMA_TO_DEVICE); -+ fep->stats.tx_bytes += skb->len; -+ fep->skb_cur = (fep->skb_cur + 1) & TX_RING_MOD_MASK; - - /* Send it on its way. Tell FEC it's ready, interrupt when done, - * it's the last BD of the frame, and to put the CRC on the end. - */ -- - status |= (BD_ENET_TX_READY | BD_ENET_TX_INTR - | BD_ENET_TX_LAST | BD_ENET_TX_TC); - bdp->cbd_sc = status; - - dev->trans_start = jiffies; - -- /* Trigger transmission start */ -- fecp->fec_x_des_active = 0; -- - /* 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, - - if (bdp == fep->dirty_tx) { - fep->tx_full = 1; -+ DBG(0, "TX ring full, stopping netif queue\n"); - netif_stop_queue(dev); - } - -- 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; - } -@@ -390,101 +640,126 @@ fec_timeout(struct net_device *dev) - { - struct fec_enet_private *fep = netdev_priv(dev); - -- printk("%s: transmit timed out.\n", dev->name); -- dev->stats.tx_errors++; --#ifndef final_version -+ printk(KERN_WARNING "%s: transmit timed out.\n", dev->name); -+ fep->stats.tx_errors++; -+#ifdef DEBUG - { -- int i; -- cbd_t *bdp; -+ int i; -+ cbd_t *bdp; - -- printk("Ring data dump: cur_tx %lx%s, dirty_tx %lx cur_rx: %lx\n", -- (unsigned long)fep->cur_tx, fep->tx_full ? " (full)" : "", -- (unsigned long)fep->dirty_tx, -- (unsigned long)fep->cur_rx); -+ fec_enet_cbd_get(fep); - -- bdp = fep->tx_bd_base; -- printk(" tx: %u buffers\n", TX_RING_SIZE); -- for (i = 0 ; i < TX_RING_SIZE; i++) { -- printk(" %08x: %04x %04x %08x\n", -- (uint) bdp, -- bdp->cbd_sc, -- bdp->cbd_datlen, -- (int) bdp->cbd_bufaddr); -- bdp++; -- } -+ printk(KERN_DEBUG "%s: Ring data dump: cur_tx %p%s, dirty_tx %p cur_rx: %p\n", -+ __FUNCTION__, -+ fep->cur_tx, fep->tx_full ? " (full)" : "", -+ fep->dirty_tx, -+ fep->cur_rx); - -- bdp = fep->rx_bd_base; -- printk(" rx: %lu buffers\n", (unsigned long) RX_RING_SIZE); -- for (i = 0 ; i < RX_RING_SIZE; i++) { -- printk(" %08x: %04x %04x %08x\n", -- (uint) bdp, -- bdp->cbd_sc, -- bdp->cbd_datlen, -- (int) bdp->cbd_bufaddr); -- bdp++; -- } -+ bdp = fep->tx_bd_base; -+ printk(" tx: %u buffers\n", TX_RING_SIZE); -+ for (i = 0; i < TX_RING_SIZE; i++) { -+ printk(" %p: %04x %04x %08x\n", -+ bdp, -+ bdp->cbd_sc, -+ bdp->cbd_datlen, -+ bdp->cbd_bufaddr); -+ bdp++; -+ } -+ -+ bdp = fep->rx_bd_base; -+ printk(" rx: %lu buffers\n", RX_RING_SIZE); -+ for (i = 0; i < RX_RING_SIZE; i++) { -+ printk(" %p: %04x %04x %08x\n", -+ bdp, -+ bdp->cbd_sc, -+ bdp->cbd_datlen, -+ bdp->cbd_bufaddr); -+ bdp++; -+ } -+ fec_enet_cbd_put(fep); - } - #endif - fec_restart(dev, fep->full_duplex); -- netif_wake_queue(dev); -+ DBG(0, "%s: Scheduling netif queue\n", __FUNCTION__); -+ //netif_schedule(dev); - } - - /* The interrupt handler. - * This is called from the MPC core interrupt. - */ - static irqreturn_t --fec_enet_interrupt(int irq, void * dev_id) -+fec_enet_interrupt(int irq, void *dev_id) - { -- struct net_device *dev = dev_id; -- volatile fec_t *fecp; -- uint int_events; -- irqreturn_t ret = IRQ_NONE; -- -- fecp = (volatile fec_t*)dev->base_addr; -+ struct net_device *dev = dev_id; -+ struct fec_enet_private *fep = netdev_priv(dev); -+ uint int_events; -+ int handled = 0; -+ unsigned int eimr = fec_reg_read(fep, FEC_EIMR); - -+ DBG(2, "%s: %08lx:%08lx\n", __FUNCTION__, -+ fec_reg_read(fep, FEC_EIR), fec_reg_read(fep, FEC_EIMR)); - /* Get the interrupt events that caused us to be here. - */ -- do { -- int_events = fecp->fec_ievent; -- fecp->fec_ievent = int_events; -+ while ((int_events = fec_reg_read(fep, FEC_EIR) & FEC_ENET_MASK) != 0) { -+ if (int_events & ~eimr) { -+ printk(KERN_WARNING "%s: masked interrupt condition: %08x\n", -+ __FUNCTION__, int_events & ~eimr); -+ } -+ -+ fec_reg_write(fep, FEC_EIR, int_events); - - /* Handle receive event in its own function. - */ -- if (int_events & FEC_ENET_RXF) { -- ret = IRQ_HANDLED; -+ if (int_events & (FEC_ENET_RXF | FEC_ENET_RXB)) { -+ DBG(2, "%s: Handling RX Interrupt\n", __FUNCTION__); -+ handled = 1; - fec_enet_rx(dev); - } - -+ if (int_events & FEC_ENET_UN) { -+ printk(KERN_WARNING "TX fifo underrun"); -+ } - /* Transmit OK, or non-fatal error. Update the buffer - descriptors. FEC handles all errors, we just discover - them as part of the transmit process. - */ -- if (int_events & FEC_ENET_TXF) { -- ret = IRQ_HANDLED; -+ if (int_events & (FEC_ENET_TXF | FEC_ENET_TXB)) { -+ DBG(2, "%s: Handling TX Interrupt\n", __FUNCTION__); -+ handled = 1; - fec_enet_tx(dev); - } - -- if (int_events & FEC_ENET_MII) { -- ret = IRQ_HANDLED; -+ if (int_events & (FEC_ENET_MII | FEC_ENET_HBERR)) { -+ DBG(2, "%s: Handling MII Interrupt\n", __FUNCTION__); -+ handled = 1; - fec_enet_mii(dev); - } -- -- } while (int_events); -- -- return ret; -+ } -+ return IRQ_RETVAL(handled); - } - -+static void fec_free_skb(struct fec_enet_private *fep, cbd_t *bdp, struct sk_buff **pskb) -+{ -+ struct sk_buff *skb = *pskb; -+ if (!dma_mapping_error(fep->dma_dev, bdp->cbd_bufaddr)) { -+ fec_enet_txbuf_unmap(fep, bdp, skb->len); -+ } -+ dev_kfree_skb_any(skb); -+ *pskb = NULL; -+} - - static void - fec_enet_tx(struct net_device *dev) - { -- struct fec_enet_private *fep; -- volatile cbd_t *bdp; -+ struct fec_enet_private *fep = netdev_priv(dev); -+ cbd_t *bdp; - unsigned short status; -- struct sk_buff *skb; -+ struct sk_buff *skb; - -- fep = netdev_priv(dev); -- 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) - if (status & (BD_ENET_TX_HB | BD_ENET_TX_LC | - BD_ENET_TX_RL | BD_ENET_TX_UN | - BD_ENET_TX_CSL)) { -- dev->stats.tx_errors++; -+ fep->stats.tx_errors++; - if (status & BD_ENET_TX_HB) /* No heartbeat */ -- dev->stats.tx_heartbeat_errors++; -+ fep->stats.tx_heartbeat_errors++; - if (status & BD_ENET_TX_LC) /* Late collision */ -- dev->stats.tx_window_errors++; -+ fep->stats.tx_window_errors++; - if (status & BD_ENET_TX_RL) /* Retrans limit */ -- dev->stats.tx_aborted_errors++; -+ fep->stats.tx_aborted_errors++; - if (status & BD_ENET_TX_UN) /* Underrun */ -- dev->stats.tx_fifo_errors++; -+ fep->stats.tx_fifo_errors++; - if (status & BD_ENET_TX_CSL) /* Carrier lost */ -- dev->stats.tx_carrier_errors++; -+ fep->stats.tx_carrier_errors++; - } else { -- dev->stats.tx_packets++; -+ fep->stats.tx_packets++; - } - --#ifndef final_version -+#ifdef DEBUG - 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) - * 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); -- fep->tx_skbuff[fep->skb_dirty] = NULL; -+ fec_free_skb(fep, bdp, &fep->tx_skbuff[fep->skb_dirty]); - 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) - */ - if (fep->tx_full) { - fep->tx_full = 0; -- if (netif_queue_stopped(dev)) -+ if (netif_queue_stopped(dev)) { -+ DBG(0, "%s: Waking up netif queue\n", __FUNCTION__); - netif_wake_queue(dev); -+ } - } - } -- fep->dirty_tx = (cbd_t *)bdp; -- spin_unlock_irq(&fep->hw_lock); -+ fec_enet_cbd_put(fep); -+ fep->dirty_tx = bdp; -+ spin_unlock(&fep->lock); - } - - -@@ -555,22 +834,22 @@ fec_enet_tx(struct net_device *dev) - static void - fec_enet_rx(struct net_device *dev) - { -- struct fec_enet_private *fep; -- volatile fec_t *fecp; -- volatile cbd_t *bdp; -+ struct fec_enet_private *fep = netdev_priv(dev); -+ cbd_t *bdp; - unsigned short status; -- struct sk_buff *skb; -- ushort pkt_len; -- __u8 *data; -+ struct sk_buff *skb; -+ ushort pkt_len; -+ int rx_index; - - #ifdef CONFIG_M532x -+ /* This is probably nonsense -+ Proper use of dma-mapping functions should make this obsolete -+ */ - flush_cache_all(); - #endif -- -- fep = netdev_priv(dev); -- fecp = (volatile fec_t*)dev->base_addr; -- -- spin_lock_irq(&fep->hw_lock); -+ /* reserve the dual port memory area for our use */ -+ //WARN_ON(fec_reg_read(fep, FEC_RDAR) & RDAR_BUSY); -+ fec_enet_cbd_get(fep); - - /* 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) - bdp = fep->cur_rx; - - while (!((status = bdp->cbd_sc) & BD_ENET_RX_EMPTY)) { -- --#ifndef final_version -+ rx_index = bdp - fep->rx_bd_base; -+#ifdef DEBUG - /* Since we have allocated space to hold a complete frame, - * the last indicator should be set. - */ -- if ((status & BD_ENET_RX_LAST) == 0) -- printk("FEC ENET: rcv is not +last\n"); -+ WARN_ON(!(status & BD_ENET_RX_LAST)); - #endif - -- if (!fep->opened) -+ if (WARN_ON(!fep->opened)) { -+ DBG(0, "%s: Driver not opened; ignoring packet\n", __FUNCTION__); -+#if 0 - goto rx_processing_done; -- -+#endif -+ } - /* Check for errors. */ - if (status & (BD_ENET_RX_LG | BD_ENET_RX_SH | BD_ENET_RX_NO | - BD_ENET_RX_CR | BD_ENET_RX_OV)) { -- dev->stats.rx_errors++; -+ fep->stats.rx_errors++; - if (status & (BD_ENET_RX_LG | BD_ENET_RX_SH)) { - /* Frame too long or too short. */ -- dev->stats.rx_length_errors++; -+ fep->stats.rx_length_errors++; - } - if (status & BD_ENET_RX_NO) /* Frame alignment */ -- dev->stats.rx_frame_errors++; -+ fep->stats.rx_frame_errors++; - if (status & BD_ENET_RX_CR) /* CRC Error */ -- dev->stats.rx_crc_errors++; -+ fep->stats.rx_crc_errors++; - if (status & BD_ENET_RX_OV) /* FIFO overrun */ -- dev->stats.rx_fifo_errors++; -+ fep->stats.rx_fifo_errors++; - } - - /* Report late collisions as a frame error. -@@ -611,39 +892,91 @@ 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) { -- dev->stats.rx_errors++; -- dev->stats.rx_frame_errors++; -+ 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 - /* Process the incoming frame. - */ -- dev->stats.rx_packets++; -+ fep->stats.rx_packets++; - pkt_len = bdp->cbd_datlen; -- dev->stats.rx_bytes += pkt_len; -- data = (__u8*)__va(bdp->cbd_bufaddr); -- -- dma_sync_single(NULL, (unsigned long)__pa(data), -- pkt_len - 4, DMA_FROM_DEVICE); -+ fep->stats.rx_bytes += pkt_len; - - /* This does 16 byte alignment, exactly what we need. - * The packet length includes FCS, but we don't want to - * include that when passing upstream as it messes up - * bridging applications. - */ -- skb = dev_alloc_skb(pkt_len-4); -+ if ((pkt_len - 4) < fec_copy_threshold) { -+ skb = dev_alloc_skb(pkt_len); -+ } else { -+ skb = dev_alloc_skb(FEC_ENET_RX_FRSIZE); -+ } - - if (skb == NULL) { - printk("%s: Memory squeeze, dropping packet.\n", dev->name); -- dev->stats.rx_dropped++; -+ fep->stats.rx_dropped++; - } else { -- skb_put(skb,pkt_len-4); /* Make room */ -- skb_copy_to_linear_data(skb, data, pkt_len-4); -- skb->protocol=eth_type_trans(skb,dev); -+ if ((pkt_len - 4) < fec_copy_threshold) { -+ /* skip 2 bytes, so IP header is on a 4 bytes boundary */ -+ skb_reserve(skb, 2); -+ skb_put(skb, pkt_len - 4); /* Make room */ -+ fec_enet_rxbuf_get(fep, bdp, pkt_len - 4); -+ skb_copy_to_linear_data(skb, -+ fep->rx_skbuff[rx_index]->data, -+ pkt_len - 4); -+ fec_enet_rxbuf_put(fep, bdp, pkt_len - 4); -+ } else { -+ struct sk_buff *pskb = fep->rx_skbuff[rx_index]; -+ -+ /* unmap the skb we are going to hand down to the network layer */ -+ fec_enet_rxbuf_unmap(fep, bdp, FEC_ENET_RX_FRSIZE); -+ -+ /* init the newly allocated skb */ -+ fep->rx_skbuff[rx_index] = skb; -+ skb->data = FEC_ADDR_ALIGNMENT(skb->data); -+ /* map the newly allocated skb's data buffer for DMA */ -+ fec_enet_rxbuf_map(fep, bdp, skb->data, FEC_ENET_RX_FRSIZE); -+ -+ skb_put(pskb, pkt_len - 4); /* Make room */ -+ skb = pskb; -+ } -+ skb->dev = dev; -+ skb->protocol = eth_type_trans(skb, dev); - netif_rx(skb); - } - 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 - status |= BD_ENET_RX_EMPTY; - bdp->cbd_sc = status; - -+ /* release the dual port memory area for use by the FEC hardware */ -+ fec_enet_cbd_put(fep); -+ - /* Update BD pointer to next entry. - */ - if (status & BD_ENET_RX_WRAP) -@@ -665,10 +1001,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. - */ -- fecp->fec_r_des_active = 0; -+ fec_reg_write(fep, FEC_RDAR, DONT_CARE); - #endif - } /* while (!((status = bdp->cbd_sc) & BD_ENET_RX_EMPTY)) */ -- fep->cur_rx = (cbd_t *)bdp; -+ fep->cur_rx = bdp; - - #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 - * our way back to the interrupt return only to come right back - * here. - */ -- fecp->fec_r_des_active = 0; -+ fec_reg_write(fep, FEC_RDAR, DONT_CARE); - #endif -- -- spin_unlock_irq(&fep->hw_lock); - } - -- -+#ifdef CONFIG_PHYLIB - /* called from interrupt context */ -+static void fec_enet_mii(struct net_device *dev) -+{ -+ struct fec_enet_private *fep = netdev_priv(dev); -+ fep->mii_complete = 1; -+} -+#else - static void - fec_enet_mii(struct net_device *dev) - { -- struct fec_enet_private *fep; -- volatile fec_t *ep; -+ struct fec_enet_private *fep = netdev_priv(dev); - mii_list_t *mip; - uint mii_reg; - -- fep = netdev_priv(dev); -- spin_lock_irq(&fep->mii_lock); -+ mii_reg = fec_reg_read(fep, FEC_MMFR); - -- ep = fep->hwp; -- mii_reg = ep->fec_mii_data; -+ spin_lock(&fep->lock); - - if ((mip = mii_head) == NULL) { - printk("MII and no head!\n"); -@@ -713,27 +1050,27 @@ fec_enet_mii(struct net_device *dev) - mii_free = mip; - - if ((mip = mii_head) != NULL) -- ep->fec_mii_data = mip->mii_regval; -+ fec_reg_write(fep, FEC_MMFR, mip->mii_regval); - - unlock: -- spin_unlock_irq(&fep->mii_lock); -+ spin_unlock(&fep->lock); - } - - static int - mii_queue(struct net_device *dev, int regval, void (*func)(uint, struct net_device *)) - { -- struct fec_enet_private *fep; -+ struct fec_enet_private *fep = netdev_priv(dev); - unsigned long flags; - mii_list_t *mip; - int retval; - -+ retval = 0; -+ -+ spin_lock_irqsave(&fep->lock,flags); -+ - /* Add PHY address to register command. - */ -- fep = netdev_priv(dev); -- spin_lock_irqsave(&fep->mii_lock, flags); -- - regval |= fep->phy_addr << 23; -- retval = 0; - - if ((mip = mii_free) != NULL) { - mii_free = mip->mii_next; -@@ -745,32 +1082,32 @@ mii_queue(struct net_device *dev, int re - mii_tail = mip; - } else { - mii_head = mii_tail = mip; -- fep->hwp->fec_mii_data = regval; -+ fec_reg_write(fep, FEC_MMFR, regval); - } - } else { - retval = 1; - } - -- spin_unlock_irqrestore(&fep->mii_lock, flags); -- return retval; -+ spin_unlock_irqrestore(&fep->lock,flags); -+ -+ return(retval); - } - - static void mii_do_cmd(struct net_device *dev, const phy_cmd_t *c) - { -- if(!c) -- return; -+ int k; - -- for (; c->mii_data != mk_mii_end; c++) -- mii_queue(dev, c->mii_data, c->funct); -+ for (k = 0; c != NULL && c[k].mii_data != mk_mii_end; k++) { -+ mii_queue(dev, c[k].mii_data, c[k].funct); -+ } - } - - static void mii_parse_sr(uint mii_reg, struct net_device *dev) - { - struct fec_enet_private *fep = netdev_priv(dev); -- volatile uint *s = &(fep->phy_status); - uint status; - -- status = *s & ~(PHY_STAT_LINK | PHY_STAT_FAULT | PHY_STAT_ANC); -+ status = fep->phy_status & ~(PHY_STAT_LINK | PHY_STAT_FAULT | PHY_STAT_ANC); - - if (mii_reg & 0x0004) - status |= PHY_STAT_LINK; -@@ -778,31 +1115,30 @@ static void mii_parse_sr(uint mii_reg, s - status |= PHY_STAT_FAULT; - if (mii_reg & 0x0020) - status |= PHY_STAT_ANC; -- *s = status; -+ -+ fep->phy_status = status; - } - - static void mii_parse_cr(uint mii_reg, struct net_device *dev) - { - struct fec_enet_private *fep = netdev_priv(dev); -- volatile uint *s = &(fep->phy_status); - uint status; - -- status = *s & ~(PHY_CONF_ANE | PHY_CONF_LOOP); -+ status = fep->phy_status & ~(PHY_CONF_ANE | PHY_CONF_LOOP); - - if (mii_reg & 0x1000) - status |= PHY_CONF_ANE; - if (mii_reg & 0x4000) - status |= PHY_CONF_LOOP; -- *s = status; -+ fep->phy_status = status; - } - - static void mii_parse_anar(uint mii_reg, struct net_device *dev) - { - struct fec_enet_private *fep = netdev_priv(dev); -- volatile uint *s = &(fep->phy_status); - uint status; - -- status = *s & ~(PHY_CONF_SPMASK); -+ status = fep->phy_status & ~(PHY_CONF_SPMASK); - - if (mii_reg & 0x0020) - status |= PHY_CONF_10HDX; -@@ -812,7 +1148,7 @@ static void mii_parse_anar(uint mii_reg, - status |= PHY_CONF_100HDX; - if (mii_reg & 0x00100) - status |= PHY_CONF_100FDX; -- *s = status; -+ fep->phy_status = status; - } - - /* ------------------------------------------------------------------------- */ -@@ -827,10 +1163,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); -- volatile uint *s = &(fep->phy_status); - uint status; - -- status = *s & ~(PHY_STAT_SPMASK); -+ status = fep->phy_status & ~(PHY_STAT_SPMASK); - if (mii_reg & 0x0800) { - if (mii_reg & 0x1000) - status |= PHY_STAT_100FDX; -@@ -842,7 +1177,7 @@ static void mii_parse_lxt970_csr(uint mi - else - status |= PHY_STAT_10HDX; - } -- *s = status; -+ fep->phy_status = status; - } - - static phy_cmd_t const phy_cmd_lxt970_config[] = { -@@ -898,16 +1233,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); -- volatile uint *s = &(fep->phy_status); - uint status; - -- status = *s & ~(PHY_STAT_SPMASK | PHY_STAT_LINK | PHY_STAT_ANC); -+ status = fep->phy_status & ~(PHY_STAT_SPMASK | PHY_STAT_LINK | PHY_STAT_ANC); - - if (mii_reg & 0x0400) { -- fep->link = 1; -+ fep->linkstatus = 1; - status |= PHY_STAT_LINK; - } else { -- fep->link = 0; -+ fep->linkstatus = 0; - } - if (mii_reg & 0x0080) - status |= PHY_STAT_ANC; -@@ -925,7 +1259,7 @@ static void mii_parse_lxt971_sr2(uint mi - if (mii_reg & 0x0008) - status |= PHY_STAT_FAULT; - -- *s = status; -+ fep->phy_status = status; - } - - static phy_cmd_t const phy_cmd_lxt971_config[] = { -@@ -982,10 +1316,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); -- volatile uint *s = &(fep->phy_status); - uint status; - -- status = *s & ~(PHY_STAT_SPMASK); -+ status = fep->phy_status & ~(PHY_STAT_SPMASK); - - switch((mii_reg >> 2) & 7) { - case 1: status |= PHY_STAT_10HDX; break; -@@ -994,7 +1327,7 @@ static void mii_parse_qs6612_pcr(uint mi - case 6: status |= PHY_STAT_100FDX; break; - } - -- *s = status; -+ fep->phy_status = status; - } - - static phy_cmd_t const phy_cmd_qs6612_config[] = { -@@ -1052,10 +1385,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); -- volatile uint *s = &(fep->phy_status); - uint status; - -- status = *s & ~(PHY_STAT_SPMASK | PHY_STAT_ANC); -+ status = fep->phy_status & ~(PHY_STAT_SPMASK | PHY_STAT_ANC); - - if (mii_reg & 0x0080) - status |= PHY_STAT_ANC; -@@ -1064,7 +1396,7 @@ static void mii_parse_am79c874_dr(uint m - else - status |= ((mii_reg & 0x0800) ? PHY_STAT_10FDX : PHY_STAT_10HDX); - -- *s = status; -+ fep->phy_status = status; - } - - static phy_cmd_t const phy_cmd_am79c874_config[] = { -@@ -1107,7 +1439,7 @@ static phy_info_t const phy_info_am79c87 - /* register definitions for the 8721 */ - - #define MII_KS8721BL_RXERCR 21 --#define MII_KS8721BL_ICSR 27 -+#define MII_KS8721BL_ICSR 22 - #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 - static void mii_parse_dp8384x_sr2(uint mii_reg, struct net_device *dev) - { - struct fec_enet_private *fep = netdev_priv(dev); -- volatile uint *s = &(fep->phy_status); - -- *s &= ~(PHY_STAT_SPMASK | PHY_STAT_LINK | PHY_STAT_ANC); -+ fep->phy_status &= ~(PHY_STAT_SPMASK | PHY_STAT_LINK | PHY_STAT_ANC); - - /* Link up */ - if (mii_reg & 0x0001) { -- fep->link = 1; -- *s |= PHY_STAT_LINK; -+ fep->linkstatus = 1; -+ fep->phy_status |= PHY_STAT_LINK; - } else -- fep->link = 0; -+ fep->linkstatus = 0; - /* Status of link */ - if (mii_reg & 0x0010) /* Autonegotioation complete */ -- *s |= PHY_STAT_ANC; -+ fep->phy_status |= PHY_STAT_ANC; - if (mii_reg & 0x0002) { /* 10MBps? */ - if (mii_reg & 0x0004) /* Full Duplex? */ -- *s |= PHY_STAT_10FDX; -+ fep->phy_status |= PHY_STAT_10FDX; - else -- *s |= PHY_STAT_10HDX; -+ fep->phy_status |= PHY_STAT_10HDX; - } else { /* 100 Mbps? */ - if (mii_reg & 0x0004) /* Full Duplex? */ -- *s |= PHY_STAT_100FDX; -+ fep->phy_status |= PHY_STAT_100FDX; - else -- *s |= PHY_STAT_100HDX; -+ fep->phy_status |= PHY_STAT_100HDX; - } - if (mii_reg & 0x0008) -- *s |= PHY_STAT_FAULT; -+ fep->phy_status |= PHY_STAT_FAULT; - } - - static phy_info_t phy_info_dp83848= { -@@ -1211,92 +1542,362 @@ static phy_info_t const * const phy_info - &phy_info_dp83848, - NULL - }; -- --/* ------------------------------------------------------------------------- */ --#ifdef HAVE_mii_link_interrupt --static irqreturn_t --mii_link_interrupt(int irq, void * dev_id); -+#endif - - /* -- * This is specific to the MII interrupt setup of the M5272EVB. -+ * do some initializtion based architecture of this chip -+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; --} --#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) -+ 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__, -+ fep->linkstatus, phydev->link, fep->full_duplex ? "full" : "half", -+ phydev->duplex ? "full" : "half"); -+ if (phydev->link) { -+ fec_restart(dev, phydev->duplex); -+ } else { -+ fec_stop(dev); -+ } -+ if (fep->linkstatus != phydev->link && netif_msg_link(fep)) { -+ phy_print_status(phydev); -+ } -+ fep->linkstatus = phydev->link; -+#if 0 -+ int i; -+ for (i = 0; i < 32; i++) { -+ DBG(0, "%s: PHY reg[%02x]=%04x\n", __FUNCTION__, i, -+ fec_mii_read(fep->mii, fep->phy_addr, i)); -+ } -+#endif -+ } -+} -+#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; -+ 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; -+ } -+ fec_restart(dev, duplex); -+ 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]; -+ 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 fec_phy_timer(unsigned long data) - { -+ struct net_device *dev = (struct net_device *)data; - struct fec_enet_private *fep = netdev_priv(dev); -- volatile uint *s = &(fep->phy_status); -+ 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 -+ -+/* -+ * 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); -+ -+ fep->etn_irq = platform_get_irq(pdev, 0); -+ fep->mii_irq = platform_get_irq(pdev, 1); -+ -+ /* Setup interrupt handlers. */ -+ ret = request_irq(fep->etn_irq, fec_enet_interrupt, 0, "fec", dev); -+ if (ret != 0) { -+ printk(KERN_ERR "FEC: Could not allocate FEC IRQ(%d)!\n", fep->etn_irq); -+ return ret; -+ } -+#ifndef CONFIG_PHYLIB -+ if (fep->mii_irq >= 0) { -+ /* TODO: disable now due to CPLD issue */ -+ ret = request_irq(fep->mii_irq, mii_link_interrupt, 0, "fec(MII)", dev); -+ if (ret != 0) { -+ printk(KERN_ERR "FEC: Could not allocate FEC(MII) IRQ(%d)!\n", -+ fep->mii_irq); -+ free_irq(fep->etn_irq, dev); -+ return ret; -+ } -+ /* -+ * 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. -+ */ -+ fep->phy_int_enabled = 1; -+ } else { -+ fep->phy_timer = kzalloc(sizeof(struct timer_list), GFP_KERNEL); -+ if (fep->phy_timer == NULL) { -+ free_irq(fep->etn_irq, dev); -+ return -ENOMEM; -+ } -+ init_timer(fep->phy_timer); -+ fep->phy_timer->function = fec_phy_timer; -+ fep->phy_timer->data = (unsigned long)dev; -+ fec_link_change(dev); -+ } -+#endif -+ -+ return 0; -+} -+ -+static void fec_release_intrs(struct net_device *dev) -+{ -+ struct fec_enet_private *fep = netdev_priv(dev); -+ -+ free_irq(fep->etn_irq, dev); -+#ifndef CONFIG_PHYLIB -+ if (fep->mii_irq >= 0) { -+ free_irq(fep->mii_irq, dev); -+ } -+#endif -+} -+ -+#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 -+ -+#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) -+ -+#ifndef DEBUG -+static inline unsigned long fec_reg_read16(struct fec_enet_private *fep, unsigned int reg) -+{ -+ return readw(fep->reg_base + reg); -+} -+ -+static inline void fec_reg_write(struct fec_enet_private *fep, unsigned int reg, unsigned long val) -+{ -+ writew(val, fep->reg_base + reg); -+} -+#else -+#define fec_reg_read16(fep, reg) __fec_reg_read16(fep, reg, __FUNCTION__, #reg) -+#define fec_reg_write16(fep, reg, val) __fec_reg_write16(fep, reg, val, __FUNCTION__, #reg) -+ -+static inline u16 __fec_reg_read16(struct fec_enet_private *fep, unsigned int reg, -+ const char *func, const char *reg_name) -+{ -+ u16 val = readw(fep->reg_base + reg); -+ DBG(0, "%s: Read %04x from %s(%03x)\n", func, val, reg_name, reg); -+ return val; -+} -+ -+static inline void __fec_reg_write16(struct fec_enet_private *fep, unsigned int reg, -+ u16 val, const char *func, const char *reg_name) -+{ -+ DBG(0, "%s: Writing %04x to %s(%03x)\n", func, val, reg_name, reg); -+ writew(val, fep->reg_base + reg); -+} -+#endif -+ -+static void fec_localhw_setup(struct net_device *dev) -+{ -+ struct fec_enet_private *fep = netdev_priv(dev); -+ int loops; -+ const int max_loops = 10000; -+ -+ /* -+ * Set up the MII gasket for RMII mode -+ */ -+ dev_dbg(&dev->dev, "enable RMII gasket\n"); -+ -+ /* disable the gasket and wait */ -+ fec_reg_write16(fep, FEC_MIIGSK_ENR, 0); -+ DBG(0, "%s: Waiting for RMII gasket idle\n", __FUNCTION__); -+ while (fec_reg_read16(fep, FEC_MIIGSK_ENR) & FEC_MIIGSK_ENR_READY) -+ udelay(1); -+ DBG(0, "%s: RMII gasket idle\n", __FUNCTION__); -+ -+ /* 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); -+ -+#if 1 -+ DBG(0, "%s: Waiting for RMII gasket ready\n", __FUNCTION__); -+ for (loops = 0; loops < max_loops; loops++) { -+ if (readw(fep->reg_base + FEC_MIIGSK_ENR) & FEC_MIIGSK_ENR_READY) -+ break; -+ udelay(1); -+ } -+ if (fec_reg_read16(fep, FEC_MIIGSK_ENR) & FEC_MIIGSK_ENR_READY) { -+ DBG(0, "%s: RMII gasket ready after %u loops\n", __FUNCTION__, loops); -+ } else { -+ DBG(0, "%s: RMII gasket NOT ready after %u loops\n", __FUNCTION__, loops); -+ } -+#endif -+} -+#else -+static inline void fec_localhw_setup(struct net_device *dev) -+{ -+} -+#endif -+ -+static int fec_set_mii(struct net_device *dev, struct fec_enet_private *fep) -+{ -+ unsigned long rate; -+ struct clk *clk; -+ -+ DBG(0, "%s: \n", __FUNCTION__); -+ -+ fec_reg_write(fep, FEC_RCR, OPT_FRAME_SIZE | RCR_MII_MODE); -+ fec_reg_write(fep, FEC_TCR, 0x00); -+ -+ /* -+ * Set MII speed to 2.5 MHz -+ */ -+ clk = clk_get(fep->dma_dev, NULL); -+ if (!IS_ERR(clk)) { -+ rate = clk_get_rate(clk); -+ clk_put(clk); -+ } else { -+ printk(KERN_ERR "Failed to get fec clock: %ld\n", PTR_ERR(clk)); -+ return PTR_ERR(clk); -+ } -+ fep->phy_speed = ((((rate + 4999999) / 2500000) / 2) & 0x3F) << 1; -+ fec_reg_write(fep, FEC_MSCR, fep->phy_speed); -+ DBG(0, "%s: clkdiv set to %u for MII clock %u at base clock %lu\n", -+ __FUNCTION__, fep->phy_speed >> 1, 2500000, rate); -+ DBG(0, "%s: actual MII clock is: %lu\n", __FUNCTION__, rate / (fep->phy_speed)); -+ -+ return 0; -+} -+ -+static const unsigned char default_mac[ETH_ALEN] = { -+ 0x00, 0x04, 0x9f, 0x00, 0x74, 0x4a, -+}; -+ -+#define FEC_IIM_BASE IO_ADDRESS(IIM_BASE_ADDR) -+static void fec_get_mac(struct net_device *dev) -+{ -+#if 1 -+ // keep bootloader assigned MAC address -+ struct fec_enet_private *fep = netdev_priv(dev); -+ unsigned long eth_addr = fec_reg_read(fep, FEC_PALR); -+ dev->dev_addr[0] = eth_addr >> 24; -+ dev->dev_addr[1] = eth_addr >> 16; -+ dev->dev_addr[2] = eth_addr >> 8; -+ dev->dev_addr[3] = eth_addr >> 0; -+ eth_addr = fec_reg_read(fep, FEC_PAUR); -+ dev->dev_addr[5] = eth_addr >> 16; -+ dev->dev_addr[4] = eth_addr >> 24; -+#else -+ int i; -+ unsigned long fec_mac_base = FEC_IIM_BASE + MXC_IIMKEY0; -+ -+ if (cpu_is_mx27_rev(CHIP_REV_2_0) > 0) { -+ fec_mac_base = FEC_IIM_BASE + MXC_IIMMAC; -+ } -+ -+ DBG(0, "%s: Reading MAC address from %08lx\n", __FUNCTION__, fec_mac_base); -+ for (i = 0; i < ETH_ALEN; i++) { -+ dev->dev_addr[ETH_ALEN - 1 - i] = __raw_readb(fec_mac_base + i * 4); -+ } -+ //memcpy(dev->dev_addr, default_mac, ETH_ALEN); -+#endif -+} -+ -+#ifdef CONFIG_PHYLIB -+static inline void fec_enable_phy_intr(struct fec_enet_private *fep) -+{ -+} -+static inline void fec_disable_phy_intr(struct fec_enet_private *fep) -+{ -+} -+static inline void fec_phy_ack_intr(struct fec_enet_private *fep) -+{ -+} -+#else -+static inline void fec_enable_phy_intr(struct fec_enet_private *fep) -+{ -+ if (!fep->phy_int_enabled) { -+ fep->phy_int_enabled = 1; -+ enable_irq(fep->mii_irq); -+ } -+} -+ -+static inline void fec_disable_phy_intr(struct fec_enet_private *fep) -+{ -+ if (fep->phy_int_enabled) { -+ disable_irq(fep->mii_irq); -+ fep->phy_int_enabled = 0; -+ } -+} -+ -+static inline void fec_phy_ack_intr(struct fec_enet_private *fep) -+{ -+ if (fep->phy_int_enabled) { -+ disable_irq(fep->mii_irq); -+ fep->phy_int_enabled = 0; -+ } -+} -+#endif -+ -+/* ------------------------------------------------------------------------- */ -+ -+#ifndef CONFIG_PHYLIB -+static void mii_display_status(struct net_device *dev) -+{ -+ struct fec_enet_private *fep = netdev_priv(dev); -+ -+ if (!fep->linkstatus && !fep->old_linkstatus) { -+ /* Link is still down - don't print anything */ - return; - } - - printk("%s: status: ", dev->name); - -- if (!fep->link) { -+ if (!fep->linkstatus) { - printk("link down"); - } else { - printk("link up"); - -- switch(*s & PHY_STAT_SPMASK) { -+ 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) -+ if (fep->phy_status & PHY_STAT_ANC) - printk(", auto-negotiation complete"); - } - -- if (*s & PHY_STAT_FAULT) -+ if (fep->phy_status & PHY_STAT_FAULT) - printk(", remote fault"); - - printk(".\n"); - } - --static void mii_display_config(struct work_struct *work) -+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; - - /* -@@ -1326,7 +1926,7 @@ static void mii_display_config(struct wo - ** the workqueue. It is thus safe to allow to reuse it. - */ - fep->mii_phy_task_queued = 0; -- printk("%s: config: auto-negotiation ", dev->name); -+ //printk("%s: config: auto-negotiation ", dev->name); - - if (status & PHY_CONF_ANE) - printk("on"); -@@ -1351,11 +1951,21 @@ static void mii_display_config(struct wo - - fep->sequence_done = 1; - } -+#endif - --static void mii_relink(struct work_struct *work) -+#ifndef CONFIG_PHYLIB -+static inline void *priv_netdev(struct fec_enet_private *fep) - { -- struct fec_enet_private *fep = container_of(work, struct fec_enet_private, phy_task); -- struct net_device *dev = fep->netdev; -+ /* ugly hack, stolen from include linux/netdevice.h */ -+ return (char *)fep - ((sizeof(struct net_device) -+ + NETDEV_ALIGN_CONST) -+ & ~NETDEV_ALIGN_CONST); -+} -+ -+static void mii_relink(struct work_struct *w) -+{ -+ struct fec_enet_private *fep = container_of(w, struct fec_enet_private, phy_task); -+ struct net_device *dev = priv_netdev(fep); - int duplex; - - /* -@@ -1363,23 +1973,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; -- fep->link = (fep->phy_status & PHY_STAT_LINK) ? 1 : 0; -+ fep->linkstatus = (fep->phy_status & PHY_STAT_LINK) ? 1 : 0; - mii_display_status(dev); -- fep->old_link = fep->link; -+ fep->old_linkstatus = fep->linkstatus; - -- if (fep->link) { -+ if (fep->linkstatus) { - duplex = 0; -- if (fep->phy_status -- & (PHY_STAT_100FDX | PHY_STAT_10FDX)) -+ if (fep->phy_status & (PHY_STAT_100FDX | PHY_STAT_10FDX)) { - duplex = 1; -+ } - fec_restart(dev, duplex); -- } else -+ } else { - fec_stop(dev); -- --#if 0 -- enable_irq(fep->mii_irq); --#endif -- -+ } - } - - /* mii_queue_relink is called in interrupt context from mii_link_interrupt */ -@@ -1429,15 +2035,14 @@ phy_cmd_t const phy_cmd_config[] = { - static void - mii_discover_phy3(uint mii_reg, struct net_device *dev) - { -- struct fec_enet_private *fep; -+ struct fec_enet_private *fep = netdev_priv(dev); - int i; - -- fep = netdev_priv(dev); - fep->phy_id |= (mii_reg & 0xffff); - printk("fec: PHY @ 0x%x, ID 0x%08x", fep->phy_addr, fep->phy_id); - -- for(i = 0; phy_info[i]; i++) { -- if(phy_info[i]->id == (fep->phy_id >> 4)) -+ for (i = 0; phy_info[i]; i++) { -+ if (phy_info[i]->id == (fep->phy_id >> 4)) - break; - } - -@@ -1456,13 +2061,9 @@ mii_discover_phy3(uint mii_reg, struct n - static void - mii_discover_phy(uint mii_reg, struct net_device *dev) - { -- struct fec_enet_private *fep; -- volatile fec_t *fecp; -+ struct fec_enet_private *fep = netdev_priv(dev); - uint phytype; - -- fep = netdev_priv(dev); -- fecp = fep->hwp; -- - 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 - */ - fep->phy_id = phytype << 16; - mii_queue(dev, mk_mii_read(MII_REG_PHYIR2), -- mii_discover_phy3); -+ mii_discover_phy3); - } else { - fep->phy_addr++; - mii_queue(dev, mk_mii_read(MII_REG_PHYIR1), -- mii_discover_phy); -+ mii_discover_phy); - } - } else { - printk("FEC: No PHY device found.\n"); - /* Disable external MII interface */ -- fecp->fec_mii_speed = fep->phy_speed = 0; --#ifdef HAVE_mii_link_interrupt -- fec_disable_phy_intr(); --#endif -+ fec_disable_phy_intr(fep); -+ fec_reg_write(fep, FEC_MSCR, 0); - } - } -+#endif - --/* This interrupt occurs when the PHY detects a link change. --*/ --#ifdef HAVE_mii_link_interrupt -+#ifndef CONFIG_PHYLIB - static irqreturn_t --mii_link_interrupt(int irq, void * dev_id) -+mii_link_interrupt(int irq, void *dev_id) - { -- struct net_device *dev = dev_id; -+ struct net_device *dev = dev_id; - struct fec_enet_private *fep = netdev_priv(dev); - -- fec_phy_ack_intr(); -+ DBG(0, "%s: \n", __FUNCTION__); - --#if 0 -- disable_irq(fep->mii_irq); /* disable now, enable later */ --#endif -+ fec_phy_ack_intr(fep); - -- mii_do_cmd(dev, fep->phy->ack_int); -- mii_do_cmd(dev, phy_cmd_relink); /* restart and display status */ -+ /* -+ * Some board will trigger phy interrupt before phy enable. -+ * And at that moment , fep->phy is not initialized. -+ */ -+ if (fep->phy) { -+ mii_do_cmd(dev, fep->phy->ack_int); -+ mii_do_cmd(dev, phy_cmd_relink); /* restart and display status */ -+ } - - return IRQ_HANDLED; - } -@@ -1511,16 +2113,31 @@ mii_link_interrupt(int irq, void * dev_i - static int - fec_enet_open(struct net_device *dev) - { -+ int ret = 0; - struct fec_enet_private *fep = netdev_priv(dev); - - /* I should reset the ring buffers here, but I don't yet know - * a simple way to do that. - */ -- fec_set_mac_address(dev); -+ DBG(0, "%s: \n", __FUNCTION__); -+ _fec_set_mac_address(dev); - -- fep->sequence_done = 0; -- fep->link = 0; -+#ifdef CONFIG_PHYLIB -+ fec_restart(dev, 0); - -+ ret = fec_connect_phy(dev, fep); -+ if (ret != 0) { -+ DBG(0, "%s: Failed to connect to PHY: %d\n", __FUNCTION__, ret); -+ return ret; -+ } -+ phy_start(fep->phy); -+ -+ fep->linkstatus = fep->phy->link; -+ //fec_restart(dev, 0); -+ DBG(0, "%s: Link status is: %d\n", __FUNCTION__, fep->linkstatus); -+#else -+ fep->linkstatus = 0; -+ fep->sequence_done = 0; - 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) - * based on this device does not implement a PHY interrupt, - * so we are never notified of link change. - */ -- fep->link = 1; -+ fep->linkstatus = 1; - } else { -- fep->link = 1; /* lets just try it and see */ -+ fep->linkstatus = 1; /* lets just try it and see */ - /* no phy, go full duplex, it's most likely a hub chip */ - fec_restart(dev, 1); - } -- -- netif_start_queue(dev); -+ fep->old_linkstatus = fep->linkstatus; -+#endif - fep->opened = 1; -- return 0; /* Success */ -+#if 1 -+ /* enable receiver */ -+ fec_reg_write(fep, FEC_RDAR, DONT_CARE); -+#endif -+ return ret; - } - - static int -@@ -1559,15 +2180,46 @@ fec_enet_close(struct net_device *dev) - { - struct fec_enet_private *fep = netdev_priv(dev); - -- /* Don't know what to do yet. -- */ -+ DBG(0, "%s: \n", __FUNCTION__); -+ - fep->opened = 0; -- netif_stop_queue(dev); -- fec_stop(dev); -+ if (fep->linkstatus) { -+ fec_stop(dev); -+ } -+#ifdef CONFIG_PHYLIB -+ if (fep->phy) { -+ DBG(0, "%s: Stopping PHY %p\n", __FUNCTION__, fep->phy); -+ phy_stop(fep->phy); - -+ DBG(0, "%s: Disconnecting PHY %p\n", __FUNCTION__, fep->phy); -+ phy_disconnect(fep->phy); -+ fep->phy = NULL; -+ } -+#endif -+#if 1 -+ /* Whack a reset. We should wait for this. -+ */ -+ fec_reg_write(fep, FEC_ECR, FEC_ECR_RESET); -+ udelay(10); -+ -+ /* Mask and clear outstanding MII command interrupts. -+ */ -+ fec_reg_write(fep, FEC_EIMR, 0); -+ fec_reg_write(fep, FEC_EIR, FEC_ENET_MII); -+ fec_disable_phy_intr(fep); -+ /* Switch off MII */ -+ fec_reg_write(fep, FEC_MSCR, 0); -+#endif - return 0; - } - -+static struct net_device_stats *fec_enet_get_stats(struct net_device *dev) -+{ -+ struct fec_enet_private *fep = netdev_priv(dev); -+ -+ return &fep->stats; -+} -+ - /* 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) - - static void set_multicast_list(struct net_device *dev) - { -- struct fec_enet_private *fep; -- volatile fec_t *ep; -+ struct fec_enet_private *fep = netdev_priv(dev); - struct dev_mc_list *dmi; - unsigned int i, j, bit, data, crc; - unsigned char hash; - -- fep = netdev_priv(dev); -- ep = fep->hwp; -- -- if (dev->flags&IFF_PROMISC) { -- ep->fec_r_cntrl |= 0x0008; -+ if (dev->flags & IFF_PROMISC) { -+ fec_reg_write(fep, FEC_RCR, fec_reg_read(fep, FEC_RCR) | RCR_PROM); - } else { - -- ep->fec_r_cntrl &= ~0x0008; -+ fec_reg_write(fep, FEC_RCR, fec_reg_read(fep, FEC_RCR) & ~RCR_PROM); - - if (dev->flags & IFF_ALLMULTI) { - /* Catch all multicast addresses, so set the - * filter to all 1's. - */ -- ep->fec_grp_hash_table_high = 0xffffffff; -- ep->fec_grp_hash_table_low = 0xffffffff; -+ fec_reg_write(fep, FEC_IAUR, ~0); -+ fec_reg_write(fep, FEC_IALR, ~0); - } else { - /* Clear filter and add the addresses in hash register. - */ -- ep->fec_grp_hash_table_high = 0; -- ep->fec_grp_hash_table_low = 0; -+ fec_reg_write(fep, FEC_IAUR, 0); -+ fec_reg_write(fep, FEC_IALR, 0); - - dmi = dev->mc_list; - -- for (j = 0; j < dev->mc_count; j++, dmi = dmi->next) -- { -+ for (j = 0; j < dev->mc_count; j++, dmi = dmi->next) { - /* Only support group multicast for now. - */ - if (!(dmi->dmi_addr[0] & 1)) -@@ -1621,13 +2268,11 @@ static void set_multicast_list(struct ne - - /* calculate crc32 value of mac address - */ -- crc = 0xffffffff; -+ crc = ~0; - -- for (i = 0; i < dmi->dmi_addrlen; i++) -- { -+ for (i = 0; i < dmi->dmi_addrlen; i++) { - data = dmi->dmi_addr[i]; -- for (bit = 0; bit < 8; bit++, data >>= 1) -- { -+ for (bit = 0; bit < 8; bit++, data >>= 1) { - crc = (crc >> 1) ^ - (((crc ^ data) & 1) ? CRC32_POLY : 0); - } -@@ -1639,9 +2284,13 @@ static void set_multicast_list(struct ne - hash = (crc >> (32 - HASH_BITS)) & 0x3f; - - if (hash > 31) -- ep->fec_grp_hash_table_high |= 1 << (hash - 32); -+ fec_reg_write(fep, FEC_IAUR, -+ fec_reg_read(fep, FEC_IAUR) | -+ (1 << (hash - 32))); - else -- ep->fec_grp_hash_table_low |= 1 << hash; -+ fec_reg_write(fep, FEC_IALR, -+ fec_reg_read(fep, FEC_IALR) | -+ (1 << hash)); - } - } - } -@@ -1650,106 +2299,272 @@ static void set_multicast_list(struct ne - /* Set a MAC change in hardware. - */ - static void --fec_set_mac_address(struct net_device *dev) -+_fec_set_mac_address(struct net_device *dev) - { -- volatile fec_t *fecp; -- -- fecp = ((struct fec_enet_private *)netdev_priv(dev))->hwp; -+ struct fec_enet_private *fep = netdev_priv(dev); - - /* Set station address. */ -- fecp->fec_addr_low = dev->dev_addr[3] | (dev->dev_addr[2] << 8) | -- (dev->dev_addr[1] << 16) | (dev->dev_addr[0] << 24); -- fecp->fec_addr_high = (dev->dev_addr[5] << 16) | -- (dev->dev_addr[4] << 24); -+ fec_reg_write(fep, FEC_PALR, dev->dev_addr[3] | (dev->dev_addr[2] << 8) | -+ (dev->dev_addr[1] << 16) | (dev->dev_addr[0] << 24)); -+ 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) -+{ -+ struct sockaddr *addr = _addr; -+ -+ if (!is_valid_ether_addr((const char *)&addr->sa_data)) { -+ printk(KERN_WARNING "Bad ethernet address: %02x:%02x:%02x:%02x:%02x:%02x\n", -+ addr->sa_data[0], addr->sa_data[1], addr->sa_data[2], addr->sa_data[3], -+ addr->sa_data[4], addr->sa_data[5]); -+ return -EINVAL; -+ } -+ printk(KERN_DEBUG "Setting MAC address to %02x:%02x:%02x:%02x:%02x:%02x\n", -+ addr->sa_data[0], addr->sa_data[1], addr->sa_data[2], addr->sa_data[3], -+ addr->sa_data[4], addr->sa_data[5]); -+ -+ memcpy(&dev->dev_addr, &addr->sa_data, ETH_ALEN); - -+ _fec_set_mac_address(dev); -+ -+ return 0; - } - -- /* -- * XXX: We need to clean up on failure exits here. -- * -- * index is only used in legacy code -- */ --int __init fec_enet_init(struct net_device *dev, int index) -+static void fec_enet_free_buffers(struct fec_enet_private *fep) -+{ -+ cbd_t *bdp = fep->rx_bd_base; -+ int i; -+ -+ DBG(0, "%s: Freeing TX bounce buffers %p\n", __FUNCTION__, fep->tx_bounce[0]); -+ kfree(fep->tx_bounce[0]); -+ memset(fep->tx_bounce, 0, TX_RING_SIZE * sizeof(void*)); -+ for (i = 0; i < RX_RING_SIZE; i++, bdp++) { -+ if (fep->rx_skbuff[i] != NULL) { -+ DBG(0, "%s: Freeing RX skb %p\n", __FUNCTION__, fep->rx_skbuff[i]); -+ fec_enet_rxbuf_unmap(fep, bdp, FEC_ENET_RX_FRSIZE); -+ kfree_skb(fep->rx_skbuff[i]); -+ fep->rx_skbuff[i] = NULL; -+ } -+ } -+} -+ -+#ifdef CONFIG_PHYLIB -+/* called by the generic PHY layer in interrupt context */ -+static int phy_regs[32] = { [0 ... ARRAY_SIZE(phy_regs) - 1] = -1}; -+static int fec_mii_read(struct mii_bus *bus, int phy_id, int regnum) - { -+ int ret; -+ struct net_device *dev = bus->priv; - struct fec_enet_private *fep = netdev_priv(dev); -- unsigned long mem_addr; -- volatile cbd_t *bdp; -- cbd_t *cbd_base; -- volatile fec_t *fecp; -- int i, j; -+ unsigned long regval = mk_mii_read(regnum) | phy_id << 23; -+ unsigned long flags; -+ int loops = 0; - -- /* Allocate memory for buffer descriptors. -- */ -- mem_addr = (unsigned long)dma_alloc_coherent(NULL, PAGE_SIZE, -- &fep->bd_dma, GFP_KERNEL); -- if (mem_addr == 0) { -- printk("FEC: allocate descriptor memory failed?\n"); -+ DBG(1, "%s: \n", __FUNCTION__); -+#if 0 -+ DBG(0, "%s: ECR: %08lx\n", __FUNCTION__, fec_reg_read(fep, FEC_ECR)); -+ DBG(0, "%s: EIR: %08lx\n", __FUNCTION__, fec_reg_read(fep, FEC_EIR)); -+ DBG(0, "%s: EIMR: %08lx\n", __FUNCTION__, fec_reg_read(fep, FEC_EIMR)); -+ DBG(0, "%s: RCR: %08lx\n", __FUNCTION__, fec_reg_read(fep, FEC_RCR)); -+ DBG(0, "%s: TCR: %08lx\n", __FUNCTION__, fec_reg_read(fep, FEC_TCR)); -+#endif -+ spin_lock_irqsave(&fep->lock, flags); -+ fep->mii_complete = 0; -+ fec_reg_write(fep, FEC_MMFR, regval); -+ spin_unlock_irqrestore(&fep->lock, flags); -+ -+ while (!fep->mii_complete) { -+ if (loops++ == 1000) { -+ DBG(1, "%s: Waiting for MII completion\n", __FUNCTION__); -+ } -+ cpu_relax(); -+ } -+ if (loops >= 1000) { -+ DBG(1, "%s: MII transaction completed\n", __FUNCTION__); -+ } -+ ret = fec_reg_read(fep, FEC_MMFR); -+ if (ret < 0) { -+ DBG(0, "%s: Failed to read PHY[%02x] reg %02x: %d\n", __FUNCTION__, -+ phy_id, regnum, ret); -+ return ret; -+ } -+ ret &= 0xffff; -+ if (phy_regs[regnum] != ret) { -+ DBG(1, "%s: Read %04x from PHY[%02x] reg %02x\n", __FUNCTION__, -+ ret, phy_id, regnum); -+ phy_regs[regnum] = ret; -+ } -+ return ret; -+} -+ -+static int fec_mii_write(struct mii_bus *bus, int phy_id, int regnum, u16 val) -+{ -+ struct net_device *dev = bus->priv; -+ struct fec_enet_private *fep = netdev_priv(dev); -+ unsigned long regval = mk_mii_write(regnum, val) | phy_id << 23; -+ unsigned long flags; -+ -+ DBG(0, "%s: \n", __FUNCTION__); -+ -+ spin_lock_irqsave(&fep->lock, flags); -+ fep->mii_complete = 0; -+ fec_reg_write(fep, FEC_MMFR, regval); -+ spin_unlock_irqrestore(&fep->lock, flags); -+ -+ while (!fep->mii_complete) { -+ cpu_relax(); -+ } -+ DBG(1, "%s: Wrote %04x to PHY[%02x] reg %02x\n", __FUNCTION__, val, phy_id, regnum); -+ return 0; -+} -+ -+static int fec_mii_reset(struct mii_bus *bus) -+{ -+ DBG(0, "%s: \n", __FUNCTION__); -+ memset(phy_regs, -1, sizeof(phy_regs)); -+ return 0; -+} -+ -+static int fec_init_phy(struct net_device *dev, struct fec_enet_private *fep) -+{ -+ int ret; -+ int i; -+ struct mii_bus *mii; -+ -+ mii = mdiobus_alloc(); -+ if (mii == NULL) { - return -ENOMEM; - } -+ mii->name = "fec mii"; -+ mii->read = fec_mii_read; -+ mii->write = fec_mii_write; -+ mii->reset = fec_mii_reset; -+ mii->priv = dev; -+ snprintf(mii->id, MII_BUS_ID_SIZE, "%x", 0); -+ mii->irq = kmalloc(sizeof(int) * PHY_MAX_ADDR, GFP_KERNEL); -+ for (i = 0; i < PHY_MAX_ADDR; i++) { -+ mii->irq[i] = fep->mii_irq >= 0 ? fep->mii_irq : PHY_POLL; -+ } -+ -+ ret = mdiobus_register(mii); -+ if (ret != 0) { -+ DBG(0, "%s: Failed to register MII bus: %d\n", __FUNCTION__, ret); -+ kfree(mii->irq); -+ mdiobus_free(mii); -+ return ret; -+ } -+ fep->phy_addr = -1; -+ DBG(0, "%s: MII bus registered\n", __FUNCTION__); -+ for (i = 0; i < PHY_MAX_ADDR; i++) { -+ if (mii->phy_map[i] != NULL) { -+ fep->phy_addr = i; -+ break; -+ } -+ } -+ if (fep->phy_addr == -1) { -+ DBG(0, "%s: No PHY found\n", __FUNCTION__); -+ return -ENODEV; -+ } -+ DBG(0, "%s: Using PHY at addr %02x\n", __FUNCTION__, fep->phy_addr); -+ fep->mii = mii; - -- spin_lock_init(&fep->hw_lock); -- spin_lock_init(&fep->mii_lock); -+ return 0; -+} - -- /* Create an Ethernet device instance. -- */ -- fecp = (volatile fec_t *)dev->base_addr; -+static int fec_connect_phy(struct net_device *dev, struct fec_enet_private *fep) -+{ -+ struct mii_bus *mii = fep->mii; - -- fep->index = index; -- fep->hwp = fecp; -- fep->netdev = dev; -+ DBG(0, "%s: Connecting PHY at addr %02x\n", __FUNCTION__, -+ fep->phy_addr); - -- /* Whack a reset. We should wait for this. -- */ -- fecp->fec_ecntrl = 1; -- udelay(10); -+ fep->phy = phy_connect(dev, dev_name(&mii->phy_map[fep->phy_addr]->dev), -+ fec_link_change, 0, mii->phy_map[fep->phy_addr]->interface); -+ if (IS_ERR(fep->phy)) { -+ int ret = PTR_ERR(fep->phy); -+ printk(KERN_ERR "%s: Could not attach to PHY\n", dev->name); -+ fep->phy = NULL; -+ return ret; -+ } -+ DBG(0, "%s: Registered PHY %s[%02x] IRQ %d with %s\n", __FUNCTION__, -+ dev_name(&fep->phy->dev), fep->phy_addr, fep->phy->irq, dev->name); - -- /* Set the Ethernet address */ --#ifdef CONFIG_M5272 -- fec_get_mac(dev); -+ return 0; -+} - #else -- { -- unsigned long l; -- l = fecp->fec_addr_low; -- dev->dev_addr[0] = (unsigned char)((l & 0xFF000000) >> 24); -- dev->dev_addr[1] = (unsigned char)((l & 0x00FF0000) >> 16); -- dev->dev_addr[2] = (unsigned char)((l & 0x0000FF00) >> 8); -- dev->dev_addr[3] = (unsigned char)((l & 0x000000FF) >> 0); -- l = fecp->fec_addr_high; -- dev->dev_addr[4] = (unsigned char)((l & 0xFF000000) >> 24); -- dev->dev_addr[5] = (unsigned char)((l & 0x00FF0000) >> 16); -- } -+static int fec_init_phy(struct net_device *dev, struct fec_enet_private *fep) -+{ -+ /* Queue up command to detect the PHY and initialize the -+ * remainder of the interface. -+ */ -+ fep->phy_id_done = 0; -+ fep->phy_addr = 0; -+ mii_queue(dev, mk_mii_read(MII_REG_PHYIR1), mii_discover_phy); -+ -+ return 0; -+} - #endif - -- cbd_base = (cbd_t *)mem_addr; -+/* Initialize the FEC Ethernet on 860T (or ColdFire 5272). -+ */ -+ /* -+ * 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; -+ struct fec_enet_private *fep = netdev_priv(dev); -+ cbd_t *bdp; -+ struct sk_buff *pskb; -+ int i; -+ void *mem; -+ -+ spin_lock_init(&fep->lock); -+ -+ /* Whack a reset. We should wait for this. - */ -- fep->rx_bd_base = cbd_base; -- fep->tx_bd_base = cbd_base + RX_RING_SIZE; -+ fec_reg_write(fep, FEC_ECR, FEC_ECR_RESET); -+ udelay(10); -+ -+ /* Set the Ethernet address. If using multiple Enets on the 8xx, -+ * this needs some work to get unique addresses. -+ * -+ * This is our default MAC address unless the user changes -+ * it via eth_mac_addr (our dev->set_mac_addr handler). -+ */ -+ fec_get_mac(dev); - - fep->dirty_tx = fep->cur_tx = fep->tx_bd_base; - fep->cur_rx = fep->rx_bd_base; - - fep->skb_cur = fep->skb_dirty = 0; - -- /* Initialize the receive buffer descriptors. -+ /* allocate memory for TX bounce buffers */ -+ mem = kzalloc(TX_RING_SIZE * FEC_ENET_TX_FRSIZE, GFP_KERNEL); -+ if (mem == NULL) { -+ return -ENOMEM; -+ } -+ -+ fec_enet_cbd_get(fep); -+ -+ /* Initialize the transmit buffer descriptors. - */ -- bdp = fep->rx_bd_base; -- for (i=0; itx_bd_base; - -- /* Allocate a page. -- */ -- mem_addr = __get_free_page(GFP_KERNEL); -- /* XXX: missing check for allocation failure */ -+ DBG(0, "%s: Allocated %d byte of TX buffer memory @ %p\n", __FUNCTION__, -+ TX_RING_SIZE * FEC_ENET_TX_FRSIZE, mem); -+ for (i = 0; i < TX_RING_SIZE; i++) { -+ fep->tx_bounce[i] = mem; -+ DBG(0, "%s: TX bounce buffer[%d]=%p\n", __FUNCTION__, i, fep->tx_bounce[i]); -+ mem = (void *)((unsigned long)(mem + FEC_ENET_TX_FRSIZE)); - - /* Initialize the BD for every fragment in the page. - */ -- for (j=0; jcbd_sc = BD_ENET_RX_EMPTY; -- bdp->cbd_bufaddr = __pa(mem_addr); -- mem_addr += FEC_ENET_RX_FRSIZE; -- bdp++; -- } -+ bdp->cbd_bufaddr = ~0; -+ bdp++; - } - - /* Set the last buffer to wrap. -@@ -1757,87 +2572,88 @@ int __init fec_enet_init(struct net_devi - bdp--; - bdp->cbd_sc |= BD_SC_WRAP; - -- /* ...and the same for transmmit. -+ /* ...and the same for receive. - */ -- bdp = fep->tx_bd_base; -- for (i=0, j=FEC_ENET_TX_FRPPG; i= FEC_ENET_TX_FRPPG) { -- mem_addr = __get_free_page(GFP_KERNEL); -- j = 1; -- } else { -- mem_addr += FEC_ENET_TX_FRSIZE; -- j++; -+ bdp = fep->rx_bd_base; -+ for (i = 0; i < RX_RING_SIZE; i++, bdp++) { -+ pskb = __dev_alloc_skb(FEC_ENET_RX_FRSIZE, GFP_KERNEL); -+ if (pskb == NULL) { -+ DBG(0, "%s: Failed to allocate RX skb; cleaning up\n", __FUNCTION__); -+ ret = -ENOMEM; -+ goto cleanup; - } -- fep->tx_bounce[i] = (unsigned char *) mem_addr; -- -- /* Initialize the BD for every fragment in the page. -- */ -- bdp->cbd_sc = 0; -- bdp->cbd_bufaddr = 0; -- bdp++; -+ DBG(0, "%s: RX skb allocated @ %p\n", __FUNCTION__, pskb); -+ fep->rx_skbuff[i] = pskb; -+ pskb->data = FEC_ADDR_ALIGNMENT(pskb->data); -+ bdp->cbd_sc = BD_ENET_RX_EMPTY; -+ bdp->cbd_bufaddr = ~0; -+ fec_enet_rxbuf_map(fep, bdp, pskb->data, FEC_ENET_RX_FRSIZE); - } -- - /* Set the last buffer to wrap. - */ - bdp--; - bdp->cbd_sc |= BD_SC_WRAP; -+ fec_enet_cbd_put(fep); - - /* Set receive and transmit descriptor base. - */ -- fecp->fec_r_des_start = fep->bd_dma; -- fecp->fec_x_des_start = (unsigned long)fep->bd_dma + sizeof(cbd_t) -- * RX_RING_SIZE; -- --#ifdef HAVE_mii_link_interrupt -- fec_request_mii_intr(dev); --#endif -- -- fecp->fec_grp_hash_table_high = 0; -- fecp->fec_grp_hash_table_low = 0; -- fecp->fec_r_buff_size = PKT_MAXBLR_SIZE; -- fecp->fec_ecntrl = 2; -- fecp->fec_r_des_active = 0; --#ifndef CONFIG_M5272 -- fecp->fec_hash_table_high = 0; -- fecp->fec_hash_table_low = 0; --#endif -+ fec_reg_write(fep, FEC_ERDSR, fep->cbd_phys_base); -+ fec_reg_write(fep, FEC_ETDSR, fep->cbd_phys_base + RX_RING_SIZE * sizeof(cbd_t)); - -+ /* Install our interrupt handlers. This varies depending on -+ * the architecture. -+ */ -+ ret = fec_request_intrs(pdev, dev); -+ if (ret != 0) { -+ goto cleanup; -+ } -+ /* Clear and enable interrupts */ -+ fec_reg_write(fep, FEC_EIR, fec_reg_read(fep, FEC_EIR)); -+ fec_reg_write(fep, FEC_EIMR, FEC_ENET_TXF | FEC_ENET_TXB | -+ FEC_ENET_RXF | FEC_ENET_RXB | FEC_ENET_MII); -+ -+ fec_reg_write(fep, FEC_IAUR, 0); -+ fec_reg_write(fep, FEC_IALR, 0); -+ fec_reg_write(fep, FEC_EMRBR, PKT_MAXBLR_SIZE); -+ fec_reg_write(fep, FEC_ECR, FEC_ECR_ETHER_EN); -+ fec_localhw_setup(dev); -+#if 0 -+ /* do this in enet_open()! */ -+ fec_reg_write(fep, FEC_RDAR, DONT_CARE); -+#endif - /* The FEC Ethernet specific entries in the device structure. */ - dev->open = fec_enet_open; - dev->hard_start_xmit = fec_enet_start_xmit; - dev->tx_timeout = fec_timeout; - dev->watchdog_timeo = TX_TIMEOUT; - dev->stop = fec_enet_close; -+ dev->get_stats = fec_enet_get_stats; - dev->set_multicast_list = set_multicast_list; -+ dev->set_mac_address = fec_set_mac_address; - -- for (i=0; ifec_r_cntrl = OPT_FRAME_SIZE | 0x04; -- fecp->fec_x_cntrl = 0x00; -- -- /* -- * Set MII speed to 2.5 MHz -- */ -- fep->phy_speed = ((((clk_get_rate(fep->clk) / 2 + 4999999) -- / 2500000) / 2) & 0x3F) << 1; -- fecp->fec_mii_speed = fep->phy_speed; -- fec_restart(dev, 0); -- -- /* Clear and enable interrupts */ -- fecp->fec_ievent = 0xffc00000; -- fecp->fec_imask = (FEC_ENET_TXF | FEC_ENET_RXF | FEC_ENET_MII); -- -- /* Queue up command to detect the PHY and initialize the -- * remainder of the interface. -- */ -- fep->phy_id_done = 0; -- fep->phy_addr = 0; -- mii_queue(dev, mk_mii_read(MII_REG_PHYIR1), mii_discover_phy); -+ ret = fec_set_mii(dev, fep); -+ if (ret) { -+ DBG(0, "%s: Failed to initialize MII interface: %d\n", __FUNCTION__, ret); -+ goto cleanup; -+ } - -+ ret = fec_init_phy(dev, fep); -+ if (ret) { -+ DBG(0, "%s: Failed to initialize PHY: %d\n", __FUNCTION__, ret); -+ goto cleanup; -+ } - return 0; -+ cleanup: -+ fec_enet_free_buffers(fep); -+ fec_enet_cbd_put(fep); -+ return ret; - } - - /* 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 - static void - fec_restart(struct net_device *dev, int duplex) - { -- struct fec_enet_private *fep; -- volatile cbd_t *bdp; -- volatile fec_t *fecp; -+ struct fec_enet_private *fep = netdev_priv(dev); -+ cbd_t *bdp; - int i; -+ u32 rcr = OPT_FRAME_SIZE | RCR_MII_MODE; /* MII enable */ -+ u32 tcr = TCR_HBC; - -- fep = netdev_priv(dev); -- fecp = fep->hwp; -- -+ DBG(0, "%s: Restarting FEC in %s-duplex mode\n", __FUNCTION__, -+ duplex ? "full" : "half"); - /* Whack a reset. We should wait for this. -- */ -- fecp->fec_ecntrl = 1; -+ */ -+ fec_reg_write(fep, FEC_ECR, FEC_ECR_RESET); - udelay(10); - -+ /* Enable interrupts we wish to service. -+ */ -+ fec_reg_write(fep, FEC_EIMR, FEC_ENET_TXF | FEC_ENET_TXB | -+ FEC_ENET_RXF | FEC_ENET_RXB | FEC_ENET_MII); -+ - /* Clear any outstanding interrupt. -- */ -- fecp->fec_ievent = 0xffc00000; -+ * -+ */ -+ fec_reg_write(fep, FEC_EIR, FEC_ENET_MASK); -+ -+ fec_enable_phy_intr(fep); - - /* Set station address. -- */ -- fec_set_mac_address(dev); -+ */ -+ _fec_set_mac_address(dev); - - /* Reset all multicast. -- */ -- fecp->fec_grp_hash_table_high = 0; -- fecp->fec_grp_hash_table_low = 0; -+ */ -+ fec_reg_write(fep, FEC_IAUR, 0); -+ fec_reg_write(fep, FEC_IALR, 0); - - /* Set maximum receive buffer size. -- */ -- fecp->fec_r_buff_size = PKT_MAXBLR_SIZE; -+ */ -+ fec_reg_write(fep, FEC_EMRBR, PKT_MAXBLR_SIZE); - - /* Set receive and transmit descriptor base. -- */ -- fecp->fec_r_des_start = fep->bd_dma; -- fecp->fec_x_des_start = (unsigned long)fep->bd_dma + sizeof(cbd_t) -- * RX_RING_SIZE; -+ */ -+ fec_reg_write(fep, FEC_ERDSR, fep->cbd_phys_base); -+ fec_reg_write(fep, FEC_ETDSR, fep->cbd_phys_base + RX_RING_SIZE * sizeof(cbd_t)); - - fep->dirty_tx = fep->cur_tx = fep->tx_bd_base; - fep->cur_rx = fep->rx_bd_base; - - /* Reset SKB transmit buffers. -- */ -+ */ - fep->skb_cur = fep->skb_dirty = 0; -- for (i=0; i<=TX_RING_MOD_MASK; i++) { -+ bdp = fep->tx_bd_base; -+ for (i = 0; i <= TX_RING_MOD_MASK; i++) { - if (fep->tx_skbuff[i] != NULL) { -- dev_kfree_skb_any(fep->tx_skbuff[i]); -- fep->tx_skbuff[i] = NULL; -+ fec_free_skb(fep, bdp, &fep->tx_skbuff[i]); -+ bdp++; - } - } - - /* Initialize the receive buffer descriptors. -- */ -+ */ - bdp = fep->rx_bd_base; -- for (i=0; icbd_sc = BD_ENET_RX_EMPTY; -@@ -1908,246 +2731,366 @@ fec_restart(struct net_device *dev, int - } - - /* Set the last buffer to wrap. -- */ -+ */ - bdp--; - bdp->cbd_sc |= BD_SC_WRAP; - - /* ...and the same for transmmit. -- */ -+ */ - bdp = fep->tx_bd_base; -- for (i=0; icbd_sc = 0; -- bdp->cbd_bufaddr = 0; -+ bdp->cbd_bufaddr = ~0; - bdp++; - } - - /* Set the last buffer to wrap. -- */ -+ */ - bdp--; - bdp->cbd_sc |= BD_SC_WRAP; - - /* Enable MII mode. -- */ -+ */ - if (duplex) { -- fecp->fec_r_cntrl = OPT_FRAME_SIZE | 0x04;/* MII enable */ -- fecp->fec_x_cntrl = 0x04; /* FD enable */ -+ tcr |= TCR_FDEN; /* FD enable */ - } else { -- /* MII enable|No Rcv on Xmit */ -- fecp->fec_r_cntrl = OPT_FRAME_SIZE | 0x06; -- fecp->fec_x_cntrl = 0x00; -+ rcr |= RCR_DRT; /* No Rcv on Xmit */ - } -+ fec_reg_write(fep, FEC_RCR, rcr); -+ fec_reg_write(fep, FEC_TCR, tcr); - fep->full_duplex = duplex; - - /* Set MII speed. -- */ -- fecp->fec_mii_speed = fep->phy_speed; -+ */ -+ fec_reg_write(fep, FEC_MSCR, fep->phy_speed); - - /* And last, enable the transmit and receive processing. -- */ -- fecp->fec_ecntrl = 2; -- fecp->fec_r_des_active = 0; -+ */ -+ fec_reg_write(fep, FEC_ECR, FEC_ECR_ETHER_EN); -+ fec_localhw_setup(dev); -+ fec_reg_write(fep, FEC_RDAR, DONT_CARE); - -- /* Enable interrupts we wish to service. -- */ -- fecp->fec_imask = (FEC_ENET_TXF | FEC_ENET_RXF | FEC_ENET_MII); -+ DBG(0, "%s: Starting netif queue\n", __FUNCTION__); -+ netif_start_queue(dev); - } - - static void - fec_stop(struct net_device *dev) - { -- volatile fec_t *fecp; -- struct fec_enet_private *fep; -+ struct fec_enet_private *fep = netdev_priv(dev); - -- fep = netdev_priv(dev); -- fecp = fep->hwp; -+ DBG(0, "%s: Stopping netif queue\n", __FUNCTION__); -+ netif_stop_queue(dev); - - /* -- ** We cannot expect a graceful transmit stop without link !!! -- */ -- if (fep->link) -- { -- fecp->fec_x_cntrl = 0x01; /* Graceful transmit stop */ -+ * We cannot expect a graceful transmit stop without link! -+ */ -+ if (fep->linkstatus) { -+ fec_reg_write(fep, FEC_TCR, 0x01); /* Graceful transmit stop */ - udelay(10); -- if (!(fecp->fec_ievent & FEC_ENET_GRA)) -- printk("fec_stop : Graceful transmit stop did not complete !\n"); -- } -- -+ if (!(fec_reg_read(fep, FEC_EIR) & FEC_ENET_GRA)) -+ dev_warn(&dev->dev, "Graceful transmit stop did not complete!\n"); -+ } -+#if 0 - /* Whack a reset. We should wait for this. -- */ -- fecp->fec_ecntrl = 1; -+ */ -+ fec_reg_write(fep, FEC_ECR, FEC_ECR_RESET); - udelay(10); -- -- /* Clear outstanding MII command interrupts. -- */ -- fecp->fec_ievent = FEC_ENET_MII; -- -- fecp->fec_imask = FEC_ENET_MII; -- fecp->fec_mii_speed = fep->phy_speed; -+ /* Mask and clear outstanding MII command interrupts. -+ */ -+ fec_reg_write(fep, FEC_EIMR, 0); -+ fec_reg_write(fep, FEC_EIR, FEC_ENET_MII); -+ fec_enable_phy_intr(fep); -+ fec_reg_write(fep, FEC_MSCR, fep->phy_speed); -+#endif - } - --static int __devinit --fec_probe(struct platform_device *pdev) -+static int __devinit fec_enet_probe(struct platform_device *pdev) - { -+ int ret; - struct fec_enet_private *fep; -- struct net_device *ndev; -- int i, irq, ret = 0; -- struct resource *r; -- -- r = platform_get_resource(pdev, IORESOURCE_MEM, 0); -- if (!r) -- return -ENXIO; -+ struct net_device *dev; -+ struct fec_enet_platform_data *pdata = pdev->dev.platform_data; -+ struct resource *res_mem1; -+ struct resource *res_mem2; -+ -+ res_mem1 = platform_get_resource(pdev, IORESOURCE_MEM, 0); -+ if (res_mem1 == NULL) { -+ return -ENODEV; -+ } - -- r = request_mem_region(r->start, resource_size(r), pdev->name); -- if (!r) -+ res_mem1 = request_mem_region(res_mem1->start, -+ resource_size(res_mem1), -+ DRV_NAME); -+ if (res_mem1 == NULL) { - return -EBUSY; -+ } -+ res_mem2 = platform_get_resource(pdev, IORESOURCE_MEM, 1); -+ if (res_mem2 != NULL) { -+ res_mem2 = request_mem_region(res_mem2->start, -+ resource_size(res_mem2), -+ DRV_NAME); -+ if (res_mem2 == NULL) { -+ ret = -EBUSY; -+ goto release1; -+ } -+ } - -- /* Init network device */ -- ndev = alloc_etherdev(sizeof(struct fec_enet_private)); -- if (!ndev) -- return -ENOMEM; -- -- SET_NETDEV_DEV(ndev, &pdev->dev); -- -- /* setup board info structure */ -- fep = netdev_priv(ndev); -- memset(fep, 0, sizeof(*fep)); -+ dev = alloc_etherdev(sizeof(struct fec_enet_private)); -+ if (dev == NULL) { -+ ret = -ENOMEM; -+ goto release2; -+ } -+ platform_set_drvdata(pdev, dev); -+ fep = netdev_priv(dev); -+ fep->res_mem1 = res_mem1; -+ fep->res_mem2 = res_mem2; -+ fep->dma_dev = &pdev->dev; -+ -+ fep->reg_base = ioremap(res_mem1->start, resource_size(res_mem1)); -+ if (fep->reg_base == NULL) { -+ printk("FEC: Mapping FEC registers failed\n"); -+ ret = -ENOMEM; -+ goto free_netdev; -+ } -+ DBG(0, "%s: FEC registers @ %08lx mapped to %p\n", __FUNCTION__, -+ (unsigned long)res_mem1->start, fep->reg_base); - -- ndev->base_addr = (unsigned long)ioremap(r->start, resource_size(r)); -+ fep->mib_base = ioremap(res_mem2->start, resource_size(res_mem2)); -+ if (fep->mib_base == NULL) { -+ printk("FEC: Mapping FEC registers failed\n"); -+ ret = -ENOMEM; -+ goto unmap1; -+ } -+ DBG(0, "%s: FEC registers @ %08lx mapped to %p\n", __FUNCTION__, -+ (unsigned long)res_mem2->start, fep->mib_base); - -- if (!ndev->base_addr) { -+ /* Allocate memory for buffer descriptors. */ -+ fep->cbd_mem_base = dma_alloc_coherent(&pdev->dev, CBD_BUF_SIZE, -+ &fep->cbd_phys_base, -+ GFP_KERNEL); -+ if (fep->cbd_mem_base == NULL) { -+ printk("FEC: allocate descriptor memory failed\n"); - ret = -ENOMEM; -- goto failed_ioremap; -+ goto unmap2; - } -+ DBG(0, "%s: Allocated %lu [(%u + %lu) * %d] byte for CBD buffer @ %p[%08lx]\n", -+ __FUNCTION__, CBD_BUF_SIZE, TX_RING_SIZE, RX_RING_SIZE, -+ sizeof(cbd_t), fep->cbd_mem_base, -+ (unsigned long)fep->cbd_phys_base); - -- platform_set_drvdata(pdev, ndev); -+ /* Set receive and transmit descriptor base. -+ */ -+ fep->rx_bd_base = fep->cbd_mem_base; -+ fep->tx_bd_base = fep->rx_bd_base + RX_RING_SIZE; - -- /* This device has up to three irqs on some platforms */ -- for (i = 0; i < 3; i++) { -- irq = platform_get_irq(pdev, i); -- if (i && irq < 0) -- break; -- ret = request_irq(irq, fec_enet_interrupt, IRQF_DISABLED, pdev->name, ndev); -- if (ret) { -- while (i >= 0) { -- irq = platform_get_irq(pdev, i); -- free_irq(irq, ndev); -- i--; -- } -- goto failed_irq; -- } -+ printk("FEC ENET Driver\n"); -+ ret = platform_func(pdata->arch_init, pdev); -+ if (ret != 0) { -+ dev_err(&pdev->dev, "platform init failed: %d\n", ret); -+ goto free_dma; - } - -- fep->clk = clk_get(&pdev->dev, "fec_clk"); -- if (IS_ERR(fep->clk)) { -- ret = PTR_ERR(fep->clk); -- goto failed_clk; -+ ret = fec_enet_init(pdev, dev); -+ if (ret != 0) { -+ goto fec_disable; - } -- clk_enable(fep->clk); - -- ret = fec_enet_init(ndev, 0); -- if (ret) -- goto failed_init; -+ /* Enable most messages by default */ -+ fep->msg_enable = (NETIF_MSG_IFUP << 1) - 1; -+ ret = register_netdev(dev); -+ if (ret != 0) { -+ /* XXX: missing cleanup here */ -+ goto free_buffers; -+ } - -- ret = register_netdev(ndev); -- if (ret) -- goto failed_register; -+ printk(KERN_INFO "%s: ethernet %02x:%02x:%02x:%02x:%02x:%02x\n", dev->name, -+ dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2], -+ dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5]); - - return 0; - --failed_register: --failed_init: -- clk_disable(fep->clk); -- clk_put(fep->clk); --failed_clk: -- for (i = 0; i < 3; i++) { -- irq = platform_get_irq(pdev, i); -- if (irq > 0) -- free_irq(irq, ndev); -- } --failed_irq: -- iounmap((void __iomem *)ndev->base_addr); --failed_ioremap: -- free_netdev(ndev); -+ free_buffers: -+ fec_enet_free_buffers(fep); -+ -+ fec_disable: -+ platform_func(pdata->arch_exit, pdev); -+ -+ free_dma: -+ dma_free_coherent(&pdev->dev, CBD_BUF_SIZE, fep->cbd_mem_base, fep->cbd_phys_base); -+ -+ unmap2: -+ if (fep->mib_base) -+ iounmap(fep->mib_base); -+ -+ unmap1: -+ iounmap(fep->reg_base); -+ -+ free_netdev: -+ free_netdev(dev); -+ -+ release2: -+ if (res_mem2 != NULL) { -+ release_resource(res_mem2); -+ } -+ -+ release1: -+ release_resource(res_mem1); - - return ret; - } - --static int __devexit --fec_drv_remove(struct platform_device *pdev) -+static int __devexit fec_enet_remove(struct platform_device *pdev) - { -- struct net_device *ndev = platform_get_drvdata(pdev); -- struct fec_enet_private *fep = netdev_priv(ndev); -+ struct net_device *dev = platform_get_drvdata(pdev); -+ 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); -+ mdiobus_unregister(fep->mii); -+ } -+ mdiobus_free(fep->mii); -+#endif -+ fec_release_intrs(dev); -+ -+ DBG(0, "%s: Unmapping FEC registers %p\n", __FUNCTION__, fep->reg_base); -+ iounmap(fep->reg_base); -+ if (fep->mib_base) -+ iounmap(fep->mib_base); -+ -+ fec_enet_free_buffers(fep); - -- platform_set_drvdata(pdev, NULL); -+ DBG(0, "%s: Freeing CBD buffer area %p[%08lx]\n", __FUNCTION__, -+ fep->cbd_mem_base, (unsigned long)fep->cbd_phys_base); -+ dma_free_coherent(&pdev->dev, CBD_BUF_SIZE, fep->cbd_mem_base, fep->cbd_phys_base); - -- fec_stop(ndev); -- clk_disable(fep->clk); -- clk_put(fep->clk); -- iounmap((void __iomem *)ndev->base_addr); -- unregister_netdev(ndev); -- free_netdev(ndev); -+ release_resource(fep->res_mem1); -+ if (fep->res_mem2 != NULL) { -+ release_resource(fep->res_mem2); -+ } - return 0; - } - --static int --fec_suspend(struct platform_device *dev, pm_message_t state) -+static void fec_enet_shutdown(struct platform_device *pdev) - { -- struct net_device *ndev = platform_get_drvdata(dev); -- struct fec_enet_private *fep; -+ struct fec_enet_platform_data *pdata = pdev->dev.platform_data; -+ -+ DBG(0, "%s: Shutting down FEC Hardware\n", __FUNCTION__); -+ platform_func(pdata->arch_exit, pdev); -+} -+ -+#ifdef CONFIG_PM -+static int fec_enet_suspend(struct platform_device *pdev, pm_message_t state) -+{ -+ int ret; -+ struct fec_enet_platform_data *pdata = pdev->dev.platform_data; -+ struct net_device *ndev = platform_get_drvdata(pdev); -+ struct fec_enet_private *fep = netdev_priv(ndev); - -- if (ndev) { -- fep = netdev_priv(ndev); -- if (netif_running(ndev)) { -- netif_device_detach(ndev); -- fec_stop(ndev); -+ if (netif_running(ndev)) { -+ DBG(0, "%s: Detaching netif\n", __FUNCTION__); -+ netif_device_detach(ndev); -+#ifdef CONFIG_PHYLIB -+ DBG(0, "%s: Disconnecting PHY %p\n", __FUNCTION__, fep->phy); -+ phy_disconnect(fep->phy); -+ fep->phy = NULL; -+#endif -+ } -+#ifndef CONFIG_PHYLIB -+ if (fep->phy_timer) { -+ ret = del_timer_sync(fep->phy_timer); -+ if (ret != 0) { -+ DBG(0, "%s: Failed to delete PHY timer: %d\n", __FUNCTION__, ret); -+ return ret; - } - } -- return 0; -+#endif -+ DBG(0, "%s: Shutting down FEC Hardware %d\n", __FUNCTION__, -+ netif_running(ndev)); -+ ret = platform_func(pdata->suspend, pdev); -+ if (ret != 0 && netif_running(ndev)) { -+ DBG(0, "%s: Failed to suspend: %d\n", __FUNCTION__, ret); -+ /* Undo suspend */ -+#ifdef CONFIG_PHYLIB -+ DBG(0, "%s: Reconnecting PHY\n", __FUNCTION__); -+ if (fec_connect_phy(ndev, fep) != 0) { -+ DBG(0, "%s: Failed to connect to PHY\n", __FUNCTION__); -+ return ret; -+ } -+ phy_start(fep->phy); -+#endif -+ fec_link_change(ndev); -+ netif_device_attach(ndev); -+ } -+ return ret; - } - --static int --fec_resume(struct platform_device *dev) -+static int fec_enet_resume(struct platform_device *pdev) - { -- struct net_device *ndev = platform_get_drvdata(dev); -+ int ret; -+ struct fec_enet_platform_data *pdata = pdev->dev.platform_data; -+ struct net_device *ndev = platform_get_drvdata(pdev); - -- if (ndev) { -- if (netif_running(ndev)) { -- fec_enet_init(ndev, 0); -- netif_device_attach(ndev); -+ DBG(0, "%s: Powering up FEC Hardware %d\n", __FUNCTION__, -+ netif_running(ndev)); -+ ret = platform_func(pdata->resume, pdev); -+ if (ret != 0) { -+ DBG(0, "%s: Failed to resume: %d\n", __FUNCTION__, ret); -+ return ret; -+ } -+ if (netif_running(ndev)) { -+#ifdef CONFIG_PHYLIB -+ struct fec_enet_private *fep = netdev_priv(ndev); -+ -+ DBG(0, "%s: Reconnecting PHY\n", __FUNCTION__); -+ ret = fec_connect_phy(ndev, fep); -+ if (ret != 0) { -+ DBG(0, "%s: Failed to connect to PHY: %d\n", __FUNCTION__, ret); -+ return ret; - } -+ phy_start(fep->phy); -+#endif -+ fec_link_change(ndev); -+ netif_device_attach(ndev); - } - return 0; - } -+#else -+#define fec_enet_suspend NULL -+#define fec_enet_resume NULL -+#endif - --static struct platform_driver fec_driver = { -- .driver = { -- .name = "fec", -- .owner = THIS_MODULE, -+static struct platform_driver fec_enet_driver = { -+ .driver = { -+ .name = DRV_NAME, - }, -- .probe = fec_probe, -- .remove = __devexit_p(fec_drv_remove), -- .suspend = fec_suspend, -- .resume = fec_resume, -+ .probe = fec_enet_probe, -+ .remove = __devexit_p(fec_enet_remove), -+ .shutdown = fec_enet_shutdown, -+ .suspend = fec_enet_suspend, -+ .resume = fec_enet_resume, - }; - --static int __init --fec_enet_module_init(void) -+static int __init fec_enet_module_init(void) - { -- printk(KERN_INFO "FEC Ethernet Driver\n"); -+ int ret; -+ -+ ret = platform_driver_register(&fec_enet_driver); - -- return platform_driver_register(&fec_driver); -+ return ret; - } -+module_init(fec_enet_module_init); - --static void __exit --fec_enet_cleanup(void) -+static void __exit fec_enet_module_cleanup(void) - { -- platform_driver_unregister(&fec_driver); -+ platform_driver_unregister(&fec_enet_driver); - } -- --module_exit(fec_enet_cleanup); --module_init(fec_enet_module_init); -+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 -@@ -13,6 +13,15 @@ - #define FEC_H - /****************************************************************************/ - -+/* -+ * dummy value to write into RDAR,TDAR. FEC hardware will scan the TX/RX -+ * descriptors in memory upon any write access to those registers. -+ * The actual value written to those registers does not matter. -+*/ -+#define DONT_CARE 0 -+#define RDAR_BUSY (1 << 24) -+#define TDAR_BUSY (1 << 24) -+ - #if defined(CONFIG_M523x) || defined(CONFIG_M527x) || defined(CONFIG_M528x) || \ - defined(CONFIG_M520x) || defined(CONFIG_M532x) || defined(CONFIG_ARCH_MXC) - /* -@@ -20,6 +29,36 @@ - * registers in the same peripheral device on different models - * of the ColdFire! - */ -+// relying on structure alignment for hardware register is just evil -+#ifndef GARBAGE -+#define FEC_EIR 0x004 -+#define FEC_EIMR 0x008 -+#define FEC_RDAR 0x010 -+#define FEC_TDAR 0x014 -+#define FEC_ECR 0x024 -+#define FEC_MMFR 0x040 -+#define FEC_MSCR 0x044 -+#define FEC_MIBC 0x064 -+#define FEC_RCR 0x084 -+#define FEC_TCR 0x0c4 -+#define FEC_PALR 0x0e4 -+#define FEC_PAUR 0x0e8 -+#define FEC_OPD 0x0ec -+#define FEC_IAUR 0x118 -+#define FEC_IALR 0x11c -+#define FEC_GAUR 0x120 -+#define FEC_GALR 0x124 -+#define FEC_TFWR 0x144 -+#define FEC_FRBR 0x14c -+#define FEC_FRSR 0x150 -+#define FEC_ERDSR 0x180 -+#define FEC_ETDSR 0x184 -+#define FEC_EMRBR 0x188 -+ -+#define FEC_ECR_RESET (1 << 0) -+#define FEC_ECR_ETHER_EN (1 << 1) -+#else -+ - typedef struct fec { - unsigned long fec_reserved0; - unsigned long fec_ievent; /* Interrupt event reg */ -@@ -57,6 +96,7 @@ typedef struct fec { - unsigned long fec_x_des_start; /* Transmit descriptor ring */ - unsigned long fec_r_buff_size; /* Maximum receive buff size */ - } fec_t; -+#endif - - #else - -@@ -88,8 +128,8 @@ typedef struct fec { - unsigned long fec_reserved7[158]; - unsigned long fec_addr_low; /* Low 32bits MAC address */ - unsigned long fec_addr_high; /* High 16bits MAC address */ -- unsigned long fec_grp_hash_table_high;/* High 32bits hash table */ -- unsigned long fec_grp_hash_table_low; /* Low 32bits hash table */ -+ unsigned long fec_hash_table_high; /* High 32bits hash table */ -+ unsigned long fec_hash_table_low; /* Low 32bits hash table */ - unsigned long fec_r_des_start; /* Receive descriptor ring */ - unsigned long fec_x_des_start; /* Transmit descriptor ring */ - unsigned long fec_r_buff_size; /* Maximum receive buff size */ -@@ -103,17 +143,20 @@ typedef struct fec { - /* - * Define the buffer descriptor structure. - */ --#ifdef CONFIG_ARCH_MXC -+/* Please see "Receive Buffer Descriptor Field Definitions" in Specification. -+ * It's LE. -+ */ -+#if defined(CONFIG_ARCH_MXC) - typedef struct bufdesc { -- unsigned short cbd_datlen; /* Data length */ -- unsigned short cbd_sc; /* Control and status info */ -- unsigned long cbd_bufaddr; /* Buffer address */ -+ unsigned short cbd_datlen; /* Data length */ -+ unsigned short cbd_sc; /* Control and status info */ -+ dma_addr_t cbd_bufaddr; /* Buffer address as seen by FEC Hardware */ - } cbd_t; - #else - typedef struct bufdesc { - unsigned short cbd_sc; /* Control and status info */ - unsigned short cbd_datlen; /* Data length */ -- unsigned long cbd_bufaddr; /* Buffer address */ -+ dma_addr_t cbd_bufaddr; /* Buffer address */ - } cbd_t; - #endif - -@@ -121,7 +164,7 @@ typedef struct bufdesc { - * The following definitions courtesy of commproc.h, which where - * Copyright (c) 1997 Dan Malek (dmalek@jlc.net). - */ --#define BD_SC_EMPTY ((ushort)0x8000) /* Recieve is empty */ -+#define BD_SC_EMPTY ((ushort)0x8000) /* Receive is empty */ - #define BD_SC_READY ((ushort)0x8000) /* Transmit is ready */ - #define BD_SC_WRAP ((ushort)0x2000) /* Last buffer descriptor */ - #define BD_SC_INTRPT ((ushort)0x1000) /* Interrupt on change */ -@@ -168,5 +211,22 @@ typedef struct bufdesc { - #define BD_ENET_TX_STATS ((ushort)0x03ff) /* All status bits */ - - -+#define RCR_LOOP (1 << 0) -+#define RCR_DRT (1 << 1) -+#define RCR_MII_MODE (1 << 2) -+#define RCR_PROM (1 << 3) -+#define RCR_BC_REJ (1 << 4) -+#define RCR_FCE (1 << 5) -+#define RCR_MAX_FL_SHIFT 16 -+#define RCR_MAX_FL_MASK (0x7ff << (RCR_MAX_FL_SHIFT)) -+#define RCR_MAX_FL_set(n) (((n) << (RCR_MAX_FL_SHIFT)) & (RCR_MAX_FL_MASK)) -+#define RCR_MAX_FL_get(n) (((n) & (RCR_MAX_FL_MASK)) >> (RCR_MAX_FL_SHIFT)) -+ -+#define TCR_GTS (1 << 0) -+#define TCR_HBC (1 << 1) -+#define TCR_FDEN (1 << 2) -+#define TCR_TFCPAUSE (1 << 3) -+#define TCR_RFCPAUSE (1 << 4) -+ - /****************************************************************************/ - #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 -@@ -570,7 +570,7 @@ static int imxfb_resume(struct platform_ - #define imxfb_resume NULL - #endif - --static int __init imxfb_init_fbinfo(struct platform_device *pdev) -+static int __devinit imxfb_init_fbinfo(struct platform_device *pdev) - { - struct imx_fb_platform_data *pdata = pdev->dev.platform_data; - struct fb_info *info = dev_get_drvdata(&pdev->dev); -@@ -636,7 +636,7 @@ static int __init imxfb_init_fbinfo(stru - return 0; - } - --static int __init imxfb_probe(struct platform_device *pdev) -+static int __devinit imxfb_probe(struct platform_device *pdev) - { - struct imxfb_info *fbi; - struct fb_info *info; -@@ -754,7 +754,7 @@ failed_map: - failed_getclock: - iounmap(fbi->regs); - failed_ioremap: -- release_mem_region(res->start, res->end - res->start); -+ release_mem_region(res->start, resource_size(res)); - failed_req: - kfree(info->pseudo_palette); - failed_init: -@@ -763,7 +763,7 @@ failed_init: - return ret; - } - --static int __devexit imxfb_remove(struct platform_device *pdev) -+static int imxfb_remove(struct platform_device *pdev) - { - struct imx_fb_platform_data *pdata; - struct fb_info *info = platform_get_drvdata(pdev); -@@ -785,7 +785,7 @@ static int __devexit imxfb_remove(struct - framebuffer_release(info); - - iounmap(fbi->regs); -- release_mem_region(res->start, res->end - res->start + 1); -+ release_mem_region(res->start, resource_size(res)); - clk_disable(fbi->clk); - clk_put(fbi->clk); - -@@ -794,7 +794,7 @@ static int __devexit imxfb_remove(struct - return 0; - } - --void imxfb_shutdown(struct platform_device * dev) -+void imxfb_shutdown(struct platform_device *dev) - { - struct fb_info *info = platform_get_drvdata(dev); - struct imxfb_info *fbi = info->par; -@@ -804,7 +804,8 @@ void imxfb_shutdown(struct platform_dev - static struct platform_driver imxfb_driver = { - .suspend = imxfb_suspend, - .resume = imxfb_resume, -- .remove = __devexit_p(imxfb_remove), -+// .remove = __devexit_p(imxfb_remove), -+ .remove = imxfb_remove, - .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 -@@ -0,0 +1,26 @@ -+/* -+ * Copyright (C) 2007 Lothar Wassmann -+ * -+ * platform_data definitions for fec_enet device -+ * -+ * 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 -+ */ -+ -+struct fec_enet_platform_data { -+ /* callback for platform specific initialization */ -+ int (*arch_init)(struct platform_device *dev); -+ void (*arch_exit)(struct platform_device *dev); -+ 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 -@@ -637,9 +637,12 @@ static int acquire_console_semaphore_for - static const char recursion_bug_msg [] = - KERN_CRIT "BUG: recent printk recursion!\n"; - static int recursion_bug; --static int new_text_line = 1; -+ static int new_text_line = 1; - static char printk_buf[1024]; - -+#ifdef CONFIG_DEBUG_LL -+extern void asmlinkage printascii(const char *); -+#endif - asmlinkage int vprintk(const char *fmt, va_list args) - { - int printed_len = 0; -@@ -687,6 +690,9 @@ asmlinkage int vprintk(const char *fmt, - sizeof(printk_buf) - printed_len, fmt, args); - - -+#ifdef CONFIG_DEBUG_LL -+ printascii(printk_buf); -+#endif - /* - * Copy the output into log_buf. If the caller didn't provide - * appropriate log level tags, we insert them here diff --git a/recipes/linux/linux_2.6.30.bb b/recipes/linux/linux_2.6.30.bb index 900b3d95f1..aa13fca783 100644 --- a/recipes/linux/linux_2.6.30.bb +++ b/recipes/linux/linux_2.6.30.bb @@ -7,12 +7,9 @@ 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_mx27ads = "1" SRC_URI = "${KERNELORG_MIRROR}/pub/linux/kernel/v2.6/linux-${PV}.tar.bz2 \ 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" -- cgit v1.2.3 From 0eccce7f44d593607b18fde848e4f65db9e428d0 Mon Sep 17 00:00:00 2001 From: Florian Boor Date: Wed, 1 Jul 2009 02:01:33 +0200 Subject: linux: Add 2.6.30-rc4 and necessary patches for tx25 --- recipes/linux/linux-2.6.30-rc4/tx25/defconfig | 1211 + .../tx25/linux-2.6.30-rc4-git.patch | 55110 +++++++++++++++++++ .../tx25/linux-2.6.30-rc4-karo.diff | 15337 ++++++ recipes/linux/linux_2.6.30-rc4.bb | 15 + 4 files changed, 71673 insertions(+) create mode 100644 recipes/linux/linux-2.6.30-rc4/tx25/defconfig create mode 100644 recipes/linux/linux-2.6.30-rc4/tx25/linux-2.6.30-rc4-git.patch create mode 100644 recipes/linux/linux-2.6.30-rc4/tx25/linux-2.6.30-rc4-karo.diff create mode 100644 recipes/linux/linux_2.6.30-rc4.bb diff --git a/recipes/linux/linux-2.6.30-rc4/tx25/defconfig b/recipes/linux/linux-2.6.30-rc4/tx25/defconfig new file mode 100644 index 0000000000..290f8df24c --- /dev/null +++ b/recipes/linux/linux-2.6.30-rc4/tx25/defconfig @@ -0,0 +1,1211 @@ +# +# Automatically generated make config: don't edit +# Linux kernel version: 2.6.30-rc4 +# Tue Jun 30 22:46:56 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 is not set +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=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 + +# +# 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_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 + +# +# 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=y +CONFIG_NETCONSOLE_DYNAMIC=y +CONFIG_NETPOLL=y +# CONFIG_NETPOLL_TRAP is not set +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 +# 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 is not set +# CONFIG_LOGO_LINUX_VGA16 is not set +CONFIG_LOGO_LINUX_CLUT224=y +# CONFIG_SOUND 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_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=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 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 --git a/recipes/linux/linux-2.6.30-rc4/tx25/linux-2.6.30-rc4-git.patch b/recipes/linux/linux-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.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 ++#ifdef __KERNEL__ + +-#endif ++#include ++#include ++#include ++#include ++ ++#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 ++#include + #include + ++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. ++ * ++ * 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 ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#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 */ ++ .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. +- * +- * 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 +-#include +-#include +-#include +-#include +-#include +-#include +- +-#include +-#include +-#include +- +-#include +-#include +-#include +-#include +- +-#include +-#include +- +-#include +-#include +-#include +- +-#include +-#include +-#include +- +-/* 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 */ +- .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 + #include + #include ++#include + #include + #include + #include +@@ -21,98 +23,50 @@ + #include + + #include ++#include + #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 = ""; ++ ++ /* name */ ++ 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 ++#include ++ ++#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 + #include + #include ++#include ++#include ++ ++#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 ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#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 ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++ ++/* 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 + #include + ++#include + #include + #include + #include +@@ -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 + #include + +-#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 ++ ++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 ++#include ++ ++#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 + #include +-#include ++ + #include + ++#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. ++ * 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 .h, ++ * and the chip/board init code should then explicitly include ++ * .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. + * ++ * 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 + +-#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 + + #include ++#include + #include + + #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. + * ++ * 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 ++#include + #include + + #include +- + #include + +-/* 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. ++ * ++ * 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 ++ ++#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 + #include + ++#include + #include + #include + #include + ++#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 + #include + #include ++#include ++#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 + #include + #include ++#include ++#include ++#include + + #include + #include +@@ -24,8 +27,11 @@ + #include + #include + #include ++#include ++#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 + #include + ++#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 , 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 +-#include +-#include +-#include +-#include +-#include +- +-#include +- +-/* +- * 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 +- * Copyright (C) 2006 Inky Lung +- * Copyright (C) 2006 Pavel Pisa, PiKRON +- * +- * 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 +-#include +-#include +-#include +-#include +-#include +-#include +- +-#include +- +-#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 +- * initial version heavily inspired by +- * linux/arch/arm/mach-pxa/dma.c +- * +- * 2005-04-17 Pavel Pisa +- * Changed to support scatter gather DMA +- * by taking Russell's code from RiscPC +- * +- * 2006-05-31 Pavel Pisa +- * Corrected error handling code. +- * +- */ +- +-#undef DEBUG +- +-#include +-#include +-#include +-#include +-#include +- +-#include +-#include +-#include +-#include +-#include +-#include +- +-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 +-#include +-#include +-#include +-#include +- +-#include +-#include +-#include +- +-#include +-#include +-#include +- +-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<> 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 +- * 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 +- +- .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 +-#include +-#include +- +-#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 /* 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 +-#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 +- +-#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 +- +-/* +- * 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 +- +-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 +- * +- * 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 +- * Copied from the motorola bsp package and added gpio demux +- * interrupt handler +- */ +- +-#include +-#include +-#include +-#include +- +-#include +-#include +- +-#include +- +-/* +- * +- * 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 +- * +- * +- * 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 +-#include +- +-#include +-#include +- +-#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 +- * +- * 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 +- * +- * 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 +-#include +-#include +-#include +-#include +-#include +-#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 +- * +- * 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 +-#include +-#include +-#include +-#include +-#include +-#include +-#include +- +-#include +-#include +- +-#include +-#include +-#include +-#include +-#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 +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +- +-#include +-#include +-#include +-#include +- +-/* 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 + ++#include + #include + + 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 ++#include ++#include + #include ++#include + #include + #include +-#include +-#include + + #include + #include + #include + +-#include +-#include + #include +-#include +-#include ++#include + #include ++#include + #include ++#include ++ + #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 ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#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 + #include + #include ++#include ++#include + #include + #include + #include +@@ -33,9 +35,117 @@ + #include + #include + #include ++#include ++#include ++#include ++#include + + #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 ++ * ++ * 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 ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#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 +-#include +-#include +-#include + #include + #include ++#include ++#include ++#include ++#include + +-#include + #include ++#include ++#include ++ ++#include + #include + #include +-#include +-#ifdef CONFIG_I2C_IMX + #include +-#endif +-#include ++#include + #include +-#include + #include + + #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 + #include + #include ++#include + + #include + +-#include + #include +-#include +-#include + #include ++#include ++#include ++#include + + #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 + #include + #include + #include + #include ++#include + #include + #include ++#include + #include ++#include + + #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 + #include + #include +-#include + #include + #include + #include +@@ -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 + #include + #include ++#include ++#include ++#include + + #include + #include +@@ -32,11 +35,58 @@ + #include + #include + #include ++#include ++#include ++#include ++#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 ++#include + #include +- +-#include ++#include ++#include + #include + #include +-#include ++#include ++#include + +-#include + #include + #include + #include + #include ++#include + #include ++#include + #include + #include +-#include ++#include ++#include + + #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 ++#include ++#include + #include +- ++#include + #include ++#include + +-#include + #include + #include + #include ++#include ++#include + + #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 ++#include ++#include + #include +- ++#include + #include ++#include + +-#include + #include ++#include + #include + #include ++#include + + #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 + #include + #include ++#include ++#include ++#include ++#include + + #include + #include +@@ -37,7 +41,9 @@ + #include + #include + #include ++#include + #include ++#include + #include + #include + #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 ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#if defined CONFIG_I2C_IMX || defined CONFIG_I2C_IMX_MODULE ++#include ++#endif ++#include ++#include ++#include ++ ++#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 + #include + +-#include + #include + #include + #include + #include +-#include + #include + #include + #include +@@ -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 + #include +-#include + #include + #include +-#include + #include + #include + #include +@@ -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 + #include + #include ++#include + + #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 + #include + #include +-#include + #include + + #include +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 + #include + #include +-#include + #include + + #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. + * Copyright (C) 2007 MontaVista Software, Inc. +@@ -36,8 +38,13 @@ + #include + #include + ++/* 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 + #include + #include ++#include + + #include + #include +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 + #endif ++#ifdef CONFIG_MACH_MX21ADS ++#include ++#endif + #ifdef CONFIG_MACH_PCM038 + #include + #endif +@@ -34,6 +37,12 @@ + #ifdef CONFIG_MACH_QONG + #include + #endif ++#ifdef CONFIG_MACH_PCM043 ++#include ++#endif ++#ifdef CONFIG_MACH_MX27_3DS ++#include ++#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 ++ * ++ * 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 ++ ++/* ++ * The naming convention for the pad modes is MX35_PAD___ ++ * If or refers to a GPIO, it is named ++ * GPIO__ 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, ++ * ++ * ++ * 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___ ++ * If or refers to a GPIO, it is named ++ * GPIO__ ++ * ++ */ ++ ++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 +-#include +- +-#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 ++ * Copyright (C) 2009 by Jan Weitzel Phytec Messtechnik 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., 51 Franklin Street, Fifth Floor, Boston, ++ * MA 02110-1301, USA. ++ */ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++ ++#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 + #include + +-#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 + #include + #include ++#include ++ ++ ++/* 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 "); +- +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 + #include + #include +-#include ++ ++/* 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 +- * +- * 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 +-#include +-#include +- +-#include +- +-/* 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 ++ ++#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 , 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, ®_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 , 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 , 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] \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 \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 \n"); +- fprintf(stderr, "\t-O \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 \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 \n"); +- fprintf(stderr, "\t\tMake space for reserve map entries (relevant for \n\t\tdtb and asm output only)\n"); +- fprintf(stderr, "\t-S \n"); +- fprintf(stderr, "\t\tMake the blob at least long (extra space)\n"); +- fprintf(stderr, "\t-p \n"); +- fprintf(stderr, "\t\tAdd padding to the blob of long (extra space)\n"); +- fprintf(stderr, "\t-b \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 , 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 +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +- +-#include +-#include +- +-#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 , 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("\n"); \ +- BEGIN(INITIAL); \ +- } else { \ +- DPRINT("\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); +- } +- +-<*><> { +- 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; +- } +- +-[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; +- } +- +-[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; +- } +- +-[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; +- } +- +-"&/"{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; +- } +- +-[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; +- } +- +-"]" { +- yylloc.file = srcpos_file; +- yylloc.first_line = yylineno; +- DPRINT("/BYTESTRING\n"); +- BEGIN_DEFAULT(); +- return ']'; +- } +- +-{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("\n"); +- BEGIN(BYTESTRING); +- } +- if ((yytext[0] == '{') +- || (yytext[0] == ';')) { +- DPRINT("\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 +-#include +-#include +-#include +- +-/* end standard C headers. */ +- +-/* flex integer type definitions */ +- +-#ifndef FLEXINT_H +-#define FLEXINT_H +- +-/* C99 systems have . 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 +-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 , 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("\n"); \ +- BEGIN(INITIAL); \ +- } else { \ +- DPRINT("\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 +-#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("\n"); +- BEGIN(BYTESTRING); +- } +- if ((yytext[0] == '{') +- || (yytext[0] == ';')) { +- DPRINT("\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 +- +-#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 /* 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 /* 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 /* INFRINGES ON USER NAME SPACE */ +-# elif defined _AIX +-# define YYSTACK_ALLOC __alloca +-# elif defined _MSC_VER +-# include /* 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 /* 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 /* 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 /* 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 : ""; +- 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 , 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 +- +-#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 DT_PROPNODENAME +-%token DT_LITERAL +-%token DT_LEGACYLITERAL +-%token DT_BASE +-%token DT_BYTE +-%token DT_STRING +-%token DT_LABEL +-%token DT_REF +-%token DT_INCBIN +- +-%type propdata +-%type propdataprefix +-%type memreserve +-%type memreserves +-%type v0_memreserve +-%type v0_memreserves +-%type addr +-%type celllist +-%type cellbase +-%type cellval +-%type bytestring +-%type propdef +-%type proplist +- +-%type devicetree +-%type nodedef +-%type subnode +-%type subnodes +-%type 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 : ""; +- 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 , 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 , 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 +-#include +- +-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 +-#include +-#include +- +-#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 , 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 +- +-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 , 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 +-#include +- +-#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 +-#include +- +-#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 +-#include +- +-#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 +-#include +- +-#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 ""; +- else if (errval == 0) +- return ""; +- else if (errval > -FDT_ERRTABSIZE) { +- const char *s = fdt_errtable[-errval].str; +- +- if (s) +- return s; +- } +- +- return ""; +-} +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 +-#include +- +-#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 +-#include +- +-#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 +-#include +- +-#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 +- +-#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 + + 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 '

Linux Kernel HTML Documentation

' >> $(main_idx) && \ + echo '

Kernel Version: $(KERNELVERSION)

' >> $(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 ++ ++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 ++ ++ ++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 ++ */ ++ ++/* ++ * 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 ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++/* 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 ++ * Copyright (C) 2007-2009 Arjan Opmeer + * + * 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 ++ * Copyright (C) 2007-2009 Arjan Opmeer + * + * 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 + * Copyright (c) 2001 Frederic Lepied + * Copyright (c) 2004 Panagiotis Issaris +- * Copyright (c) 2002-2008 Ping Cheng ++ * Copyright (c) 2002-2009 Ping Cheng + * + * 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 " + #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 */ + 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 handler: unexpected completion 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 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 " + #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 + #include + #include ++#include + + #include + #include +@@ -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 + #include + #include +-#include + #include + #include + #include ++#include ++#include ++#include ++#include ++#include + +-#include + #include + #include + #include +-#include + + #include + +@@ -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 ++#include + + #include + + 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 + + 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 , 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, ®_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 , 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 , 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] \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 \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 \n"); ++ fprintf(stderr, "\t-O \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 \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 \n"); ++ fprintf(stderr, "\t\tMake space for reserve map entries (relevant for \n\t\tdtb and asm output only)\n"); ++ fprintf(stderr, "\t-S \n"); ++ fprintf(stderr, "\t\tMake the blob at least long (extra space)\n"); ++ fprintf(stderr, "\t-p \n"); ++ fprintf(stderr, "\t\tAdd padding to the blob of long (extra space)\n"); ++ fprintf(stderr, "\t-b \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 , 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 ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++#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 , 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("\n"); \ ++ BEGIN(INITIAL); \ ++ } else { \ ++ DPRINT("\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); ++ } ++ ++<*><> { ++ 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; ++ } ++ ++[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; ++ } ++ ++[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; ++ } ++ ++[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; ++ } ++ ++"&/"{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; ++ } ++ ++[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; ++ } ++ ++"]" { ++ yylloc.file = srcpos_file; ++ yylloc.first_line = yylineno; ++ DPRINT("/BYTESTRING\n"); ++ BEGIN_DEFAULT(); ++ return ']'; ++ } ++ ++{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("\n"); ++ BEGIN(BYTESTRING); ++ } ++ if ((yytext[0] == '{') ++ || (yytext[0] == ';')) { ++ DPRINT("\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 ++#include ++#include ++#include ++ ++/* end standard C headers. */ ++ ++/* flex integer type definitions */ ++ ++#ifndef FLEXINT_H ++#define FLEXINT_H ++ ++/* C99 systems have . 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 ++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 , 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("\n"); \ ++ BEGIN(INITIAL); \ ++ } else { \ ++ DPRINT("\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 ++#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("\n"); ++ BEGIN(BYTESTRING); ++ } ++ if ((yytext[0] == '{') ++ || (yytext[0] == ';')) { ++ DPRINT("\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 ++ ++#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 /* 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 /* 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 /* INFRINGES ON USER NAME SPACE */ ++# elif defined _AIX ++# define YYSTACK_ALLOC __alloca ++# elif defined _MSC_VER ++# include /* 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 /* 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 /* 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 /* 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 : ""; ++ 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 , 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 ++ ++#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 DT_PROPNODENAME ++%token DT_LITERAL ++%token DT_LEGACYLITERAL ++%token DT_BASE ++%token DT_BYTE ++%token DT_STRING ++%token DT_LABEL ++%token DT_REF ++%token DT_INCBIN ++ ++%type propdata ++%type propdataprefix ++%type memreserve ++%type memreserves ++%type v0_memreserve ++%type v0_memreserves ++%type addr ++%type celllist ++%type cellbase ++%type cellval ++%type bytestring ++%type propdef ++%type proplist ++ ++%type devicetree ++%type nodedef ++%type subnode ++%type subnodes ++%type 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 : ""; ++ 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 , 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 , 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 ++#include ++ ++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 ++#include ++ ++#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 ++#include ++ ++#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 ++#include ++ ++#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 ++#include ++ ++#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 ""; ++ else if (errval == 0) ++ return ""; ++ else if (errval > -FDT_ERRTABSIZE) { ++ const char *s = fdt_errtable[-errval].str; ++ ++ if (s) ++ return s; ++ } ++ ++ return ""; ++} +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 ++#include ++ ++#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 ++#include ++ ++#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 ++#include ++#include ++ ++#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 ++#include ++ ++#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 ++ ++#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 , 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 ++ ++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 , 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 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 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-rc4/tx25/linux-2.6.30-rc4-karo.diff b/recipes/linux/linux-2.6.30-rc4/tx25/linux-2.6.30-rc4-karo.diff new file mode 100644 index 0000000000..17765b46f6 --- /dev/null +++ b/recipes/linux/linux-2.6.30-rc4/tx25/linux-2.6.30-rc4-karo.diff @@ -0,0 +1,15337 @@ +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-08 13:11:18.000000000 +0200 +@@ -0,0 +1,1203 @@ ++# ++# Automatically generated make config: don't edit ++# Linux kernel version: 2.6.30-rc4 ++# Fri Jun 5 21:17: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_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 is not set ++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=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 ++ ++# ++# 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_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 ++ ++# ++# 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=y ++CONFIG_NETCONSOLE_DYNAMIC=y ++CONFIG_NETPOLL=y ++# CONFIG_NETPOLL_TRAP is not set ++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 ++# 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-08 13:11:18.000000000 +0200 +@@ -0,0 +1,1203 @@ ++# ++# Automatically generated make config: don't edit ++# Linux kernel version: 2.6.30-rc4 ++# Fri Jun 5 21:17: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_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 is not set ++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=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 ++ ++# ++# 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_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 ++ ++# ++# 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=y ++CONFIG_NETCONSOLE_DYNAMIC=y ++CONFIG_NETPOLL=y ++# CONFIG_NETPOLL_TRAP is not set ++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 ++# 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/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-08 12:45:22.000000000 +0200 +@@ -6,14 +6,26 @@ choice + + config MACH_MX21 + bool "i.MX21 support" ++ select ARCH_MXC_IOMUX_V2 ++ select ARCH_MXC_HAS_NFC_V1 + help + This enables support for Freescale's MX2 based i.MX21 processor. + + config MACH_MX27 + bool "i.MX27 support" ++ select ARCH_MXC_IOMUX_V2 ++ select ARCH_MXC_HAS_NFC_V1 + 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_V1_1 ++ select PHYLIB if FEC ++ help ++ This enables support for Freescale's MX2 based i.MX25 processor. ++ + endchoice + + comment "MX2 platforms:" +@@ -39,6 +51,26 @@ config MACH_PCM038 + Include support for phyCORE-i.MX27 (aka pcm038) platform. This + includes specific configurations for the module and its peripherals. + ++config MACH_TX25 ++ bool "Support Ka-Ro electronics TX25 module" ++ depends on MACH_MX25 ++ help ++ Include support for Ka-Ro TX25 processor module ++ ++config KARO_DEBUG ++ bool "Enable Ka-Ro specific debug messages" ++ depends on MACH_TX25 || MACH_TX27 ++ help ++ Compile the architecture specific files with -DDEBUG to enable ++ additional debug messages ++ ++config MACH_STK5_BASEBOARD ++ bool "Ka-Ro Starterkit-5 (STK5) development board" ++ depends on MACH_TX27 || MACH_TX25 ++ help ++ This adds board specific devices that can be found on Ka-Ro's ++ STK5 evaluation board. ++ + choice + prompt "Baseboard" + depends on MACH_PCM038 +@@ -60,3 +92,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:59:14.000000000 +0200 +@@ -2,17 +2,31 @@ + # Makefile for the linux kernel. + # + ++ifeq ($(CONFIG_KARO_DEBUG),y) ++ EXTRA_CFLAGS += -DDEBUG ++endif ++ + # Object file lists. + +-obj-y := generic.o devices.o serial.o ++obj-y := generic.o serial.o ++obj-$(CONFIG_MACH_MX25) += devices_mx25.o ++ifeq ($(CONFIG_MACH_MX25),) ++obj-y += devices.o ++endif ++ ++obj-$(CONFIG_MACH_MX21) += clock_imx21.o + +-obj-$(CONFIG_MACH_MX21) += clock_imx21.o ++obj-$(CONFIG_MACH_MX25) += clock_imx25.o ++obj-$(CONFIG_MACH_MX25) += cpu_imx25.o + +-obj-$(CONFIG_MACH_MX27) += cpu_imx27.o +-obj-$(CONFIG_MACH_MX27) += clock_imx27.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 ++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 ++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: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 + initrd_phys-$(CONFIG_MACH_MX27) := 0xA0800000 ++ ++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:59:15.000000000 +0200 +@@ -890,7 +890,7 @@ static struct clk clko_clk = { + .con_id = n, \ + .clk = &c, \ + }, +-static struct clk_lookup lookups[] __initdata = { ++static struct clk_lookup lookups[] = { + /* 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-08 12:46:51.000000000 +0200 +@@ -0,0 +1,1848 @@ ++/* ++ * Copyright 2008 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 ++ */ ++ ++/* based on mach-mx27/clock.c */ ++ ++#include ++#include ++#include ++//#include ++ ++#include ++//#include ++ ++#include ++#include ++#include ++ ++/* Register offsets */ ++#define MXC_CCM_MPCTL (IO_ADDRESS(CCM_BASE_ADDR) + 0x00) ++#define MXC_CCM_UPCTL (IO_ADDRESS(CCM_BASE_ADDR) + 0x04) ++#define MXC_CCM_CCTL (IO_ADDRESS(CCM_BASE_ADDR) + 0x08) ++#define MXC_CCM_CGCR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x0C) ++#define MXC_CCM_CGCR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x10) ++#define MXC_CCM_CGCR2 (IO_ADDRESS(CCM_BASE_ADDR) + 0x14) ++#define MXC_CCM_PCDR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x18) ++#define MXC_CCM_PCDR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x1C) ++#define MXC_CCM_PCDR2 (IO_ADDRESS(CCM_BASE_ADDR) + 0x20) ++#define MXC_CCM_PCDR3 (IO_ADDRESS(CCM_BASE_ADDR) + 0x24) ++#define MXC_CCM_RCSR (IO_ADDRESS(CCM_BASE_ADDR) + 0x28) ++#define MXC_CCM_CRDR (IO_ADDRESS(CCM_BASE_ADDR) + 0x2C) ++#define MXC_CCM_DCVR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x30) ++#define MXC_CCM_DCVR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x34) ++#define MXC_CCM_DCVR2 (IO_ADDRESS(CCM_BASE_ADDR) + 0x38) ++#define MXC_CCM_DCVR3 (IO_ADDRESS(CCM_BASE_ADDR) + 0x3C) ++#define MXC_CCM_LTR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x40) ++#define MXC_CCM_LTR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x44) ++#define MXC_CCM_LTR2 (IO_ADDRESS(CCM_BASE_ADDR) + 0x48) ++#define MXC_CCM_LTR3 (IO_ADDRESS(CCM_BASE_ADDR) + 0x4C) ++#define MXC_CCM_LTBR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x50) ++#define MXC_CCM_LTBR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x54) ++#define MXC_CCM_PMCR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x58) ++#define MXC_CCM_PMCR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x5C) ++#define MXC_CCM_PMCR2 (IO_ADDRESS(CCM_BASE_ADDR) + 0x60) ++#define MXC_CCM_MCR (IO_ADDRESS(CCM_BASE_ADDR) + 0x64) ++ ++#define MXC_CCM_MPCTL_BRMO (1 << 31) ++#define MXC_CCM_MPCTL_PD_OFFSET 26 ++#define MXC_CCM_MPCTL_PD_MASK (0xf << 26) ++#define MXC_CCM_MPCTL_MFD_OFFSET 16 ++#define MXC_CCM_MPCTL_MFD_MASK (0x3ff << 16) ++#define MXC_CCM_MPCTL_MFI_OFFSET 10 ++#define MXC_CCM_MPCTL_MFI_MASK (0xf << 10) ++#define MXC_CCM_MPCTL_MFN_OFFSET 0 ++#define MXC_CCM_MPCTL_MFN_MASK 0x3ff ++#define MXC_CCM_MPCTL_LF (1 << 15) ++ ++#define MXC_CCM_UPCTL_BRMO (1 << 31) ++#define MXC_CCM_UPCTL_PD_OFFSET 26 ++#define MXC_CCM_UPCTL_PD_MASK (0xf << 26) ++#define MXC_CCM_UPCTL_MFD_OFFSET 16 ++#define MXC_CCM_UPCTL_MFD_MASK (0x3ff << 16) ++#define MXC_CCM_UPCTL_MFI_OFFSET 10 ++#define MXC_CCM_UPCTL_MFI_MASK (0xf << 10) ++#define MXC_CCM_UPCTL_MFN_OFFSET 0 ++#define MXC_CCM_UPCTL_MFN_MASK 0x3ff ++#define MXC_CCM_UPCTL_LF (1 << 15) ++ ++#define MXC_CCM_CCTL_ARM_OFFSET 30 ++#define MXC_CCM_CCTL_ARM_MASK (0x3 << 30) ++#define MXC_CCM_CCTL_AHB_OFFSET 28 ++#define MXC_CCM_CCTL_AHB_MASK (0x3 << 28) ++#define MXC_CCM_CCTL_MPLL_RST (1 << 27) ++#define MXC_CCM_CCTL_UPLL_RST (1 << 26) ++#define MXC_CCM_CCTL_LP_CTL_OFFSET 24 ++#define MXC_CCM_CCTL_LP_CTL_MASK (0x3 << 24) ++#define MXC_CCM_CCTL_LP_MODE_RUN (0x0 << 24) ++#define MXC_CCM_CCTL_LP_MODE_WAIT (0x1 << 24) ++#define MXC_CCM_CCTL_LP_MODE_DOZE (0x2 << 24) ++#define MXC_CCM_CCTL_LP_MODE_STOP (0x3 << 24) ++#define MXC_CCM_CCTL_UPLL_DISABLE (1 << 23) ++#define MXC_CCM_CCTL_MPLL_BYPASS (1 << 22) ++#define MXC_CCM_CCTL_USB_DIV_OFFSET 16 ++#define MXC_CCM_CCTL_USB_DIV_MASK (0x3 << 16) ++#define MXC_CCM_CCTL_CG_CTRL (1 << 15) ++#define MXC_CCM_CCTL_ARM_SRC (1 << 14) ++ ++#define MXC_CCM_CGCR0_HCLK_ATA_OFFSET (16 + 0) ++#define MXC_CCM_CGCR0_HCLK_BROM_OFFSET (16 + 1) ++#define MXC_CCM_CGCR0_HCLK_CSI_OFFSET (16 + 2) ++#define MXC_CCM_CGCR0_HCLK_EMI_OFFSET (16 + 3) ++#define MXC_CCM_CGCR0_HCLK_ESAI_OFFSET (16 + 4) ++#define MXC_CCM_CGCR0_HCLK_ESDHC1_OFFSET (16 + 5) ++#define MXC_CCM_CGCR0_HCLK_ESDHC2_OFFSET (16 + 6) ++#define MXC_CCM_CGCR0_HCLK_FEC_OFFSET (16 + 7) ++#define MXC_CCM_CGCR0_HCLK_LCDC_OFFSET (16 + 8) ++#define MXC_CCM_CGCR0_HCLK_RTIC_OFFSET (16 + 9) ++#define MXC_CCM_CGCR0_HCLK_SDMA_OFFSET (16 + 10) ++#define MXC_CCM_CGCR0_HCLK_SLCDC_OFFSET (16 + 11) ++#define MXC_CCM_CGCR0_HCLK_USBOTG_OFFSET (16 + 12) ++ ++#define MXC_CCM_CGCR0_PER_CSI_OFFSET 0 ++#define MXC_CCM_CGCR0_PER_EPIT_OFFSET 1 ++#define MXC_CCM_CGCR0_PER_ESAI_OFFSET 2 ++#define MXC_CCM_CGCR0_PER_ESDHC1_OFFSET 3 ++#define MXC_CCM_CGCR0_PER_ESDHC2_OFFSET 4 ++#define MXC_CCM_CGCR0_PER_GPT_OFFSET 5 ++#define MXC_CCM_CGCR0_PER_I2C_OFFSET 6 ++#define MXC_CCM_CGCR0_PER_LCDC_OFFSET 7 ++#define MXC_CCM_CGCR0_PER_NFC_OFFSET 8 ++#define MXC_CCM_CGCR0_PER_OWIRE_OFFSET 9 ++#define MXC_CCM_CGCR0_PER_PWM_OFFSET 10 ++#define MXC_CCM_CGCR0_PER_SIM1_OFFSET 11 ++#define MXC_CCM_CGCR0_PER_SIM2_OFFSET 12 ++#define MXC_CCM_CGCR0_PER_SSI1_OFFSET 13 ++#define MXC_CCM_CGCR0_PER_SSI2_OFFSET 14 ++#define MXC_CCM_CGCR0_PER_UART_OFFSET 15 ++ ++#define MXC_CCM_CGCR1_AUDMUX_OFFSET 0 ++#define MXC_CCM_CGCR1_ATA_OFFSET 1 ++#define MXC_CCM_CGCR1_CAN1_OFFSET 2 ++#define MXC_CCM_CGCR1_CAN2_OFFSET 3 ++#define MXC_CCM_CGCR1_CSI_OFFSET 4 ++#define MXC_CCM_CGCR1_CSPI1_OFFSET 5 ++#define MXC_CCM_CGCR1_CSPI2_OFFSET 6 ++#define MXC_CCM_CGCR1_CSPI3_OFFSET 7 ++#define MXC_CCM_CGCR1_DRYICE_OFFSET 8 ++#define MXC_CCM_CGCR1_ECT_OFFSET 9 ++#define MXC_CCM_CGCR1_EPIT1_OFFSET 10 ++#define MXC_CCM_CGCR1_EPIT2_OFFSET 11 ++#define MXC_CCM_CGCR1_ESAI_OFFSET 12 ++#define MXC_CCM_CGCR1_ESDHC1_OFFSET 13 ++#define MXC_CCM_CGCR1_ESDHC2_OFFSET 14 ++#define MXC_CCM_CGCR1_FEC_OFFSET 15 ++#define MXC_CCM_CGCR1_GPIO1_OFFSET 16 ++#define MXC_CCM_CGCR1_GPIO2_OFFSET 17 ++#define MXC_CCM_CGCR1_GPIO3_OFFSET 18 ++#define MXC_CCM_CGCR1_GPT1_OFFSET 19 ++#define MXC_CCM_CGCR1_GPT2_OFFSET 20 ++#define MXC_CCM_CGCR1_GPT3_OFFSET 21 ++#define MXC_CCM_CGCR1_GPT4_OFFSET 22 ++#define MXC_CCM_CGCR1_I2C1_OFFSET 23 ++#define MXC_CCM_CGCR1_I2C2_OFFSET 24 ++#define MXC_CCM_CGCR1_I2C3_OFFSET 25 ++#define MXC_CCM_CGCR1_IIM_OFFSET 26 ++#define MXC_CCM_CGCR1_IOMUXC_OFFSET 27 ++#define MXC_CCM_CGCR1_KPP_OFFSET 28 ++#define MXC_CCM_CGCR1_LCDC_OFFSET 29 ++#define MXC_CCM_CGCR1_OWIRE_OFFSET 30 ++#define MXC_CCM_CGCR1_PWM1_OFFSET 31 ++ ++#define MXC_CCM_CGCR2_PWM2_OFFSET (32 - 32) ++#define MXC_CCM_CGCR2_PWM3_OFFSET (33 - 32) ++#define MXC_CCM_CGCR2_PWM4_OFFSET (34 - 32) ++#define MXC_CCM_CGCR2_RNGB_OFFSET (35 - 32) ++#define MXC_CCM_CGCR2_RTIC_OFFSET (36 - 32) ++#define MXC_CCM_CGCR2_SCC_OFFSET (37 - 32) ++#define MXC_CCM_CGCR2_SDMA_OFFSET (38 - 32) ++#define MXC_CCM_CGCR2_SIM1_OFFSET (39 - 32) ++#define MXC_CCM_CGCR2_SIM2_OFFSET (40 - 32) ++#define MXC_CCM_CGCR2_SLCDC_OFFSET (41 - 32) ++#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_UART1_OFFSET (46 - 32) ++#define MXC_CCM_CGCR2_UART2_OFFSET (47 - 32) ++#define MXC_CCM_CGCR2_UART3_OFFSET (48 - 32) ++#define MXC_CCM_CGCR2_UART4_OFFSET (49 - 32) ++#define MXC_CCM_CGCR2_UART5_OFFSET (50 - 32) ++#define MXC_CCM_CGCR2_WDOG_OFFSET (51 - 32) ++ ++#define MXC_CCM_PCDR1_PERDIV1_MASK 0x3f ++ ++#define MXC_CCM_MCR_USB_XTAL_MUX_OFFSET 31 ++#define MXC_CCM_MCR_CLKO_EN_OFFSET 30 ++#define MXC_CCM_MCR_CLKO_DIV_OFFSET 24 ++#define MXC_CCM_MCR_CLKO_DIV_MASK (0x3F << 24) ++#define MXC_CCM_MCR_CLKO_SEL_OFFSET 20 ++#define MXC_CCM_MCR_CLKO_SEL_MASK (0xF << 20) ++#define MXC_CCM_MCR_ESAI_CLK_MUX_OFFSET 19 ++#define MXC_CCM_MCR_SSI2_CLK_MUX_OFFSET 18 ++#define MXC_CCM_MCR_SSI1_CLK_MUX_OFFSET 17 ++#define MXC_CCM_MCR_USB_CLK_MUX_OFFSET 16 ++ ++#define MXC_CCM_MCR_PER_CLK_MUX_MASK (0xFFFF << 0) ++ ++#define OSC24M_CLK_FREQ 24000000 /* 24MHz reference clk */ ++#define OSC32K_CLK_FREQ 32768 /* 32.768kHz oscillator in */ ++ ++static struct clk mpll_clk; ++static struct clk upll_clk; ++static struct clk ahb_clk; ++static struct clk upll_24610k_clk; ++ ++static int _clk_enable(struct clk *clk) ++{ ++ unsigned long reg; ++ ++ if (!clk->enable_reg) ++ return 0; ++ ++ reg = __raw_readl(clk->enable_reg); ++ reg |= 1 << clk->enable_shift; ++ __raw_writel(reg, clk->enable_reg); ++ ++ return 0; ++} ++ ++static void _clk_disable(struct clk *clk) ++{ ++ unsigned long reg; ++ ++ if (!clk->enable_reg) ++ return; ++ ++ reg = __raw_readl(clk->enable_reg); ++ reg &= ~(1 << clk->enable_shift); ++ __raw_writel(reg, clk->enable_reg); ++} ++ ++static int _clk_upll_enable(struct clk *clk) ++{ ++ unsigned long reg; ++ ++ reg = __raw_readl(MXC_CCM_CCTL); ++ reg &= ~MXC_CCM_CCTL_UPLL_DISABLE; ++ __raw_writel(reg, MXC_CCM_CCTL); ++ ++ while (!(__raw_readl(MXC_CCM_UPCTL) & MXC_CCM_UPCTL_LF)) ++ cpu_relax(); ++ ++ return 0; ++} ++ ++static void _clk_upll_disable(struct clk *clk) ++{ ++ unsigned long reg; ++ ++ reg = __raw_readl(MXC_CCM_CCTL); ++ reg |= MXC_CCM_CCTL_UPLL_DISABLE; ++ __raw_writel(reg, MXC_CCM_CCTL); ++} ++ ++static int _perclk_enable(struct clk *clk) ++{ ++ unsigned long reg; ++ ++ reg = __raw_readl(MXC_CCM_CGCR0); ++ reg |= 1 << clk->id; ++ __raw_writel(reg, MXC_CCM_CGCR0); ++ ++ return 0; ++} ++ ++static void _perclk_disable(struct clk *clk) ++{ ++ unsigned long reg; ++ ++ reg = __raw_readl(MXC_CCM_CGCR0); ++ reg &= ~(1 << clk->id); ++ __raw_writel(reg, MXC_CCM_CGCR0); ++} ++ ++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) */ ++ signed long mfn; /* Multiplication Factor (Integer part) */ ++ signed long mfd; /* Multiplication Factor (Denominator Part) */ ++ signed long tmp; ++ unsigned long ref_freq = clk_get_rate(clk->parent); ++ ++ 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; ++ 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); ++ ++ mfn = (mfn + ((mfn < 0) ? 1024 : 0)) & 0x3ff; ++ pd--; ++ mfd--; ++ ++ /* Change the Pll value */ ++ reg = (mfi << MXC_CCM_MPCTL_MFI_OFFSET) | ++ (mfn << MXC_CCM_MPCTL_MFN_OFFSET) | ++ (mfd << MXC_CCM_MPCTL_MFD_OFFSET) | ++ (pd << MXC_CCM_MPCTL_PD_OFFSET); ++ ++ if (clk == &mpll_clk) { ++ printk(KERN_DEBUG "Changing MPCTL from %08x to %08lx\n", ++ __raw_readl(MXC_CCM_MPCTL), reg); ++ } else if (clk == &upll_clk) { ++ printk(KERN_DEBUG "Changing UPCTL from %08x to %08lx\n", ++ __raw_readl(MXC_CCM_UPCTL), reg); ++ } ++ if (clk == &mpll_clk) ++ __raw_writel(reg, MXC_CCM_MPCTL); ++ else if (clk == &upll_clk) ++ __raw_writel(reg, MXC_CCM_UPCTL); ++ return 0; ++} ++ ++static unsigned long _clk_pll_getrate(struct clk *clk) ++{ ++ unsigned long rate; ++ signed long mfi, mfn, mfd, pdf; ++ unsigned long ref_clk; ++ unsigned long reg; ++ ++ ref_clk = clk_get_rate(clk->parent); ++ ++ if (clk == &mpll_clk) { ++ reg = __raw_readl(MXC_CCM_MPCTL); ++ pdf = (reg & MXC_CCM_MPCTL_PD_MASK) >> MXC_CCM_MPCTL_PD_OFFSET; ++ mfd = (reg & MXC_CCM_MPCTL_MFD_MASK) >> MXC_CCM_MPCTL_MFD_OFFSET; ++ mfi = (reg & MXC_CCM_MPCTL_MFI_MASK) >> MXC_CCM_MPCTL_MFI_OFFSET; ++ mfn = (reg & MXC_CCM_MPCTL_MFN_MASK) >> MXC_CCM_MPCTL_MFN_OFFSET; ++ } else if (clk == &upll_clk) { ++ reg = __raw_readl(MXC_CCM_UPCTL); ++ pdf = (reg & MXC_CCM_UPCTL_PD_MASK) >> MXC_CCM_UPCTL_PD_OFFSET; ++ mfd = (reg & MXC_CCM_UPCTL_MFD_MASK) >> MXC_CCM_UPCTL_MFD_OFFSET; ++ mfi = (reg & MXC_CCM_UPCTL_MFI_MASK) >> MXC_CCM_UPCTL_MFI_OFFSET; ++ mfn = (reg & MXC_CCM_UPCTL_MFN_MASK) >> MXC_CCM_UPCTL_MFN_OFFSET; ++ } else { ++ BUG(); /* oops */ ++ } ++ ++ mfi = (mfi < 5) ? 5 : mfi; ++ rate = 2LL * ref_clk * mfn; ++ do_div(rate, mfd + 1); ++ rate = 2LL * ref_clk * mfi + rate; ++ do_div(rate, pdf + 1); ++ ++ return rate; ++} ++ ++static unsigned long _clk_cpu_round_rate(struct clk *clk, unsigned long rate) ++{ ++ int div = clk_get_rate(clk->parent) / rate; ++ ++ if (clk_get_rate(clk->parent) % rate) ++ div++; ++ ++ if (div > 4) ++ div = 4; ++ ++ return clk_get_rate(clk->parent) / div; ++} ++ ++static int _clk_cpu_set_rate(struct clk *clk, unsigned long rate) ++{ ++ int div, reg; ++ unsigned long cctl = __raw_readl(MXC_CCM_CCTL); ++ ++ div = clk_get_rate(clk->parent) / rate; ++ ++ if (div > 4 || div < 1 || ((clk_get_rate(clk->parent) / div) != rate)) ++ return -EINVAL; ++ div--; ++ ++ reg = (cctl & ~MXC_CCM_CCTL_ARM_MASK) | ++ (div << MXC_CCM_CCTL_ARM_OFFSET); ++ __raw_writel(reg, MXC_CCM_CCTL); ++ ++ return 0; ++} ++ ++static unsigned long _clk_cpu_getrate(struct clk *clk) ++{ ++ unsigned long div; ++ unsigned long cctl = __raw_readl(MXC_CCM_CCTL); ++ unsigned long rate; ++ ++ div = (cctl & MXC_CCM_CCTL_ARM_MASK) >> MXC_CCM_CCTL_ARM_OFFSET; ++ ++ rate = clk_get_rate(clk->parent) / (div + 1); ++ ++ if (cctl & MXC_CCM_CCTL_ARM_SRC) { ++ rate *= 3; ++ rate /= 4; ++ } ++ return rate; ++} ++ ++static unsigned long _clk_ahb_getrate(struct clk *clk) ++{ ++ unsigned long div; ++ unsigned long cctl = __raw_readl(MXC_CCM_CCTL); ++ ++ div = (cctl & MXC_CCM_CCTL_AHB_MASK) >> MXC_CCM_CCTL_AHB_OFFSET; ++ ++ return clk_get_rate(clk->parent) / (div + 1); ++} ++ ++static void __iomem *pcdr_a[4] = { ++ MXC_CCM_PCDR0, MXC_CCM_PCDR1, MXC_CCM_PCDR2, MXC_CCM_PCDR3 ++}; ++ ++static unsigned long _clk_perclkx_getrate(struct clk *clk) ++{ ++ unsigned long perclk_pdf; ++ unsigned long pcdr; ++ ++ if (clk->id < 0 || clk->id > 15) ++ return 0; ++ ++ pcdr = __raw_readl(pcdr_a[clk->id >> 2]); ++ ++ perclk_pdf = ++ (pcdr >> ((clk->id & 3) << 3)) & MXC_CCM_PCDR1_PERDIV1_MASK; ++ ++ return clk_get_rate(clk->parent) / (perclk_pdf + 1); ++} ++ ++static unsigned long _clk_perclkx_round_rate(struct clk *clk, ++ unsigned long rate) ++{ ++ unsigned long div; ++ ++ div = clk_get_rate(clk->parent) / rate; ++ if (clk_get_rate(clk->parent) % rate) ++ div++; ++ ++ if (div > 64) ++ div = 64; ++ ++ return clk_get_rate(clk->parent) / div; ++} ++ ++static int _clk_perclkx_set_rate(struct clk *clk, unsigned long rate) ++{ ++ unsigned long reg; ++ unsigned long div; ++ ++ if (clk->id < 0 || clk->id > 15) ++ 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--; ++ ++ reg = ++ __raw_readl(pcdr_a[clk->id >> 2]) & ~(MXC_CCM_PCDR1_PERDIV1_MASK << ++ ((clk->id & 3) << 3)); ++ reg |= div << ((clk->id & 3) << 3); ++ __raw_writel(reg, pcdr_a[clk->id >> 2]); ++ ++ return 0; ++} ++ ++static int _clk_perclkx_set_parent(struct clk *clk, struct clk *parent) ++{ ++ unsigned long mcr; ++ ++ if (clk->parent == parent) ++ return 0; ++ if (parent != &upll_clk && parent != &ahb_clk) ++ return -EINVAL; ++ ++ clk->parent = parent; ++ mcr = __raw_readl(MXC_CCM_MCR); ++ if (parent == &upll_clk) ++ mcr |= (1 << clk->id); ++ else ++ mcr &= ~(1 << clk->id); ++ ++ __raw_writel(mcr, MXC_CCM_MCR); ++ ++ return 0; ++} ++ ++static int _clk_perclkx_set_parent3(struct clk *clk, struct clk *parent) ++{ ++ unsigned long mcr = __raw_readl(MXC_CCM_MCR); ++ int bit; ++ ++ if (clk->parent == parent) ++ return 0; ++ if (parent != &upll_clk && parent != &ahb_clk && ++ parent != &upll_24610k_clk) ++ return -EINVAL; ++ ++ switch (clk->id) { ++ case 2: ++ bit = MXC_CCM_MCR_ESAI_CLK_MUX_OFFSET; ++ break; ++ case 13: ++ bit = MXC_CCM_MCR_SSI1_CLK_MUX_OFFSET; ++ break; ++ case 14: ++ bit = MXC_CCM_MCR_SSI2_CLK_MUX_OFFSET; ++ break; ++ default: ++ return -EINVAL; ++ } ++ ++ if (parent == &upll_24610k_clk) { ++ mcr |= bit; ++ __raw_writel(mcr, MXC_CCM_MCR); ++ clk->parent = parent; ++ } else { ++ mcr &= ~bit; ++ __raw_writel(mcr, MXC_CCM_MCR); ++ return _clk_perclkx_set_parent(clk, parent); ++ } ++ ++ return 0; ++} ++ ++static unsigned long _clk_ipg_getrate(struct clk *clk) ++{ ++ return clk_get_rate(clk->parent) / 2; /* Always AHB / 2 */ ++} ++ ++/* Top-level clocks */ ++static unsigned long ckih_rate = OSC24M_CLK_FREQ; ++ ++static unsigned long clk_ckih_get_rate(struct clk *clk) ++{ ++ return ckih_rate; ++} ++ ++static unsigned long clk_ckil_get_rate(struct clk *clk) ++{ ++ return OSC32K_CLK_FREQ; ++} ++ ++static struct clk osc24m_clk = { ++ .get_rate = clk_ckih_get_rate, ++}; ++ ++static struct clk osc32k_clk = { ++ .get_rate = clk_ckil_get_rate, ++}; ++ ++static struct clk mpll_clk = { ++ .parent = &osc24m_clk, ++ .get_rate = _clk_pll_getrate, ++ .set_rate = _clk_pll_set_rate, ++}; ++ ++static struct clk upll_clk = { ++ .parent = &osc24m_clk, ++ .get_rate = _clk_pll_getrate, ++ .set_rate = _clk_pll_set_rate, ++ .enable = _clk_upll_enable, ++ .disable = _clk_upll_disable, ++}; ++ ++static unsigned long _clk_24610k_getrate(struct clk *clk) ++{ ++ long long rate = clk_get_rate(clk->parent) * 2461LL; ++ ++ do_div(rate, 24000); ++ ++ return rate; /* Always (UPLL * 24.61 / 240) */ ++} ++ ++static struct clk upll_24610k_clk = { ++ .parent = &upll_clk, ++ .get_rate = _clk_24610k_getrate, ++}; ++ ++/* Mid-level clocks */ ++ ++static struct clk cpu_clk = { /* ARM clock */ ++ .parent = &mpll_clk, ++ .set_rate = _clk_cpu_set_rate, ++ .get_rate = _clk_cpu_getrate, ++ .round_rate = _clk_cpu_round_rate, ++}; ++ ++static struct clk ahb_clk = { /* a.k.a. HCLK */ ++ .parent = &cpu_clk, ++ .get_rate = _clk_ahb_getrate, ++}; ++ ++static struct clk ipg_clk = { ++ .parent = &ahb_clk, ++ .get_rate = _clk_ipg_getrate, ++}; ++ ++/* Bottom-level clocks */ ++ ++struct clk usbotg_clk = { ++ .id = 0, ++ .parent = &ahb_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR0, ++ .enable_shift = MXC_CCM_CGCR0_HCLK_USBOTG_OFFSET, ++ .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, ++}; ++ ++struct clk emi_clk = { ++ .id = 0, ++ .parent = &ahb_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR0, ++ .enable_shift = MXC_CCM_CGCR0_HCLK_EMI_OFFSET, ++ .disable = _clk_disable, ++}; ++ ++struct clk brom_clk = { ++ .id = 0, ++ .parent = &ahb_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR0, ++ .enable_shift = MXC_CCM_CGCR0_HCLK_BROM_OFFSET, ++ .disable = _clk_disable, ++}; ++ ++static struct clk per_clk[] = { ++ { ++ .id = 0, ++ .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, ++ .get_rate = _clk_perclkx_getrate, ++ .enable = _perclk_enable, ++ .disable = _perclk_disable, ++ }, ++ { ++ .id = 1, ++ .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, ++ .get_rate = _clk_perclkx_getrate, ++ .enable = _perclk_enable, ++ .disable = _perclk_disable, ++ }, ++ { ++ .id = 2, ++ .parent = &ahb_clk, /* can be AHB or UPLL or 24.61MHz */ ++ .round_rate = _clk_perclkx_round_rate, ++ .set_rate = _clk_perclkx_set_rate, ++ .set_parent = _clk_perclkx_set_parent3, ++ .get_rate = _clk_perclkx_getrate, ++ .enable = _perclk_enable, ++ .disable = _perclk_disable, ++ }, ++ { ++ .id = 3, ++ .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, ++ .get_rate = _clk_perclkx_getrate, ++ .enable = _perclk_enable, ++ }, ++ { ++ .id = 4, ++ .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, ++ .get_rate = _clk_perclkx_getrate, ++ .enable = _perclk_enable, ++ .disable = _perclk_disable, ++ }, ++ { ++ .id = 5, ++ .parent = &upll_clk, /* can be AHB or UPLL */ ++ .round_rate = _clk_perclkx_round_rate, ++ .set_rate = _clk_perclkx_set_rate, ++ .set_parent = _clk_perclkx_set_parent, ++ .get_rate = _clk_perclkx_getrate, ++ .enable = _perclk_enable, ++ .disable = _perclk_disable, ++ }, ++ { ++ .id = 6, ++ .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, ++ .get_rate = _clk_perclkx_getrate, ++ .enable = _perclk_enable, ++ .disable = _perclk_disable, ++ }, ++ { ++ .id = 7, ++ .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, ++ .get_rate = _clk_perclkx_getrate, ++ .enable = _perclk_enable, ++ .disable = _perclk_disable, ++ }, ++ { ++ .id = 8, ++ .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, ++ .get_rate = _clk_perclkx_getrate, ++ .enable = _perclk_enable, ++ .disable = _perclk_disable, ++ }, ++ { ++ .id = 9, ++ .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, ++ .get_rate = _clk_perclkx_getrate, ++ .enable = _perclk_enable, ++ .disable = _perclk_disable, ++ }, ++ { ++ .id = 10, ++ .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, ++ .get_rate = _clk_perclkx_getrate, ++ .enable = _perclk_enable, ++ .disable = _perclk_disable, ++ }, ++ { ++ .id = 11, ++ .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, ++ .get_rate = _clk_perclkx_getrate, ++ .enable = _perclk_enable, ++ .disable = _perclk_disable, ++ }, ++ { ++ .id = 12, ++ .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, ++ .get_rate = _clk_perclkx_getrate, ++ .enable = _perclk_enable, ++ .disable = _perclk_disable, ++ }, ++ { ++ .id = 13, ++ .parent = &ahb_clk, /* can be AHB or UPLL or 24.61MHz */ ++ .round_rate = _clk_perclkx_round_rate, ++ .set_rate = _clk_perclkx_set_rate, ++ .set_parent = _clk_perclkx_set_parent3, ++ .get_rate = _clk_perclkx_getrate, ++ .enable = _perclk_enable, ++ .disable = _perclk_disable, ++ }, ++ { ++ .id = 14, ++ .parent = &ahb_clk, /* can be AHB or UPLL or 24.61MHz */ ++ .round_rate = _clk_perclkx_round_rate, ++ .set_rate = _clk_perclkx_set_rate, ++ .set_parent = _clk_perclkx_set_parent3, ++ .get_rate = _clk_perclkx_getrate, ++ .enable = _perclk_enable, ++ .disable = _perclk_disable, ++ }, ++ { ++ .id = 15, ++ .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, ++ .get_rate = _clk_perclkx_getrate, ++ .enable = _perclk_enable, ++ .disable = _perclk_disable, ++ }, ++}; ++ ++struct clk nfc_clk = { ++ .id = 0, ++ .parent = &per_clk[8], ++}; ++ ++struct clk audmux_clk = { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_AUDMUX_OFFSET, ++ .disable = _clk_disable, ++}; ++ ++struct clk ata_clk[] = { ++ { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_ATA_OFFSET, ++ .disable = _clk_disable, ++ .secondary = &ata_clk[1], ++ }, ++ { ++ .id = 0, ++ .parent = &ahb_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR0, ++ .enable_shift = MXC_CCM_CGCR0_HCLK_ATA_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk can_clk[] = { ++ { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_CAN1_OFFSET, ++ .disable = _clk_disable, ++ }, ++ { ++ .id = 1, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_CAN2_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk csi_clk[] = { ++ { ++ .id = 0, ++ .parent = &per_clk[0], ++ .secondary = &csi_clk[1], ++ }, ++ { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_CSI_OFFSET, ++ .disable = _clk_disable, ++ .secondary = &csi_clk[2], ++ }, ++ { ++ .id = 0, ++ .parent = &ahb_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR0, ++ .enable_shift = MXC_CCM_CGCR0_HCLK_CSI_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk cspi_clk[] = { ++ { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_CSPI1_OFFSET, ++ .disable = _clk_disable, ++ }, ++ { ++ .id = 1, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_CSPI2_OFFSET, ++ .disable = _clk_disable, ++ }, ++ { ++ .id = 2, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_CSPI3_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk dryice_clk = { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_DRYICE_OFFSET, ++ .disable = _clk_disable, ++}; ++ ++struct clk ect_clk = { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_ECT_OFFSET, ++ .disable = _clk_disable, ++}; ++ ++struct clk epit1_clk[] = { ++ { ++ .id = 0, ++ .parent = &per_clk[1], ++ .secondary = &epit1_clk[1], ++ }, ++ { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_EPIT1_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk epit2_clk[] = { ++ { ++ .id = 1, ++ .parent = &per_clk[1], ++ .secondary = &epit2_clk[1], ++ }, ++ { ++ .id = 1, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_EPIT2_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk esai_clk[] = { ++ { ++ .id = 0, ++ .parent = &per_clk[2], ++ .secondary = &esai_clk[1], ++ }, ++ { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_ESAI_OFFSET, ++ .disable = _clk_disable, ++ .secondary = &esai_clk[2], ++ }, ++ { ++ .id = 0, ++ .parent = &ahb_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR0, ++ .enable_shift = MXC_CCM_CGCR0_HCLK_ESAI_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk esdhc1_clk[] = { ++ { ++ .id = 0, ++ .parent = &per_clk[3], ++ .secondary = &esdhc1_clk[1], ++ }, ++ { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_ESDHC1_OFFSET, ++ .disable = _clk_disable, ++ .secondary = &esdhc1_clk[2], ++ }, ++ { ++ .id = 0, ++ .parent = &ahb_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR0, ++ .enable_shift = MXC_CCM_CGCR0_HCLK_ESDHC1_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk esdhc2_clk[] = { ++ { ++ .id = 1, ++ .parent = &per_clk[4], ++ .secondary = &esdhc2_clk[1], ++ }, ++ { ++ .id = 1, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_ESDHC2_OFFSET, ++ .disable = _clk_disable, ++ .secondary = &esdhc2_clk[2], ++ }, ++ { ++ .id = 1, ++ .parent = &ahb_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR0, ++ .enable_shift = MXC_CCM_CGCR0_HCLK_ESDHC2_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk fec_clk[] = { ++ { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_FEC_OFFSET, ++ .disable = _clk_disable, ++ .secondary = &fec_clk[1], ++ }, ++ { ++ .id = 0, ++ .parent = &ahb_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR0, ++ .enable_shift = MXC_CCM_CGCR0_HCLK_FEC_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk gpio_clk[] = { ++ { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_GPIO1_OFFSET, ++ .disable = _clk_disable, ++ }, ++ { ++ .id = 1, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_GPIO2_OFFSET, ++ .disable = _clk_disable, ++ }, ++ { ++ .id = 2, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_GPIO3_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++static struct clk gpt1_clk[] = { ++ { ++ .id = 0, ++ .parent = &per_clk[5], ++ .secondary = &gpt1_clk[1], ++ }, ++ { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_GPT1_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++static struct clk gpt2_clk[] = { ++ { ++ .id = 1, ++ .parent = &per_clk[5], ++ .secondary = &gpt1_clk[1], ++ }, ++ { ++ .id = 1, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_GPT2_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++static struct clk gpt3_clk[] = { ++ { ++ .id = 2, ++ .parent = &per_clk[5], ++ .secondary = &gpt1_clk[1], ++ }, ++ { ++ .id = 2, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_GPT3_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++static struct clk gpt4_clk[] = { ++ { ++ .id = 3, ++ .parent = &per_clk[5], ++ .secondary = &gpt1_clk[1], ++ }, ++ { ++ .id = 3, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_GPT4_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk i2c_clk[] = { ++ { ++ .id = 0, ++ .parent = &per_clk[6], ++ }, ++ { ++ .id = 1, ++ .parent = &per_clk[6], ++ }, ++ { ++ .id = 2, ++ .parent = &per_clk[6], ++ }, ++}; ++ ++struct clk iim_clk = { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_IIM_OFFSET, ++ .disable = _clk_disable, ++}; ++ ++struct clk iomuxc_clk = { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_IOMUXC_OFFSET, ++ .disable = _clk_disable, ++}; ++ ++struct clk kpp_clk = { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_KPP_OFFSET, ++ .disable = _clk_disable, ++}; ++ ++struct clk lcdc_clk[] = { ++ { ++ .id = 0, ++ .parent = &per_clk[7], ++ .secondary = &lcdc_clk[1], ++ }, ++ { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_LCDC_OFFSET, ++ .disable = _clk_disable, ++ .secondary = &lcdc_clk[2], ++ }, ++ { ++ .id = 0, ++ .parent = &ahb_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR0, ++ .enable_shift = MXC_CCM_CGCR0_HCLK_LCDC_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk owire_clk[] = { ++ { ++ .id = 0, ++ .parent = &per_clk[9], ++ .secondary = &owire_clk[1], ++ }, ++ { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_OWIRE_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk pwm1_clk[] = { ++ { ++ .id = 0, ++ .parent = &per_clk[10], ++ .secondary = &pwm1_clk[1], ++ }, ++ { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_PWM1_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk pwm2_clk[] = { ++ { ++ .id = 1, ++ .parent = &per_clk[10], ++ .secondary = &pwm2_clk[1], ++ }, ++ { ++ .id = 1, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR2, ++ .enable_shift = MXC_CCM_CGCR2_PWM2_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk pwm3_clk[] = { ++ { ++ .id = 2, ++ .parent = &per_clk[10], ++ .secondary = &pwm3_clk[1], ++ }, ++ { ++ .id = 2, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR2, ++ .enable_shift = MXC_CCM_CGCR2_PWM3_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk pwm4_clk[] = { ++ { ++ .id = 3, ++ .parent = &per_clk[10], ++ .secondary = &pwm4_clk[1], ++ }, ++ { ++ .id = 3, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR2, ++ .enable_shift = MXC_CCM_CGCR2_PWM3_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk rngb_clk = { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR2, ++ .enable_shift = MXC_CCM_CGCR2_RNGB_OFFSET, ++ .disable = _clk_disable, ++}; ++ ++struct clk scc_clk = { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR2, ++ .enable_shift = MXC_CCM_CGCR2_SCC_OFFSET, ++ .disable = _clk_disable, ++}; ++ ++struct clk sdma_clk[] = { ++ { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR2, ++ .enable_shift = MXC_CCM_CGCR2_SDMA_OFFSET, ++ .disable = _clk_disable, ++ .secondary = &sdma_clk[1], ++ }, ++ { ++ .id = 0, ++ .parent = &ahb_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR0, ++ .enable_shift = MXC_CCM_CGCR0_HCLK_SDMA_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk sim1_clk[] = { ++ { ++ .id = 0, ++ .parent = &per_clk[11], ++ .secondary = &sim1_clk[1], ++ }, ++ { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR2, ++ .enable_shift = MXC_CCM_CGCR2_SIM1_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk sim2_clk[] = { ++ { ++ .id = 1, ++ .parent = &per_clk[12], ++ .secondary = &sim2_clk[1], ++ }, ++ { ++ .id = 1, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR2, ++ .enable_shift = MXC_CCM_CGCR2_SIM2_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk slcdc_clk[] = { ++ { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR2, ++ .enable_shift = MXC_CCM_CGCR2_SLCDC_OFFSET, ++ .disable = _clk_disable, ++ .secondary = &slcdc_clk[1], ++ }, ++ { ++ .id = 0, ++ .parent = &ahb_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR0, ++ .enable_shift = MXC_CCM_CGCR0_HCLK_SLCDC_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk spba_clk = { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR2, ++ .enable_shift = MXC_CCM_CGCR2_SPBA_OFFSET, ++ .disable = _clk_disable, ++}; ++ ++struct clk ssi1_clk[] = { ++ { ++ .id = 0, ++ .parent = &per_clk[13], ++ .secondary = &ssi1_clk[1], ++ }, ++ { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR2, ++ .enable_shift = MXC_CCM_CGCR2_SSI1_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk ssi2_clk[] = { ++ { ++ .id = 1, ++ .parent = &per_clk[14], ++ .secondary = &ssi2_clk[1], ++ }, ++ { ++ .id = 1, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR2, ++ .enable_shift = MXC_CCM_CGCR2_SSI2_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk tchscrn_clk = { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR2, ++ .enable_shift = MXC_CCM_CGCR2_TCHSCRN_OFFSET, ++ .disable = _clk_disable, ++}; ++ ++struct clk uart1_clk[] = { ++ { ++ .id = 0, ++ .parent = &per_clk[15], ++ .secondary = &uart1_clk[1], ++ }, ++ { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR2, ++ .enable_shift = MXC_CCM_CGCR2_UART1_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk uart2_clk[] = { ++ { ++ .id = 1, ++ .parent = &per_clk[15], ++ .secondary = &uart2_clk[1], ++ }, ++ { ++ .id = 1, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR2, ++ .enable_shift = MXC_CCM_CGCR2_UART2_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk uart3_clk[] = { ++ { ++ .id = 2, ++ .parent = &per_clk[15], ++ .secondary = &uart3_clk[1], ++ }, ++ { ++ .id = 2, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR2, ++ .enable_shift = MXC_CCM_CGCR2_UART3_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk uart4_clk[] = { ++ { ++ .id = 3, ++ .parent = &per_clk[15], ++ .secondary = &uart4_clk[1], ++ }, ++ { ++ .id = 3, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR2, ++ .enable_shift = MXC_CCM_CGCR2_UART4_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk uart5_clk[] = { ++ { ++ .id = 4, ++ .parent = &per_clk[15], ++ .secondary = &uart5_clk[1], ++ }, ++ { ++ .id = 4, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR2, ++ .enable_shift = MXC_CCM_CGCR2_UART5_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk wdog_clk = { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR2, ++ .enable_shift = MXC_CCM_CGCR2_WDOG_OFFSET, ++ .disable = _clk_disable, ++}; ++ ++static unsigned long _clk_usb_round_rate(struct clk *clk, unsigned long rate) ++{ ++ unsigned long div; ++ ++ div = clk_get_rate(clk->parent) / rate; ++ if (clk_get_rate(clk->parent) % rate) ++ div++; ++ ++ if (div > 64) ++ return -EINVAL; ++ ++ return clk_get_rate(clk->parent) / div; ++} ++ ++static int _clk_usb_set_rate(struct clk *clk, unsigned long rate) ++{ ++ unsigned long reg; ++ unsigned long div; ++ ++ div = clk_get_rate(clk->parent) / rate; ++ ++ if (clk_get_rate(clk->parent) / div != rate) ++ return -EINVAL; ++ if (div > 64) ++ return -EINVAL; ++ ++ reg = __raw_readl(MXC_CCM_CCTL) & ~MXC_CCM_CCTL_USB_DIV_MASK; ++ reg |= (div - 1) << MXC_CCM_CCTL_USB_DIV_OFFSET; ++ __raw_writel(reg, MXC_CCM_MCR); ++ ++ return 0; ++} ++ ++static unsigned long _clk_usb_getrate(struct clk *clk) ++{ ++ unsigned long 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); ++} ++ ++static int _clk_usb_set_parent(struct clk *clk, struct clk *parent) ++{ ++ unsigned long mcr; ++ ++ if (clk->parent == parent) ++ return 0; ++ if (parent != &upll_clk && parent != &ahb_clk) ++ return -EINVAL; ++ ++ clk->parent = parent; ++ mcr = __raw_readl(MXC_CCM_MCR); ++ if (parent == &ahb_clk) ++ mcr |= (1 << MXC_CCM_MCR_USB_CLK_MUX_OFFSET); ++ else ++ mcr &= ~(1 << MXC_CCM_MCR_USB_CLK_MUX_OFFSET); ++ ++ __raw_writel(mcr, MXC_CCM_MCR); ++ ++ return 0; ++} ++ ++static struct clk usb_clk = { ++ .parent = &upll_clk, ++ .get_rate = _clk_usb_getrate, ++ .set_rate = _clk_usb_set_rate, ++ .round_rate = _clk_usb_round_rate, ++ .set_parent = _clk_usb_set_parent, ++}; ++ ++/* CLKO */ ++ ++static unsigned long _clk_clko_round_rate(struct clk *clk, unsigned long rate) ++{ ++ unsigned long div; ++ ++ div = clk_get_rate(clk->parent) / rate; ++ if (clk_get_rate(clk->parent) % rate) ++ div++; ++ ++ if (div > 64) ++ return -EINVAL; ++ ++ return clk_get_rate(clk->parent) / div; ++} ++ ++static int _clk_clko_set_rate(struct clk *clk, unsigned long rate) ++{ ++ unsigned long reg; ++ unsigned long div; ++ ++ div = clk_get_rate(clk->parent) / rate; ++ ++ if ((clk_get_rate(clk->parent) / div) != rate) ++ return -EINVAL; ++ if (div > 64) ++ return -EINVAL; ++ ++ reg = __raw_readl(MXC_CCM_MCR) & ~MXC_CCM_MCR_CLKO_DIV_MASK; ++ reg |= (div - 1) << MXC_CCM_MCR_CLKO_DIV_OFFSET; ++ __raw_writel(reg, MXC_CCM_MCR); ++ ++ return 0; ++} ++ ++static unsigned long _clk_clko_getrate(struct clk *clk) ++{ ++ unsigned long div = __raw_readl(MXC_CCM_MCR); ++ ++ div &= MXC_CCM_MCR_CLKO_DIV_MASK; ++ div >>= MXC_CCM_MCR_CLKO_DIV_OFFSET; ++ ++ return clk_get_rate(clk->parent) / (div + 1); ++} ++ ++static struct clk *clko_sources[] = { ++ &osc32k_clk, /* 0x0 */ ++ &osc24m_clk, /* 0x1 */ ++ &cpu_clk, /* 0x2 */ ++ &ahb_clk, /* 0x3 */ ++ &ipg_clk, /* 0x4 */ ++ NULL, /* 0x5 */ ++ NULL, /* 0x6 */ ++ NULL, /* 0x7 */ ++ NULL, /* 0x8 */ ++ NULL, /* 0x9 */ ++ &per_clk[0], /* 0xA */ ++ &per_clk[2], /* 0xB */ ++ &per_clk[13], /* 0xC */ ++ &per_clk[14], /* 0xD */ ++ &usb_clk, /* 0xE */ ++ NULL, /* 0xF */ ++}; ++ ++#define NR_CLKO_SOURCES (sizeof(clko_sources) / sizeof(struct clk *)) ++ ++static int _clk_clko_set_parent(struct clk *clk, struct clk *parent) ++{ ++ unsigned long reg; ++ struct clk **src; ++ int i; ++ ++ if (clk->parent == parent) ++ return 0; ++ for (i = 0, src = clko_sources; i < NR_CLKO_SOURCES; i++, src++) ++ if (*src == parent) ++ break; ++ ++ if (i == NR_CLKO_SOURCES) ++ return -EINVAL; ++ ++ clk->parent = parent; ++ ++ reg = __raw_readl(MXC_CCM_MCR) & ~MXC_CCM_MCR_CLKO_SEL_MASK; ++ reg |= i << MXC_CCM_MCR_CLKO_SEL_OFFSET; ++ __raw_writel(reg, MXC_CCM_MCR); ++ ++ return 0; ++} ++ ++static struct clk clko_clk = { ++ .set_rate = _clk_clko_set_rate, ++ .round_rate = _clk_clko_round_rate, ++ .set_parent = _clk_clko_set_parent, ++ .get_rate = _clk_clko_getrate, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_MCR, ++ .enable_shift = MXC_CCM_MCR_CLKO_EN_OFFSET, ++ .disable = _clk_disable, ++}; ++ ++#define _REGISTER_CLOCK(d, n, c) \ ++ { \ ++ .dev_id = d, \ ++ .con_id = n, \ ++ .clk = &c, \ ++ }, ++ ++static struct clk_lookup lookups[] = { ++ _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(NULL, "csi", csi_clk[0]) ++ _REGISTER_CLOCK(NULL, "cspi.0", cspi_clk[0]) ++ _REGISTER_CLOCK(NULL, "cspi.1", cspi_clk[1]) ++ _REGISTER_CLOCK(NULL, "cspi.2", cspi_clk[2]) ++ _REGISTER_CLOCK(NULL, "dryice", dryice_clk) ++ _REGISTER_CLOCK(NULL, "ect", ect_clk) ++ _REGISTER_CLOCK(NULL, "epit1", epit1_clk[0]) ++ _REGISTER_CLOCK(NULL, "epit2", epit2_clk[0]) ++ _REGISTER_CLOCK(NULL, "esai", esai_clk[0]) ++ _REGISTER_CLOCK("mxc-mmc.0", NULL, esdhc1_clk[0]) ++ _REGISTER_CLOCK("mxc-mmc.1", NULL, esdhc2_clk[0]) ++ _REGISTER_CLOCK("fec.0", NULL, fec_clk[0]) ++ _REGISTER_CLOCK(NULL, "gpio0", gpio_clk[0]) ++ _REGISTER_CLOCK(NULL, "gpio1", gpio_clk[1]) ++ _REGISTER_CLOCK(NULL, "gpio2", gpio_clk[2]) ++ _REGISTER_CLOCK(NULL, "gpt1", gpt1_clk[0]) ++ _REGISTER_CLOCK(NULL, "gpt2", gpt2_clk[0]) ++ _REGISTER_CLOCK(NULL, "gpt3", gpt3_clk[0]) ++ _REGISTER_CLOCK(NULL, "gpt4", gpt4_clk[0]) ++ _REGISTER_CLOCK("imx-i2c.0", NULL, i2c_clk[0]) ++ _REGISTER_CLOCK("imx-i2c.1", NULL, i2c_clk[1]) ++ _REGISTER_CLOCK("imx-i2c.2", NULL, i2c_clk[2]) ++ _REGISTER_CLOCK(NULL, "iim", iim_clk) ++ _REGISTER_CLOCK(NULL, "iomuxc", iomuxc_clk) ++ _REGISTER_CLOCK(NULL, "kpp", kpp_clk) ++ _REGISTER_CLOCK("imx-fb.0", NULL, lcdc_clk[0]) ++ _REGISTER_CLOCK(NULL, "owire", owire_clk[0]) ++ _REGISTER_CLOCK("mxc_pwm.0", NULL, pwm1_clk[0]) ++ _REGISTER_CLOCK("mxc_pwm.1", NULL, pwm2_clk[0]) ++ _REGISTER_CLOCK("mxc_pwm.2", NULL, pwm3_clk[0]) ++ _REGISTER_CLOCK("mxc_pwm.3", NULL, pwm4_clk[0]) ++ _REGISTER_CLOCK(NULL, "rngb", rngb_clk) ++ _REGISTER_CLOCK(NULL, "scc", scc_clk) ++ _REGISTER_CLOCK(NULL, "sdma", sdma_clk[0]) ++ _REGISTER_CLOCK(NULL, "sim1", sim1_clk[0]) ++ _REGISTER_CLOCK(NULL, "sim2", sim2_clk[0]) ++ _REGISTER_CLOCK(NULL, "slcdc", slcdc_clk[0]) ++ _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("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("imx-wdt.0", NULL, wdog_clk) ++ _REGISTER_CLOCK(NULL, "usb", usb_clk) ++ _REGISTER_CLOCK(NULL, "clko", clko_clk) ++ _REGISTER_CLOCK(NULL, "brom", brom_clk) ++}; ++ ++int __init mx25_clocks_init(unsigned long fref) ++{ ++ int i; ++ ++ 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 : ""); ++ clkdev_add(&lookups[i]); ++ } ++ ++ ckih_rate = fref; ++#ifndef CONFIG_DEBUG_LL ++ /* Turn off all possible clocks */ ++ __raw_writel((1 << MXC_CCM_CGCR0_HCLK_EMI_OFFSET), MXC_CCM_CGCR0); ++ ++ __raw_writel((1 << MXC_CCM_CGCR1_GPT1_OFFSET) | ++ (1 << MXC_CCM_CGCR1_IIM_OFFSET), MXC_CCM_CGCR1); ++ __raw_writel(1 << MXC_CCM_CGCR2_SCC_OFFSET, MXC_CCM_CGCR2); ++#endif ++#if 1 ++ /* Set all perclk sources to upll */ ++ for (i = 0; i < ARRAY_SIZE(per_clk); i++) { ++ int ret; ++ unsigned long rate = per_clk[i].get_rate(&per_clk[i]); ++ ++#ifdef CONFIG_DEBUG_LL ++ if (i == 15) { ++ printk(KERN_DEBUG "skipping per_clk[%d] rate=%lu\n", i, rate); ++ continue; ++ } ++#endif ++ { ++ unsigned long new_rate; ++ ++ 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); ++ clk_set_rate(&per_clk[8], clk_get_rate(&ahb_clk) / 6); ++ ++ /* This will propagate to all children and init all the clock rates */ ++#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)); ++ ++ pr_info("CPU: %lu.%03luMHz\n", ++ clk_get_rate(&cpu_clk) / 1000000, clk_get_rate(&cpu_clk) / 1000 % 1000); ++ pr_info("AHB: %lu.%03luMHz\n", ++ clk_get_rate(&ahb_clk) / 1000000, clk_get_rate(&ahb_clk) / 1000 % 1000); ++ pr_info("MPLL: %lu.%03luMHz\n", ++ clk_get_rate(&mpll_clk) / 1000000, clk_get_rate(&mpll_clk) / 1000 % 1000); ++ pr_info("UPLL: %lu.%03luMHz\n", ++ clk_get_rate(&upll_clk) / 1000000, clk_get_rate(&upll_clk) / 1000 % 1000); ++ 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]); ++ 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:59:15.000000000 +0200 +@@ -621,7 +621,7 @@ DEFINE_CLOCK1(csi_clk, 0, 0, 0, + .clk = &c, \ + }, + +-static struct clk_lookup lookups[] __initdata = { ++static struct clk_lookup lookups[] = { + _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:59:17.000000000 +0200 +@@ -0,0 +1,65 @@ ++/* ++ * arch/arm/mach-mx2/cpu_mx25.c ++ * ++ * Copyright 2009 Lothar Wassmann ++ * derived from: cpu_mx27.c ++ * Copyright 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., 51 Franklin Street, Fifth Floor, Boston, ++ * MA 02110-1301, USA. ++ */ ++ ++/* ++ * i.MX25 specific CPU detection code ++ */ ++ ++#include ++#include ++ ++#include ++ ++static int cpu_silicon_rev = -1; ++static int cpu_partnumber; ++ ++#define IIM_PREV_REG IO_ADDRESS(IIM_BASE_ADDR + 0x20) ++#define IIM_SREV_REG IO_ADDRESS(IIM_BASE_ADDR + 0x24) ++ ++static void query_silicon_parameter(void) ++{ ++ cpu_partnumber = __raw_readl(IIM_PREV_REG) >> 3; ++ cpu_silicon_rev = __raw_readl(IIM_SREV_REG); ++ ++ printk(KERN_DEBUG "CPU rev: 0x%02x chip_rev: 0x%02x\n", ++ cpu_partnumber, cpu_silicon_rev); ++ if (WARN_ON(cpu_partnumber != 0x1f)) { ++ printk(KERN_WARNING "Unsupported CPU rev: 0x%02x\n", cpu_partnumber); ++ } ++} ++ ++/* ++ * Returns: ++ * the silicon revision of the cpu ++ * -EINVAL - not a mx25 ++ */ ++int mx25_revision(void) ++{ ++ if (cpu_silicon_rev == -1) ++ query_silicon_parameter(); ++ ++ if (cpu_partnumber != 0x1f) ++ return -EINVAL; ++ ++ 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:59:17.000000000 +0200 +@@ -0,0 +1,190 @@ ++/* ++ * Copyright 2008 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 __ARCH_ARM_MACH_MX25_CRM_REGS_H__ ++#define __ARCH_ARM_MACH_MX25_CRM_REGS_H__ ++ ++#include ++ ++/* Register offsets */ ++#define MXC_CCM_MPCTL (IO_ADDRESS(CCM_BASE_ADDR) + 0x00) ++#define MXC_CCM_UPCTL (IO_ADDRESS(CCM_BASE_ADDR) + 0x04) ++#define MXC_CCM_CCTL (IO_ADDRESS(CCM_BASE_ADDR) + 0x08) ++#define MXC_CCM_CGCR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x0C) ++#define MXC_CCM_CGCR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x10) ++#define MXC_CCM_CGCR2 (IO_ADDRESS(CCM_BASE_ADDR) + 0x14) ++#define MXC_CCM_PCDR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x18) ++#define MXC_CCM_PCDR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x1C) ++#define MXC_CCM_PCDR2 (IO_ADDRESS(CCM_BASE_ADDR) + 0x20) ++#define MXC_CCM_PCDR3 (IO_ADDRESS(CCM_BASE_ADDR) + 0x24) ++#define MXC_CCM_RCSR (IO_ADDRESS(CCM_BASE_ADDR) + 0x28) ++#define MXC_CCM_CRDR (IO_ADDRESS(CCM_BASE_ADDR) + 0x2C) ++#define MXC_CCM_DCVR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x30) ++#define MXC_CCM_DCVR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x34) ++#define MXC_CCM_DCVR2 (IO_ADDRESS(CCM_BASE_ADDR) + 0x38) ++#define MXC_CCM_DCVR3 (IO_ADDRESS(CCM_BASE_ADDR) + 0x3C) ++#define MXC_CCM_LTR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x40) ++#define MXC_CCM_LTR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x44) ++#define MXC_CCM_LTR2 (IO_ADDRESS(CCM_BASE_ADDR) + 0x48) ++#define MXC_CCM_LTR3 (IO_ADDRESS(CCM_BASE_ADDR) + 0x4C) ++#define MXC_CCM_LTBR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x50) ++#define MXC_CCM_LTBR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x54) ++#define MXC_CCM_PMCR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x58) ++#define MXC_CCM_PMCR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x5C) ++#define MXC_CCM_PMCR2 (IO_ADDRESS(CCM_BASE_ADDR) + 0x60) ++#define MXC_CCM_MCR (IO_ADDRESS(CCM_BASE_ADDR) + 0x64) ++ ++#define MXC_CCM_MPCTL_BRMO (1 << 31) ++#define MXC_CCM_MPCTL_PD_OFFSET 26 ++#define MXC_CCM_MPCTL_PD_MASK (0xf << 26) ++#define MXC_CCM_MPCTL_MFD_OFFSET 16 ++#define MXC_CCM_MPCTL_MFD_MASK (0x3ff << 16) ++#define MXC_CCM_MPCTL_MFI_OFFSET 10 ++#define MXC_CCM_MPCTL_MFI_MASK (0xf << 10) ++#define MXC_CCM_MPCTL_MFN_OFFSET 0 ++#define MXC_CCM_MPCTL_MFN_MASK 0x3ff ++#define MXC_CCM_MPCTL_LF (1 << 15) ++ ++#define MXC_CCM_UPCTL_BRMO (1 << 31) ++#define MXC_CCM_UPCTL_PD_OFFSET 26 ++#define MXC_CCM_UPCTL_PD_MASK (0xf << 26) ++#define MXC_CCM_UPCTL_MFD_OFFSET 16 ++#define MXC_CCM_UPCTL_MFD_MASK (0x3ff << 16) ++#define MXC_CCM_UPCTL_MFI_OFFSET 10 ++#define MXC_CCM_UPCTL_MFI_MASK (0xf << 10) ++#define MXC_CCM_UPCTL_MFN_OFFSET 0 ++#define MXC_CCM_UPCTL_MFN_MASK 0x3ff ++#define MXC_CCM_UPCTL_LF (1 << 15) ++ ++#define MXC_CCM_CCTL_ARM_OFFSET 30 ++#define MXC_CCM_CCTL_ARM_MASK (0x3 << 30) ++#define MXC_CCM_CCTL_AHB_OFFSET 28 ++#define MXC_CCM_CCTL_AHB_MASK (0x3 << 28) ++#define MXC_CCM_CCTL_MPLL_RST (1 << 27) ++#define MXC_CCM_CCTL_UPLL_RST (1 << 26) ++#define MXC_CCM_CCTL_LP_CTL_OFFSET 24 ++#define MXC_CCM_CCTL_LP_CTL_MASK (0x3 << 24) ++#define MXC_CCM_CCTL_LP_MODE_RUN (0x0 << 24) ++#define MXC_CCM_CCTL_LP_MODE_WAIT (0x1 << 24) ++#define MXC_CCM_CCTL_LP_MODE_DOZE (0x2 << 24) ++#define MXC_CCM_CCTL_LP_MODE_STOP (0x3 << 24) ++#define MXC_CCM_CCTL_UPLL_DISABLE (1 << 23) ++#define MXC_CCM_CCTL_MPLL_BYPASS (1 << 22) ++#define MXC_CCM_CCTL_USB_DIV_OFFSET 16 ++#define MXC_CCM_CCTL_USB_DIV_MASK (0x3 << 16) ++#define MXC_CCM_CCTL_CG_CTRL (1 << 15) ++#define MXC_CCM_CCTL_ARM_SRC (1 << 14) ++ ++#define MXC_CCM_CGCR0_HCLK_ATA_OFFSET 16 ++#define MXC_CCM_CGCR0_HCLK_BROM_OFFSET 17 ++#define MXC_CCM_CGCR0_HCLK_CSI_OFFSET 18 ++#define MXC_CCM_CGCR0_HCLK_EMI_OFFSET 19 ++#define MXC_CCM_CGCR0_HCLK_ESAI_OFFSET 20 ++#define MXC_CCM_CGCR0_HCLK_ESDHC1_OFFSET 21 ++#define MXC_CCM_CGCR0_HCLK_ESDHC2_OFFSET 22 ++#define MXC_CCM_CGCR0_HCLK_FEC_OFFSET 23 ++#define MXC_CCM_CGCR0_HCLK_LCDC_OFFSET 24 ++#define MXC_CCM_CGCR0_HCLK_RTIC_OFFSET 25 ++#define MXC_CCM_CGCR0_HCLK_SDMA_OFFSET 26 ++#define MXC_CCM_CGCR0_HCLK_SLCDC_OFFSET 27 ++#define MXC_CCM_CGCR0_HCLK_USBOTG_OFFSET 28 ++ ++#define MXC_CCM_CGCR0_PER_CSI_OFFSET 0 ++#define MXC_CCM_CGCR0_PER_EPIT_OFFSET 1 ++#define MXC_CCM_CGCR0_PER_ESAI_OFFSET 2 ++#define MXC_CCM_CGCR0_PER_ESDHC1_OFFSET 3 ++#define MXC_CCM_CGCR0_PER_ESDHC2_OFFSET 4 ++#define MXC_CCM_CGCR0_PER_GPT_OFFSET 5 ++#define MXC_CCM_CGCR0_PER_I2C_OFFSET 6 ++#define MXC_CCM_CGCR0_PER_LCDC_OFFSET 7 ++#define MXC_CCM_CGCR0_PER_NFC_OFFSET 8 ++#define MXC_CCM_CGCR0_PER_OWIRE_OFFSET 9 ++#define MXC_CCM_CGCR0_PER_PWM_OFFSET 10 ++#define MXC_CCM_CGCR0_PER_SIM1_OFFSET 11 ++#define MXC_CCM_CGCR0_PER_SIM2_OFFSET 12 ++#define MXC_CCM_CGCR0_PER_SSI1_OFFSET 13 ++#define MXC_CCM_CGCR0_PER_SSI2_OFFSET 14 ++#define MXC_CCM_CGCR0_PER_UART_OFFSET 15 ++ ++#define MXC_CCM_CGCR1_AUDMUX_OFFSET 0 ++#define MXC_CCM_CGCR1_ATA_OFFSET 1 ++#define MXC_CCM_CGCR1_CAN1_OFFSET 2 ++#define MXC_CCM_CGCR1_CAN2_OFFSET 3 ++#define MXC_CCM_CGCR1_CSI_OFFSET 4 ++#define MXC_CCM_CGCR1_CSPI1_OFFSET 5 ++#define MXC_CCM_CGCR1_CSPI2_OFFSET 6 ++#define MXC_CCM_CGCR1_CSPI3_OFFSET 7 ++#define MXC_CCM_CGCR1_DRYICE_OFFSET 8 ++#define MXC_CCM_CGCR1_ECT_OFFSET 9 ++#define MXC_CCM_CGCR1_EPIT1_OFFSET 10 ++#define MXC_CCM_CGCR1_EPIT2_OFFSET 11 ++#define MXC_CCM_CGCR1_ESAI_OFFSET 12 ++#define MXC_CCM_CGCR1_ESDHC1_OFFSET 13 ++#define MXC_CCM_CGCR1_ESDHC2_OFFSET 14 ++#define MXC_CCM_CGCR1_FEC_OFFSET 15 ++#define MXC_CCM_CGCR1_GPIO1_OFFSET 16 ++#define MXC_CCM_CGCR1_GPIO2_OFFSET 17 ++#define MXC_CCM_CGCR1_GPIO3_OFFSET 18 ++#define MXC_CCM_CGCR1_GPT1_OFFSET 19 ++#define MXC_CCM_CGCR1_GPT2_OFFSET 20 ++#define MXC_CCM_CGCR1_GPT3_OFFSET 21 ++#define MXC_CCM_CGCR1_GPT4_OFFSET 22 ++#define MXC_CCM_CGCR1_I2C1_OFFSET 23 ++#define MXC_CCM_CGCR1_I2C2_OFFSET 24 ++#define MXC_CCM_CGCR1_I2C3_OFFSET 25 ++#define MXC_CCM_CGCR1_IIM_OFFSET 26 ++#define MXC_CCM_CGCR1_IOMUXC_OFFSET 27 ++#define MXC_CCM_CGCR1_KPP_OFFSET 28 ++#define MXC_CCM_CGCR1_LCDC_OFFSET 29 ++#define MXC_CCM_CGCR1_OWIRE_OFFSET 30 ++#define MXC_CCM_CGCR1_PWM1_OFFSET 31 ++ ++#define MXC_CCM_CGCR2_PWM2_OFFSET (32-32) ++#define MXC_CCM_CGCR2_PWM3_OFFSET (33-32) ++#define MXC_CCM_CGCR2_PWM4_OFFSET (34-32) ++#define MXC_CCM_CGCR2_RNGB_OFFSET (35-32) ++#define MXC_CCM_CGCR2_RTIC_OFFSET (36-32) ++#define MXC_CCM_CGCR2_SCC_OFFSET (37-32) ++#define MXC_CCM_CGCR2_SDMA_OFFSET (38-32) ++#define MXC_CCM_CGCR2_SIM1_OFFSET (39-32) ++#define MXC_CCM_CGCR2_SIM2_OFFSET (40-32) ++#define MXC_CCM_CGCR2_SLCDC_OFFSET (41-32) ++#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_UART1_OFFSET (46-32) ++#define MXC_CCM_CGCR2_UART2_OFFSET (47-32) ++#define MXC_CCM_CGCR2_UART3_OFFSET (48-32) ++#define MXC_CCM_CGCR2_UART4_OFFSET (49-32) ++#define MXC_CCM_CGCR2_UART5_OFFSET (50-32) ++#define MXC_CCM_CGCR2_WDOG_OFFSET (51-32) ++ ++#define MXC_CCM_PCDR1_PERDIV1_MASK 0x3f ++ ++#define MXC_CCM_RCSR_NF16B (1 << 14) ++ ++#define MXC_CCM_MCR_USB_XTAL_MUX_OFFSET 31 ++#define MXC_CCM_MCR_CLKO_EN_OFFSET 30 ++#define MXC_CCM_MCR_CLKO_DIV_OFFSET 24 ++#define MXC_CCM_MCR_CLKO_DIV_MASK (0x3F << 24) ++#define MXC_CCM_MCR_CLKO_SEL_OFFSET 20 ++#define MXC_CCM_MCR_CLKO_SEL_MASK (0xF << 20) ++#define MXC_CCM_MCR_ESAI_CLK_MUX_OFFSET 19 ++#define MXC_CCM_MCR_SSI2_CLK_MUX_OFFSET 18 ++#define MXC_CCM_MCR_SSI1_CLK_MUX_OFFSET 17 ++#define MXC_CCM_MCR_USB_CLK_MUX_OFFSET 16 ++ ++#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:59:16.000000000 +0200 +@@ -20,3 +20,9 @@ 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; ++#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:59:17.000000000 +0200 +@@ -0,0 +1,402 @@ ++/* ++ * Copyright 2008 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 ++ */ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++ ++#include "sdma_script_code.h" ++ ++#include "karo.h" ++ ++void mx25_sdma_get_script_info(sdma_script_start_addrs * sdma_script_addr) ++{ ++ sdma_script_addr->mxc_sdma_ap_2_ap_addr = ap_2_ap_ADDR; ++ sdma_script_addr->mxc_sdma_ap_2_bp_addr = -1; ++ sdma_script_addr->mxc_sdma_bp_2_ap_addr = -1; ++ sdma_script_addr->mxc_sdma_loopback_on_dsp_side_addr = -1; ++ sdma_script_addr->mxc_sdma_mcu_interrupt_only_addr = -1; ++ ++ sdma_script_addr->mxc_sdma_firi_2_per_addr = -1; ++ sdma_script_addr->mxc_sdma_firi_2_mcu_addr = -1; ++ sdma_script_addr->mxc_sdma_per_2_firi_addr = -1; ++ sdma_script_addr->mxc_sdma_mcu_2_firi_addr = -1; ++ ++ sdma_script_addr->mxc_sdma_uart_2_per_addr = uart_2_per_ADDR; ++ sdma_script_addr->mxc_sdma_uart_2_mcu_addr = uart_2_mcu_ADDR; ++ sdma_script_addr->mxc_sdma_per_2_app_addr = per_2_app_ADDR; ++ sdma_script_addr->mxc_sdma_mcu_2_app_addr = mcu_2_app_ADDR; ++ ++ sdma_script_addr->mxc_sdma_per_2_per_addr = -1; ++ ++ sdma_script_addr->mxc_sdma_uartsh_2_per_addr = uartsh_2_per_ADDR; ++ sdma_script_addr->mxc_sdma_uartsh_2_mcu_addr = uartsh_2_mcu_ADDR; ++ sdma_script_addr->mxc_sdma_per_2_shp_addr = per_2_shp_ADDR; ++ sdma_script_addr->mxc_sdma_mcu_2_shp_addr = mcu_2_shp_ADDR; ++ ++ sdma_script_addr->mxc_sdma_ata_2_mcu_addr = ata_2_mcu_ADDR; ++ sdma_script_addr->mxc_sdma_mcu_2_ata_addr = mcu_2_ata_ADDR; ++ ++ sdma_script_addr->mxc_sdma_app_2_per_addr = app_2_per_ADDR; ++ sdma_script_addr->mxc_sdma_app_2_mcu_addr = app_2_mcu_ADDR; ++ sdma_script_addr->mxc_sdma_shp_2_per_addr = shp_2_per_ADDR; ++ sdma_script_addr->mxc_sdma_shp_2_mcu_addr = shp_2_mcu_ADDR; ++ ++ sdma_script_addr->mxc_sdma_mshc_2_mcu_addr = -1; ++ sdma_script_addr->mxc_sdma_mcu_2_mshc_addr = -1; ++ ++ sdma_script_addr->mxc_sdma_spdif_2_mcu_addr = -1; ++ sdma_script_addr->mxc_sdma_mcu_2_spdif_addr = -1; ++ ++ sdma_script_addr->mxc_sdma_asrc_2_mcu_addr = -1; ++ ++ sdma_script_addr->mxc_sdma_dptc_dvfs_addr = -1; ++ sdma_script_addr->mxc_sdma_ext_mem_2_ipu_addr = ext_mem__ipu_ram_ADDR; ++ sdma_script_addr->mxc_sdma_descrambler_addr = -1; ++ ++ sdma_script_addr->mxc_sdma_start_addr = (unsigned short *)sdma_code; ++ sdma_script_addr->mxc_sdma_ram_code_size = RAM_CODE_SIZE; ++ sdma_script_addr->mxc_sdma_ram_code_start_addr = RAM_CODE_START_ADDR; ++} ++ ++#if defined(CONFIG_MXC_WATCHDOG) || defined(CONFIG_MXC_WATCHDOG_MODULE) ++static struct resource wdt_resources[] = { ++ { ++ .start = WDOG_BASE_ADDR, ++ .end = WDOG_BASE_ADDR + 0x2f, ++ .flags = IORESOURCE_MEM, ++ }, ++}; ++ ++static struct platform_device mx25_wdt_device = { ++ .name = "mxc_wdt", ++ .id = 0, ++ .num_resources = ARRAY_SIZE(wdt_resources), ++ .resource = wdt_resources, ++}; ++ ++static void mx25_init_wdt(void) ++{ ++ (void)platform_device_register(&mx25_wdt_device); ++} ++#else ++static inline void mx25_init_wdt(void) ++{ ++} ++#endif ++ ++/* ++ * lcdc: ++ * - i.MX1: the basic controller ++ * - i.MX21: to be checked ++ * - i.MX27: like i.MX1, with slightly variations ++ */ ++static struct resource mxc_fb[] = { ++ { ++ .start = LCDC_BASE_ADDR, ++ .end = LCDC_BASE_ADDR + 0xFFF, ++ .flags = IORESOURCE_MEM, ++ }, ++ { ++ .start = MXC_INT_LCDC, ++ .end = MXC_INT_LCDC, ++ .flags = IORESOURCE_IRQ, ++ } ++}; ++ ++/* mxc lcd driver */ ++struct platform_device mxc_fb_device = { ++ .name = "imx-fb", ++ .id = 0, ++ .num_resources = ARRAY_SIZE(mxc_fb), ++ .resource = mxc_fb, ++ .dev = { ++ .coherent_dma_mask = 0xFFFFFFFF, ++ }, ++}; ++ ++/* SPI controller and device data */ ++#if defined(CONFIG_SPI_MXC) || defined(CONFIG_SPI_MXC_MODULE) ++ ++#ifdef CONFIG_SPI_MXC_SELECT1 ++/*! ++ * 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, ++ }, ++}; ++ ++/*! Platform Data for MXC CSPI1 */ ++static struct mxc_spi_master mx25_spi1_data = { ++ .maxchipselect = 4, ++ .spi_version = 7, ++}; ++ ++/*! Device Definition for MXC CSPI1 */ ++static struct platform_device mx25_spi1_device = { ++ .name = "mxc_spi", ++ .id = 0, ++ .dev = { ++ .platform_data = &mx25_spi1_data, ++ }, ++ .num_resources = ARRAY_SIZE(mx25_spi1_resources), ++ .resource = mx25_spi1_resources, ++}; ++ ++#endif /* CONFIG_SPI_MXC_SELECT1 */ ++ ++#ifdef CONFIG_SPI_MXC_SELECT2 ++/*! ++ * 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, ++ }, ++}; ++ ++/*! Platform Data for MXC CSPI2 */ ++static struct mxc_spi_master mx25_spi2_data = { ++ .maxchipselect = 4, ++ .spi_version = 7, ++}; ++ ++/*! Device Definition for MXC CSPI2 */ ++static struct platform_device mx25_spi2_device = { ++ .name = "mxc_spi", ++ .id = 1, ++ .dev = { ++ .platform_data = &mx25_spi2_data, ++ }, ++ .num_resources = ARRAY_SIZE(mx25_spi2_resources), ++ .resource = mx25_spi2_resources, ++}; ++#endif /* CONFIG_SPI_MXC_SELECT2 */ ++ ++#ifdef CONFIG_SPI_MXC_SELECT3 ++/*! ++ * 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, ++ }, ++}; ++ ++/*! Platform Data for MXC CSPI3 */ ++static struct mxc_spi_master mx25_spi3_data = { ++ .maxchipselect = 4, ++ .spi_version = 7, ++}; ++ ++/*! Device Definition for MXC CSPI3 */ ++static struct platform_device mx25_spi3_device = { ++ .name = "mxc_spi", ++ .id = 2, ++ .dev = { ++ .platform_data = &mx25_spi3_data, ++ }, ++ .num_resources = ARRAY_SIZE(mx25_spi3_resources), ++ .resource = mx25_spi3_resources, ++}; ++#endif /* CONFIG_SPI_MXC_SELECT3 */ ++ ++static inline void mx25_init_spi(void) ++{ ++ spba_take_ownership(SPBA_CSPI2, SPBA_MASTER_A); ++ spba_take_ownership(SPBA_CSPI3, SPBA_MASTER_A); ++ ++#ifdef CONFIG_SPI_MXC_SELECT1 ++ if (platform_device_register(&mx25_spi1_device) < 0) ++ printk(KERN_ERR "Error: Registering the SPI Controller_1\n"); ++#endif /* CONFIG_SPI_MXC_SELECT1 */ ++#ifdef CONFIG_SPI_MXC_SELECT2 ++ if (platform_device_register(&mx25_spi2_device) < 0) ++ printk(KERN_ERR "Error: Registering the SPI Controller_2\n"); ++#endif /* CONFIG_SPI_MXC_SELECT2 */ ++#ifdef CONFIG_SPI_MXC_SELECT3 ++ if (platform_device_register(&mx25_spi3_device) < 0) ++ printk(KERN_ERR "Error: Registering the SPI Controller_3\n"); ++#endif /* CONFIG_SPI_MXC_SELECT3 */ ++} ++#else ++static inline void mx25_init_spi(void) ++{ ++} ++#endif ++ ++/* I2C controller and device data */ ++#if defined(CONFIG_I2C_IMX) || defined(CONFIG_I2C_IMX_MODULE) ++ ++/*! ++ * 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, ++ }, ++}; ++ ++/*! ++ * 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, ++ }, ++}; ++ ++/*! ++ * 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, ++ }, ++}; ++ ++/*! Device Definition for MXC I2C1 */ ++struct platform_device mx25_i2c_device0 = { ++ .name = "imx-i2c", ++ .id = 0, ++ .num_resources = ARRAY_SIZE(mx25_i2c1_resources), ++ .resource = mx25_i2c1_resources, ++}; ++ ++struct platform_device mx25_i2c_device1 = { ++ .name = "imx-i2c", ++ .id = 1, ++ .num_resources = ARRAY_SIZE(mx25_i2c2_resources), ++ .resource = mx25_i2c2_resources, ++}; ++ ++struct platform_device mx25_i2c_device2 = { ++ .name = "imx-i2c", ++ .id = 2, ++ .num_resources = ARRAY_SIZE(mx25_i2c3_resources), ++ .resource = mx25_i2c3_resources, ++}; ++#endif ++ ++static struct mxc_gpio_port mx25_gpio_ports[] = { ++ { ++ .chip.label = "gpio-1", ++ .base = IO_ADDRESS(GPIO1_BASE_ADDR), ++ .irq = MXC_INT_GPIO1, ++ .virtual_irq_start = MXC_GPIO_IRQ_START, ++ }, ++ { ++ .chip.label = "gpio-2", ++ .base = IO_ADDRESS(GPIO2_BASE_ADDR), ++ .irq = MXC_INT_GPIO2, ++ .virtual_irq_start = MXC_GPIO_IRQ_START + 1 * 32, ++ }, ++ { ++ .chip.label = "gpio-3", ++ .base = IO_ADDRESS(GPIO3_BASE_ADDR), ++ .irq = MXC_INT_GPIO3, ++ .virtual_irq_start = MXC_GPIO_IRQ_START + 2 * 32, ++ }, ++ { ++ .chip.label = "gpio-4", ++ .base = IO_ADDRESS(GPIO4_BASE_ADDR), ++ .irq = MXC_INT_GPIO4, ++ .virtual_irq_start = MXC_GPIO_IRQ_START + 3 * 32, ++ }, ++}; ++ ++static inline void mx25_init_ssi(void) ++{ ++ /* SPBA configuration for SSI - SDMA and MCU are set */ ++ spba_take_ownership(SPBA_SSI1, SPBA_MASTER_A | SPBA_MASTER_C); ++ spba_take_ownership(SPBA_SSI2, SPBA_MASTER_A | SPBA_MASTER_C); ++} ++ ++static struct platform_device mx25_dma_device = { ++ .name = "mxc_dma", ++ .id = 0, ++}; ++ ++static inline void mx25_init_dma(void) ++{ ++ (void)platform_device_register(&mx25_dma_device); ++} ++ ++static int __init mx25_init_devices(void) ++{ ++ mx25_init_wdt(); ++ mx25_init_spi(); ++ mx25_init_dma(); ++ mx25_init_ssi(); ++ ++ return 0; ++} ++arch_initcall(mx25_init_devices); ++ ++int __init mxc_register_gpios(void) ++{ ++ 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:59:16.000000000 +0200 +@@ -26,6 +26,7 @@ + #include + + /* MX27 memory map definition */ ++#if defined(CONFIG_MACH_MX27) || defined(CONFIG_MACH_MX21) + static struct map_desc mxc_io_desc[] __initdata = { + /* + * this fixed mapping covers: +@@ -61,7 +62,7 @@ static struct map_desc mxc_io_desc[] __i + .pfn = __phys_to_pfn(X_MEMC_BASE_ADDR), + .length = X_MEMC_SIZE, + .type = MT_DEVICE +- } ++ }, + }; + + /* +@@ -82,4 +83,46 @@ void __init mx27_map_io(void) + + iotable_init(mxc_io_desc, ARRAY_SIZE(mxc_io_desc)); + } ++#endif ++ ++#ifdef CONFIG_MACH_MX25 ++static struct map_desc mx25_io_desc[] __initdata = { ++ { ++ .virtual = (unsigned long)X_MEMC_BASE_ADDR_VIRT, ++ .pfn = __phys_to_pfn(X_MEMC_BASE_ADDR), ++ .length = X_MEMC_SIZE, ++ .type = MT_DEVICE ++ }, ++ { ++ .virtual = (unsigned long)ASIC_BASE_ADDR_VIRT, ++ .pfn = __phys_to_pfn(ASIC_BASE_ADDR), ++ .length = ASIC_SIZE, ++ .type = MT_DEVICE_NONSHARED ++ }, ++ { ++ .virtual = (unsigned long)AIPS1_BASE_ADDR_VIRT, ++ .pfn = __phys_to_pfn(AIPS1_BASE_ADDR), ++ .length = AIPS1_SIZE, ++ .type = MT_DEVICE_NONSHARED ++ }, ++ { ++ .virtual = (unsigned long)AIPS2_BASE_ADDR_VIRT, ++ .pfn = __phys_to_pfn(AIPS2_BASE_ADDR), ++ .length = AIPS2_SIZE, ++ .type = MT_DEVICE_NONSHARED ++ }, ++ { ++ .virtual = (unsigned long)SPBA0_BASE_ADDR_VIRT, ++ .pfn = __phys_to_pfn(SPBA0_BASE_ADDR), ++ .length = SPBA0_SIZE, ++ .type = MT_DEVICE_NONSHARED ++ }, ++}; ++ ++void __init mx25_map_io(void) ++{ ++ mxc_set_cpu_type(MXC_CPU_MX25); + ++ 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-08 12:47:51.000000000 +0200 +@@ -0,0 +1,1122 @@ ++/* ++ * arch/arm/mach-mx2/karo-tx25.c ++ * ++ * Copyright (C) 2008 Lothar Wassmann ++ * ++ * based on: arch/arm/mach-mx27ads.c (C) 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 ++ * 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 ++ * ++ * This file adds support for the Ka-Ro electronics TX25 processor modules ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++//#include ++//#include ++#include ++#include ++#include ++#if defined(CONFIG_MTD) || defined(CONFIG_MTD_MODULE) ++#include ++#include ++#include ++#include ++#endif ++ ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++//#include ++//#include ++#include ++#include ++#include ++//#include ++//#include ++//#include ++ ++#include "crm_regs.h" ++#include "devices.h" ++#include "karo.h" ++ ++#ifdef DEBUG ++int tx25_debug = 1; ++module_param(tx25_debug, int, S_IRUGO | S_IWUSR); ++#else ++static int tx25_debug; ++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) ++{ ++ 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); ++ } ++ } ++ 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; ++} ++device_initcall(tx25_usbh2_register); ++#endif // CONFIG_USB_EHCI_MXC ++ ++//#define FEC_MII_IRQ IRQ_GPIOD(8) ++ ++#if defined(CONFIG_FEC) || defined(CONFIG_FEC_MODULE) ++static struct resource fec_resources[] = { ++ { ++ .start = FEC_BASE_ADDR, ++ .end = FEC_BASE_ADDR + 0x18f, ++ .flags = IORESOURCE_MEM, ++ }, { ++ .start = FEC_BASE_ADDR + 0x200, ++ .end = FEC_BASE_ADDR + 0x30b, ++ .flags = IORESOURCE_MEM, ++ }, { ++ .start = MXC_INT_FEC, ++ .end = MXC_INT_FEC, ++ .flags = IORESOURCE_IRQ, ++#ifdef FEC_MII_IRQ ++ }, { ++ .start = FEC_MII_IRQ, ++ .end = FEC_MII_IRQ, ++ .flags = IORESOURCE_IRQ | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, ++#endif ++ }, ++}; ++ ++/* ++ * Setup GPIO for FEC device to be active ++ * ++ */ ++static struct pad_desc karo_tx25_fec_gpios_off[] = { ++ MX25_PAD_FEC_MDC__GPIO_3_5, ++ MX25_PAD_FEC_MDIO__GPIO_3_6, ++ MX25_PAD_FEC_TDATA0__GPIO_3_7, ++ MX25_PAD_FEC_TDATA1__GPIO_3_8, ++ MX25_PAD_FEC_TX_EN__GPIO_3_9, ++ MX25_PAD_FEC_RDATA0__GPIO_3_10, ++ MX25_PAD_FEC_RDATA1__GPIO_3_11, ++ MX25_PAD_FEC_RX_DV__GPIO_3_12, ++ MX25_PAD_FEC_TX_CLK__GPIO_3_13, ++ MX25_PAD_D12__GPIO_4_8, ++ MX25_PAD_D10__GPIO_4_10, ++}; ++ ++static struct pad_desc karo_tx25_fec_pwr_gpios[] = { ++ MX25_PAD_D11__GPIO_4_9, /* FEC PHY power on pin */ ++ MX25_PAD_D13__GPIO_4_7, /* FEC reset */ ++}; ++ ++static struct pad_desc karo_tx25_fec_gpios_on[] = { ++ MX25_PAD_FEC_MDC__FEC_MDC, ++ MX25_PAD_FEC_MDIO__FEC_MDIO, ++ MX25_PAD_FEC_TDATA0__FEC_TDATA0, ++ MX25_PAD_FEC_TDATA1__FEC_TDATA1, ++ MX25_PAD_FEC_TX_EN__FEC_TX_EN, ++ MX25_PAD_FEC_RDATA0__FEC_RDATA0, ++ MX25_PAD_FEC_RDATA1__FEC_RDATA1, ++ MX25_PAD_FEC_RX_DV__FEC_RX_DV, ++ MX25_PAD_FEC_TX_CLK__FEC_TX_CLK, ++ MX25_PAD_D12__GPIO_4_8, ++ MX25_PAD_D10__GPIO_4_10, ++}; ++ ++static struct gpio_desc { ++ unsigned int gpio:7; ++ unsigned int dir:1; ++ unsigned int level:1; ++} karo_tx25_fec_strap_gpios[] = { ++ /* configure the PHY strap pins to the correct values */ ++ { GPIO_PORTC | 5, 1, 0, }, ++ { GPIO_PORTC | 6, 1, 0, }, ++ { GPIO_PORTC | 7, 1, 0, }, ++ { GPIO_PORTC | 8, 1, 0, }, ++ { GPIO_PORTC | 9, 1, 0, }, ++ { GPIO_PORTC | 10, 1, 1, }, ++ { GPIO_PORTC | 11, 1, 1, }, ++ { GPIO_PORTC | 12, 0, 1, }, ++ { GPIO_PORTC | 13, 1, 0, }, ++ ++ { GPIO_PORTD | 8, 0, 0, }, ++ { GPIO_PORTD | 10, 0, 0, }, ++ { GPIO_PORTD | 9, 1, 1, }, ++ { GPIO_PORTD | 7, 1, 0, }, ++}; ++ ++#define TX25_FEC_PWR_GPIO (GPIO_PORTD | 9) ++#define TX25_FEC_RST_GPIO (GPIO_PORTD | 7) ++ ++static int gpio_fec_active(void) ++{ ++ int ret; ++ int i; ++ ++#ifdef FEC_MII_IRQ ++ DBG(0, "%s: Using IRQ %d (GPIO %d) for MII\n", __FUNCTION__, ++ FEC_MII_IRQ, irq_to_gpio(FEC_MII_IRQ)); ++ ++ set_irq_type(FEC_MII_IRQ, IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING); ++#endif ++ ret = mxc_iomux_v3_setup_multiple_pads(karo_tx25_fec_pwr_gpios, ++ ARRAY_SIZE(karo_tx25_fec_pwr_gpios)); ++ if (ret) { ++ return ret; ++ } ++ /* ++ * If the PHY is already powered on, assume it has been ++ * correctly configured (by the boot loader) ++ */ ++ if (0 && gpio_get_value(TX25_FEC_PWR_GPIO) && ++ gpio_get_value(TX25_FEC_RST_GPIO)) { ++ ret = mxc_iomux_v3_setup_multiple_pads(karo_tx25_fec_gpios_on, ++ ARRAY_SIZE(karo_tx25_fec_gpios_on)); ++ if (ret) { ++ mxc_iomux_v3_release_multiple_pads(karo_tx25_fec_pwr_gpios, ++ ARRAY_SIZE(karo_tx25_fec_pwr_gpios)); ++ return ret; ++ } ++ } else { ++ /* switch PHY strap pins into required state */ ++ ret = mxc_iomux_v3_setup_multiple_pads(karo_tx25_fec_gpios_off, ++ ARRAY_SIZE(karo_tx25_fec_gpios_off)); ++ if (ret) { ++ mxc_iomux_v3_release_multiple_pads(karo_tx25_fec_pwr_gpios, ++ ARRAY_SIZE(karo_tx25_fec_pwr_gpios)); ++ 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]; ++ ++ ret = gpio_request(pd->gpio, "FEC"); ++ if (ret < 0) { ++ DBG(0, "%s: Failed to request GPIO%d_%d: %d\n", ++ __FUNCTION__, pd->gpio / 32 + 1, pd->gpio % 32, ret); ++ goto rel_mux; ++ } ++ if (pd->dir) { ++ gpio_direction_output(pd->gpio, ++ pd->level); ++ } else { ++ gpio_direction_input(pd->gpio); ++ } ++ } ++#ifdef DEBUG ++ for (i = 0; i < ARRAY_SIZE(karo_tx25_fec_strap_gpios); i++) { ++ struct gpio_desc *pd = &karo_tx25_fec_strap_gpios[i]; ++ int grp = pd->gpio / 32 + 1; ++ int ofs = pd->gpio % 32; ++ ++ if (pd->dir && pd->level != gpio_get_value(pd->gpio)) { ++ DBG(0, "%s: GPIO%d_%d is %d instead of %d\n", __FUNCTION__, ++ grp, ofs, gpio_get_value(pd->gpio), ++ pd->level); ++ } ++ } ++#endif ++ DBG(0, "%s: Delaying for 22ms\n", __FUNCTION__); ++ mdelay(22); ++ DBG(0, "%s: Deasserting FEC PHY reset\n", __FUNCTION__); ++ gpio_set_value(TX25_FEC_RST_GPIO, 1); ++#ifdef DEBUG ++ for (i = 0; i < ARRAY_SIZE(karo_tx25_fec_strap_gpios); i++) { ++ struct gpio_desc *pd = &karo_tx25_fec_strap_gpios[i]; ++ int grp = pd->gpio / 32 + 1; ++ int ofs = pd->gpio % 32; ++ ++ DBG(0, "%s: GPIO%d_%d is %d\n", __FUNCTION__, ++ grp, ofs, gpio_get_value(pd->gpio)); ++ } ++#endif ++ mxc_iomux_v3_release_multiple_pads(karo_tx25_fec_gpios_off, ++ ARRAY_SIZE(karo_tx25_fec_gpios_off)); ++ ret = mxc_iomux_v3_setup_multiple_pads(karo_tx25_fec_gpios_on, ++ ARRAY_SIZE(karo_tx25_fec_gpios_on)); ++ if (ret) { ++ goto rel_gpio; ++ } ++#ifdef DEBUG ++ for (i = 0; i < ARRAY_SIZE(karo_tx25_fec_strap_gpios); i++) { ++ struct gpio_desc *pd = &karo_tx25_fec_strap_gpios[i]; ++ int grp = pd->gpio / 32 + 1; ++ int ofs = pd->gpio % 32; ++ ++ DBG(0, "%s: GPIO%d_%d is %d\n", __FUNCTION__, ++ grp, ofs, gpio_get_value(pd->gpio)); ++ } ++#endif ++ } ++ return ret; ++ ++ rel_mux: ++ mxc_iomux_v3_release_multiple_pads(karo_tx25_fec_gpios_off, ++ ARRAY_SIZE(karo_tx25_fec_gpios_off)); ++ 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, ++ ARRAY_SIZE(karo_tx25_fec_pwr_gpios)); ++ return ret; ++} ++ ++/* ++ * Setup GPIO for FEC device to be inactive ++ * ++ */ ++static void gpio_fec_inactive(void) ++{ ++ int i; ++ ++ mxc_iomux_v3_release_multiple_pads(karo_tx25_fec_gpios_on, ++ ARRAY_SIZE(karo_tx25_fec_gpios_on)); ++ mxc_iomux_v3_setup_multiple_pads(karo_tx25_fec_gpios_off, ++ ARRAY_SIZE(karo_tx25_fec_gpios_off)); ++ DBG(0, "%s: Asserting FEC PHY reset\n", __FUNCTION__); ++ gpio_set_value(TX25_FEC_RST_GPIO, 0); ++ DBG(0, "%s: Switching FEC PHY power off\n", __FUNCTION__); ++ gpio_set_value(TX25_FEC_PWR_GPIO, 0); ++ ++ mxc_iomux_v3_release_multiple_pads(karo_tx25_fec_gpios_off, ++ ARRAY_SIZE(karo_tx25_fec_gpios_off)); ++ mxc_iomux_v3_release_multiple_pads(karo_tx25_fec_pwr_gpios, ++ 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); ++ } ++} ++ ++static struct clk *tx25_fec_clk; ++ ++static int tx25_fec_suspend(struct platform_device *pdev) ++{ ++ BUG_ON(tx25_fec_clk == NULL); ++ DBG(1, "%s: Switching FEC PHY off\n", __FUNCTION__); ++ gpio_fec_inactive(); ++ clk_disable(tx25_fec_clk); ++ return 0; ++} ++ ++static int tx25_fec_resume(struct platform_device *pdev) ++{ ++ BUG_ON(tx25_fec_clk == NULL); ++ DBG(1, "%s: Switching FEC PHY on\n", __FUNCTION__); ++ clk_enable(tx25_fec_clk); ++ gpio_fec_active(); ++ 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; ++ ++ DBG(0, "%s: Activating FEC GPIOs\n", __FUNCTION__); ++ dump_regs(); ++ ++ ret = gpio_fec_active(); ++ if (ret) { ++ printk(KERN_ERR "%s: could not enable FEC gpios: %d\n", __FUNCTION__, ret); ++ return ret; ++ } ++ ++ BUG_ON(tx25_fec_clk != NULL); ++ tx25_fec_clk = clk_get(&pdev->dev, NULL); ++ if (unlikely(IS_ERR(tx25_fec_clk))) { ++ printk(KERN_ERR "Failed to get fec_clk\n"); ++ return PTR_ERR(tx25_fec_clk); ++ } ++ DBG(0, "%s: Enabling FEC clock\n", __FUNCTION__); ++ clk_enable(tx25_fec_clk); ++ dump_regs(); ++ return 0; ++} ++ ++static void fec_arch_exit(struct platform_device *pdev) ++{ ++ BUG_ON(tx25_fec_clk == NULL); ++ if (unlikely(IS_ERR(tx25_fec_clk))) { ++ printk(KERN_ERR "Failed to get fec_clk\n"); ++ return; ++ } ++ DBG(0, "%s: Disabling FEC clock\n", __FUNCTION__); ++ clk_disable(tx25_fec_clk); ++ clk_put(tx25_fec_clk); ++ tx25_fec_clk = NULL; ++ DBG(0, "%s: Deactivating FEC GPIOs\n", __FUNCTION__); ++ gpio_fec_inactive(); ++} ++ ++static struct fec_enet_platform_data fec_data = { ++ .arch_init = fec_arch_init, ++ .arch_exit = fec_arch_exit, ++ .suspend = tx25_fec_suspend, ++ .resume = tx25_fec_resume, ++}; ++ ++static struct platform_device fec_device = { ++ .name = "fec", ++ .id = 0, ++ .num_resources = ARRAY_SIZE(fec_resources), ++ .resource = fec_resources, ++ .dev = { ++ .platform_data = &fec_data, ++ .coherent_dma_mask = 0xFFFFFFFF, ++ }, ++}; ++#endif ++ ++/* MTD NAND flash */ ++#if defined(CONFIG_MTD_NAND_MXC) || defined(CONFIG_MTD_NAND_MXC_MODULE) ++static struct pad_desc karo_tx25_nand_pads[] = { ++ MX25_PAD_NF_CE0__NF_CE0, ++ MX25_PAD_NFWE_B__NFWE_B, ++ MX25_PAD_NFRE_B__NFRE_B, ++ MX25_PAD_NFALE__NFALE, ++ MX25_PAD_NFCLE__NFCLE, ++ MX25_PAD_NFWP_B__NFWP_B, ++ MX25_PAD_NFRB__NFRB, ++ MX25_PAD_D7__D7, ++ MX25_PAD_D6__D6, ++ MX25_PAD_D5__D5, ++ MX25_PAD_D4__D4, ++ MX25_PAD_D3__D3, ++ MX25_PAD_D2__D2, ++ MX25_PAD_D1__D1, ++ MX25_PAD_D0__D0, ++}; ++ ++#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 int tx25_nand_init(void) ++{ ++ int ret; ++ ++ DBG(0, "%s: Configuring NAND pins\n", __FUNCTION__); ++ ret = mxc_iomux_v3_setup_multiple_pads(karo_tx25_nand_pads, ++ ARRAY_SIZE(karo_tx25_nand_pads)); ++ if (ret) { ++ return ret; ++ } ++ 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, ++}; ++ ++static int tx25_nand_init(void) ++{ ++ int ret; ++ ++ DBG(0, "%s: Configuring NAND pins\n", __FUNCTION__); ++ ret = mxc_iomux_v3_setup_multiple_pads(karo_tx25_nand_pads, ++ ARRAY_SIZE(karo_tx25_nand_pads)); ++ if (ret) { ++ return ret; ++ } ++ return 0; ++} ++arch_initcall(tx25_nand_init); ++#endif ++ ++static struct resource tx25_nand_resources[] = { ++ { ++ .start = NFC_BASE_ADDR + 0x1e00, ++ .end = NFC_BASE_ADDR + 0x1e2f, ++ .flags = IORESOURCE_MEM, ++ }, { ++ .start = NFC_BASE_ADDR, ++ .end = NFC_BASE_ADDR + 0x11ff, ++ .flags = IORESOURCE_MEM, ++ }, { ++ .start = MXC_INT_NANDFC, ++ .end = MXC_INT_NANDFC, ++ .flags = IORESOURCE_IRQ, ++ }, ++}; ++ ++static struct platform_device tx25_nand_mtd_device = { ++ .name = "mxc_nand", ++ .id = 0, ++ .num_resources = ARRAY_SIZE(tx25_nand_resources), ++ .resource = tx25_nand_resources, ++ .dev = { ++ .platform_data = &tx25_nand_data, ++ }, ++}; ++#endif ++ ++#if defined(CONFIG_VIDEO_MXC_EMMA_OUTPUT) || defined(CONFIG_VIDEO_MXC_EMMA_OUTPUT_MODULE) ++static u64 mxc_emma_dmamask = 0xffffffffUL; ++ ++static struct platform_device tx25_v4l2out_device = { ++ .name = "MXC Video Output", ++ .id = 0, ++ .dev = { ++ .dma_mask = &mxc_emma_dmamask, ++ .coherent_dma_mask = ~0UL, ++ }, ++}; ++#endif ++ ++#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, ++}; ++ ++static int karo_tx25_i2c_0_init(struct device *dev) ++{ ++ DBG(-1, "%s: \n", __FUNCTION__); ++ return mxc_iomux_v3_setup_multiple_pads(mxc_i2c0_pins, ++ ARRAY_SIZE(mxc_i2c0_pins)); ++} ++ ++static void karo_tx25_i2c_0_exit(struct device *dev) ++{ ++ DBG(-1, "%s: \n", __FUNCTION__); ++ mxc_iomux_v3_release_multiple_pads(mxc_i2c0_pins, ++ ARRAY_SIZE(mxc_i2c0_pins)); ++} ++ ++static struct imxi2c_platform_data karo_tx25_i2c_0_data = { ++ .bitrate = 100000, ++ .init = karo_tx25_i2c_0_init, ++ .exit = karo_tx25_i2c_0_exit, ++}; ++ ++static struct at24_platform_data karo_tx25_eeprom = { ++ .byte_len = 2048, ++ .page_size = 32, ++ .flags = AT24_FLAG_ADDR16 | AT24_FLAG_TAKE8ADDR, ++}; ++ ++static struct i2c_board_info karo_i2c_0_boardinfo[] __initdata = { ++ { ++ I2C_BOARD_INFO("24c16", 0x50), ++ .platform_data = &karo_tx25_eeprom, ++ .type = "24c16", ++ }, ++}; ++ ++int __init karo_i2c_init(void) ++{ ++ int ret; ++ ++ DBG(0, "%s: Registering I2C bus 0\n", __FUNCTION__); ++ ret = mxc_register_device(&mx25_i2c_device0, &karo_tx25_i2c_0_data); ++ if (ret != 0) { ++ printk(KERN_ERR "Failed to register I2C device: %d\n", ret); ++ return ret; ++ } ++ ret = i2c_register_board_info(0, karo_i2c_0_boardinfo, ++ ARRAY_SIZE(karo_i2c_0_boardinfo)); ++ if (ret != 0) { ++ printk(KERN_ERR "Failed to register I2C board info: %d\n", ret); ++ } ++ return ret; ++} ++device_initcall(karo_i2c_init); ++#endif ++#endif ++ ++struct platform_dev_list { ++ struct platform_device *pdev; ++ int flag; ++} tx25_devices[] __initdata = { ++#if defined(CONFIG_RTC_MXC) || defined(CONFIG_RTC_MXC_MODULE) ++ { .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, }, ++#endif ++#if defined(CONFIG_FEC) || defined(CONFIG_FEC_MODULE) ++ { .pdev = &fec_device, .flag = 1, }, ++#endif ++#if defined(CONFIG_SPI_MXC) || defined(CONFIG_SPI_MXC_MODULE) ++ { .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, }, ++#endif ++#if defined(CONFIG_MXC_VPU) || defined(CONFIG_MXC_VPU_MODULE) ++ { .pdev = &mxc_vpu_device, .flag = 1, }, ++#endif ++}; ++#define TX25_NUM_DEVICES ARRAY_SIZE(tx25_devices) ++ ++static __init void karo_tx25_board_init(void) ++{ ++ int i; ++ ++ DBG(0, "%s: \n", __FUNCTION__); ++ ++ dump_regs(); ++ ++ for (i = 0; i < TX25_NUM_DEVICES; i++) { ++ int ret; ++ ++ if (tx25_devices[i].pdev == NULL) continue; ++ if (!tx25_devices[i].flag) { ++ DBG(0, "%s: Skipping platform device[%d] @ %p dev %p: %s\n", ++ __FUNCTION__, i, tx25_devices[i].pdev, &tx25_devices[i].pdev->dev, ++ tx25_devices[i].pdev->name); ++ continue; ++ } ++ DBG(0, "%s: Registering platform device[%d] @ %p dev %p: %s\n", ++ __FUNCTION__, i, tx25_devices[i].pdev, &tx25_devices[i].pdev->dev, ++ tx25_devices[i].pdev->name); ++ ret = platform_device_register(tx25_devices[i].pdev); ++ if (ret) { ++ printk(KERN_WARNING "%s: Failed to register platform_device[%d]: %s: %d\n", ++ __FUNCTION__, i, tx25_devices[i].pdev->name, ret); ++ } ++ } ++ DBG(0, "%s: Done\n", __FUNCTION__); ++} ++ ++static struct pad_desc karo_tx25_gpios[] __initdata = { ++ MX25_PAD_GPIO_A__GPIO_A, ++ MX25_PAD_GPIO_B__GPIO_B, ++ MX25_PAD_GPIO_C__GPIO_C, ++ MX25_PAD_GPIO_D__GPIO_D, ++ MX25_PAD_GPIO_E__GPIO_E, ++ MX25_PAD_GPIO_F__GPIO_F, ++ MX25_PAD_CSI_D7__GPIO_1_6, ++ MX25_PAD_CSI_D8__GPIO_1_7, ++ MX25_PAD_CSI_MCLK__GPIO_1_8, ++ MX25_PAD_CSI_VSYNC__GPIO_1_9, ++ MX25_PAD_CSI_HSYNC__GPIO_1_10, ++ MX25_PAD_CSI_PIXCLK__GPIO_1_11, ++ MX25_PAD_I2C1_CLK__GPIO_1_12, ++ MX25_PAD_I2C1_DAT__GPIO_1_13, ++ MX25_PAD_CSPI1_MOSI__GPIO_1_14, ++ MX25_PAD_CSPI1_MISO__GPIO_1_15, ++ MX25_PAD_CSPI1_SS0__GPIO_1_16, ++ MX25_PAD_CSPI1_SS1__GPIO_1_17, ++ MX25_PAD_CSPI1_SCLK__GPIO_1_18, ++ MX25_PAD_LD5__GPIO_1_19, ++ MX25_PAD_LD6__GPIO_1_20, ++ MX25_PAD_LD7__GPIO_1_21, ++ MX25_PAD_HSYNC__GPIO_1_22, ++ MX25_PAD_VSYNC__GPIO_1_23, ++ MX25_PAD_LSCLK__GPIO_1_24, ++ MX25_PAD_OE_ACD__GPIO_1_25, ++ MX25_PAD_PWM__GPIO_1_26, ++ MX25_PAD_CSI_D2__GPIO_1_27, ++ MX25_PAD_CSI_D3__GPIO_1_28, ++ MX25_PAD_CSI_D4__GPIO_1_29, ++ MX25_PAD_CSI_D5__GPIO_1_30, ++ MX25_PAD_CSI_D6__GPIO_1_31, ++ ++ MX25_PAD_A14__GPIO_2_0, ++ MX25_PAD_A15__GPIO_2_1, ++ MX25_PAD_A16__GPIO_2_2, ++ MX25_PAD_A17__GPIO_2_3, ++ MX25_PAD_A18__GPIO_2_4, ++ MX25_PAD_A19__GPIO_2_5, ++ MX25_PAD_A20__GPIO_2_6, ++ MX25_PAD_A21__GPIO_2_7, ++ MX25_PAD_A22__GPIO_2_8, ++ MX25_PAD_A23__GPIO_2_9, ++ MX25_PAD_A24__GPIO_2_10, ++ MX25_PAD_A25__GPIO_2_11, ++ MX25_PAD_EB0__GPIO_2_12, ++ MX25_PAD_EB1__GPIO_2_13, ++ MX25_PAD_OE__GPIO_2_14, ++ MX25_PAD_LD0__GPIO_2_15, ++ MX25_PAD_LD1__GPIO_2_16, ++ MX25_PAD_LD2__GPIO_2_17, ++ MX25_PAD_LD3__GPIO_2_18, ++ MX25_PAD_LD4__GPIO_2_19, ++ MX25_PAD_DE_B__GPIO_2_20, ++ MX25_PAD_CLKO__GPIO_2_21, ++ MX25_PAD_CSPI1_RDY__GPIO_2_22, ++ MX25_PAD_SD1_CMD__GPIO_2_23, ++ MX25_PAD_SD1_CLK__GPIO_2_24, ++ MX25_PAD_SD1_DATA0__GPIO_2_25, ++ MX25_PAD_SD1_DATA1__GPIO_2_26, ++ MX25_PAD_SD1_DATA2__GPIO_2_27, ++ MX25_PAD_SD1_DATA3__GPIO_2_28, ++ MX25_PAD_KPP_ROW0__GPIO_2_29, ++ MX25_PAD_KPP_ROW1__GPIO_2_30, ++ MX25_PAD_KPP_ROW2__GPIO_2_31, ++ ++ MX25_PAD_KPP_ROW3__GPIO_3_0, ++ MX25_PAD_KPP_COL0__GPIO_3_1, ++ MX25_PAD_KPP_COL1__GPIO_3_2, ++ MX25_PAD_KPP_COL2__GPIO_3_3, ++ MX25_PAD_KPP_COL3__GPIO_3_4, ++ MX25_PAD_FEC_MDC__GPIO_3_5, ++ MX25_PAD_FEC_MDIO__GPIO_3_6, ++ MX25_PAD_FEC_TDATA0__GPIO_3_7, ++ MX25_PAD_FEC_TDATA1__GPIO_3_8, ++ MX25_PAD_FEC_TX_EN__GPIO_3_9, ++ MX25_PAD_FEC_RDATA0__GPIO_3_10, ++ MX25_PAD_FEC_RDATA1__GPIO_3_11, ++ MX25_PAD_FEC_RX_DV__GPIO_3_12, ++ MX25_PAD_FEC_TX_CLK__GPIO_3_13, ++ MX25_PAD_RTCK__GPIO_3_14, ++ MX25_PAD_EXT_ARMCLK__GPIO_3_15, ++ MX25_PAD_UPLL_BYPCLK__GPIO_3_16, ++ MX25_PAD_VSTBY_REQ__GPIO_3_17, ++ MX25_PAD_VSTBY_ACK__GPIO_3_18, ++ MX25_PAD_POWER_FAIL__GPIO_3_19, ++ MX25_PAD_CS4__GPIO_3_20, ++ MX25_PAD_CS5__GPIO_3_21, ++ MX25_PAD_NF_CE0__GPIO_3_22, ++ MX25_PAD_ECB__GPIO_3_23, ++ MX25_PAD_LBA__GPIO_3_24, ++ MX25_PAD_RW__GPIO_3_25, ++ MX25_PAD_NFWE_B__GPIO_3_26, ++ MX25_PAD_NFRE_B__GPIO_3_27, ++ MX25_PAD_NFALE__GPIO_3_28, ++ MX25_PAD_NFCLE__GPIO_3_29, ++ MX25_PAD_NFWP_B__GPIO_3_30, ++ MX25_PAD_NFRB__GPIO_3_31, ++ ++ MX25_PAD_A10__GPIO_4_0, ++ MX25_PAD_A13__GPIO_4_1, ++ MX25_PAD_CS0__GPIO_4_2, ++ MX25_PAD_CS1__GPIO_4_3, ++ MX25_PAD_BCLK__GPIO_4_4, ++ MX25_PAD_D15__GPIO_4_5, ++ MX25_PAD_D14__GPIO_4_6, ++ MX25_PAD_D13__GPIO_4_7, ++ MX25_PAD_D12__GPIO_4_8, ++ MX25_PAD_D11__GPIO_4_9, ++ MX25_PAD_D10__GPIO_4_10, ++ MX25_PAD_D9__GPIO_4_11, ++ MX25_PAD_D8__GPIO_4_12, ++ MX25_PAD_D7__GPIO_4_13, ++ MX25_PAD_D6__GPIO_4_14, ++ MX25_PAD_D5__GPIO_4_15, ++ MX25_PAD_D4__GPIO_4_16, ++ MX25_PAD_D3__GPIO_4_17, ++ MX25_PAD_D2__GPIO_4_18, ++ MX25_PAD_D1__GPIO_4_19, ++ MX25_PAD_D0__GPIO_4_20, ++ MX25_PAD_CSI_D9__GPIO_4_21, ++ MX25_PAD_UART1_RXD__GPIO_4_22, ++ MX25_PAD_UART1_TXD__GPIO_4_23, ++ MX25_PAD_UART1_RTS__GPIO_4_24, ++ MX25_PAD_UART1_CTS__GPIO_4_25, ++ MX25_PAD_UART2_RXD__GPIO_4_26, ++ MX25_PAD_UART2_TXD__GPIO_4_27, ++ MX25_PAD_UART2_RTS__GPIO_4_28, ++ MX25_PAD_UART2_CTS__GPIO_4_29, ++ MX25_PAD_BOOT_MODE0__GPIO_4_30, ++ MX25_PAD_BOOT_MODE1__GPIO_4_31, ++}; ++ ++static int __init karo_tx25_setup_gpios(void) ++{ ++ 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 ++ DBG(0, "%s: PAD[%d] %s set up as GPIO\n", __FUNCTION__, i, pd->name); ++#else ++ DBG(0, "%s: PAD[%d] set up as GPIO\n", __FUNCTION__, i); ++#endif ++ count++; ++ mxc_iomux_v3_release_pad(pd); ++ } else { ++#ifdef IOMUX_DEBUG ++ DBG(0, "%s: PAD[%d] %s skipped\n", __FUNCTION__, i, pd->name); ++#else ++ DBG(0, "%s: PAD[%d] skipped\n", __FUNCTION__, i); ++#endif ++ } ++ } ++ 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; ++} ++late_initcall(karo_tx25_setup_gpios); ++ ++static void __init karo_tx25_map_io(void) ++{ ++ mx25_map_io(); ++} ++ ++static void __init karo_tx25_fixup(struct machine_desc *desc, struct tag *tags, ++ char **cmdline, struct meminfo *mi) ++{ ++} ++ ++static void __init karo_tx25_timer_init(void) ++{ ++ DBG(0, "%s: \n", __FUNCTION__); ++ mx25_clocks_init(24000000); ++ DBG(0, "%s: Done\n", __FUNCTION__); ++} ++ ++struct sys_timer karo_tx25_timer = { ++ .init = karo_tx25_timer_init, ++}; ++ ++static int __init karo_mod_type_setup(char *line) ++{ ++ get_option(&line, &karo_mod_type); ++ DBG(0, "%s: Module type set to 0x%02x by kernel cmd line\n", __FUNCTION__, karo_mod_type); ++ ++ return 1; ++} ++__setup("module_type=", karo_mod_type_setup); ++ ++static int __init karo_board_type_setup(char *line) ++{ ++ get_option(&line, &karo_board_type); ++ DBG(0, "%s: Board type set to 0x%02x by kernel cmd line\n", __FUNCTION__, karo_board_type); ++ ++ return 1; ++} ++__setup("board_type=", karo_board_type_setup); ++ ++MACHINE_START(TX25, "Ka-Ro electronics TX25 module (Freescale i.MX25)") ++ /* Maintainer: */ ++ .phys_io = AIPS1_BASE_ADDR, ++ .io_pg_offst = ((unsigned long)AIPS1_BASE_ADDR_VIRT >> 18) & 0xfffc, ++ .fixup = karo_tx25_fixup, ++ .map_io = karo_tx25_map_io, ++ .init_irq = mxc_init_irq, ++ .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:59:18.000000000 +0200 +@@ -0,0 +1,99 @@ ++/* ++ * arch/arm/mach-mx2/karo.h ++ * ++ * Copyright (C) 2009 Lothar Wassmann ++ * ++ * 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 ++ * ++ * This file provides platform specific definitions for the ++ * Ka-Ro electronics TX25 processor modules ++ */ ++ ++#include ++#include "crm_regs_mx25.h" ++ ++enum { ++ BOARD_KARO_STK5, ++}; ++ ++extern int karo_board_type; ++extern int karo_mod_type; ++ ++#ifdef DEBUG ++extern int tx25_debug; ++#define dbg_lvl(n) ((n) < tx25_debug) ++#define DBG(lvl, fmt...) do { if (dbg_lvl(lvl)) printk(KERN_DEBUG fmt); } while (0) ++#else ++#define dbg_lvl(n) 0 ++#define DBG(lvl, fmt...) do { } while (0) ++#endif ++ ++static inline int karo_get_board_type(void) ++{ ++ return karo_board_type; ++} ++ ++static inline int karo_get_module_type(void) ++{ ++ return karo_mod_type; ++} ++ ++#define SHOW_REG(reg) DBG(0, "%s[%08lx]=%08x\n", #reg, MXC_PHYS_ADDRESS(reg), __raw_readl(reg)) ++ ++#define SHOW_GPIO_REG(port, reg) \ ++ DBG(0, "GPIO%d_%s[%08lx]=%08x\n", port, #reg, \ ++ GPIO_BASE_ADDR(port) + GPIO_##reg, \ ++ __raw_readl(IO_ADDRESS(GPIO_BASE_ADDR(port) + GPIO_##reg))) ++ ++static inline void dump_regs(void) ++{ ++ int i; ++ ++ SHOW_REG(MXC_CCM_MPCTL); ++ SHOW_REG(MXC_CCM_UPCTL); ++ SHOW_REG(MXC_CCM_CCTL); ++ SHOW_REG(MXC_CCM_RCSR); ++ SHOW_REG(MXC_CCM_CRDR); ++ SHOW_REG(MXC_CCM_PCDR0); ++ SHOW_REG(MXC_CCM_PCDR1); ++ SHOW_REG(MXC_CCM_PCDR2); ++ SHOW_REG(MXC_CCM_PCDR3); ++ SHOW_REG(MXC_CCM_CGCR0); ++ SHOW_REG(MXC_CCM_CGCR1); ++ SHOW_REG(MXC_CCM_CGCR2); ++ SHOW_REG(MXC_CCM_MCR); ++ SHOW_REG(MXC_CCM_PMCR0); ++ SHOW_REG(MXC_CCM_PMCR1); ++ SHOW_REG(MXC_CCM_PMCR2); ++ SHOW_REG(MXC_CCM_LTBR0); ++ SHOW_REG(MXC_CCM_LTBR1); ++ SHOW_REG(MXC_CCM_LTR0); ++ SHOW_REG(MXC_CCM_LTR1); ++ SHOW_REG(MXC_CCM_LTR2); ++ SHOW_REG(MXC_CCM_LTR3); ++ SHOW_REG(MXC_CCM_DCVR0); ++ SHOW_REG(MXC_CCM_DCVR1); ++ SHOW_REG(MXC_CCM_DCVR2); ++ SHOW_REG(MXC_CCM_DCVR3); ++ ++ for (i = 1; i <= 4; i++) { ++ SHOW_GPIO_REG(i, DR); ++ SHOW_GPIO_REG(i, GDIR); ++ SHOW_GPIO_REG(i, PSR); ++ SHOW_GPIO_REG(i, ICR1); ++ SHOW_GPIO_REG(i, ICR2); ++ SHOW_GPIO_REG(i, IMR); ++ 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:59:18.000000000 +0200 +@@ -0,0 +1,159 @@ ++ ++/* ++ * Copyright 2008 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 ++ */ ++ ++/*! ++ * @file sdma_script_code.h ++ * @brief This file contains functions of SDMA scripts code initialization ++ * ++ * The file was generated automatically. Based on sdma scripts library. ++ * ++ * @ingroup SDMA ++ */ ++/************************************************************************ ++ ++ SDMA RELEASE LABEL: "SS15_SENNA" ++ ++************************************************************************/ ++ ++#ifndef SDMA_SCRIPT_CODE_H ++#define SDMA_SCRIPT_CODE_H ++ ++/*! ++ * SDMA ROM scripts start addresses and sizes ++ */ ++#define start_ADDR 0 ++#define start_SIZE 22 ++ ++#define core_ADDR 80 ++#define core_SIZE 233 ++ ++#define common_ADDR 313 ++#define common_SIZE 416 ++ ++#define ap_2_ap_ADDR 729 ++#define ap_2_ap_SIZE 41 ++ ++#define app_2_mcu_ADDR 770 ++#define app_2_mcu_SIZE 64 ++ ++#define mcu_2_app_ADDR 834 ++#define mcu_2_app_SIZE 70 ++ ++#define uart_2_mcu_ADDR 904 ++#define uart_2_mcu_SIZE 75 ++ ++#define shp_2_mcu_ADDR 979 ++#define shp_2_mcu_SIZE 69 ++ ++#define mcu_2_shp_ADDR 1048 ++#define mcu_2_shp_SIZE 72 ++ ++#define uartsh_2_mcu_ADDR 1120 ++#define uartsh_2_mcu_SIZE 69 ++ ++#define app_2_per_ADDR 1189 ++#define app_2_per_SIZE 66 ++ ++#define per_2_app_ADDR 1255 ++#define per_2_app_SIZE 74 ++ ++#define per_2_shp_ADDR 1329 ++#define per_2_shp_SIZE 78 ++ ++#define shp_2_per_ADDR 1407 ++#define shp_2_per_SIZE 72 ++ ++#define mcu_2_ata_ADDR 1479 ++#define mcu_2_ata_SIZE 81 ++ ++#define ata_2_mcu_ADDR 1560 ++#define ata_2_mcu_SIZE 96 ++ ++#define loop_DMAs_routines_ADDR 1656 ++#define loop_DMAs_routines_SIZE 227 ++ ++#define test_ADDR 1883 ++#define test_SIZE 63 ++ ++#define signature_ADDR 1022 ++#define signature_SIZE 1 ++ ++/*! ++ * SDMA RAM scripts start addresses and sizes ++ */ ++#define ext_mem__ipu_ram_ADDR 6144 ++#define ext_mem__ipu_ram_SIZE 123 ++ ++#define uart_2_per_ADDR 6267 ++#define uart_2_per_SIZE 73 ++ ++#define uartsh_2_per_ADDR 6340 ++#define uartsh_2_per_SIZE 67 ++ ++/*! ++ * SDMA RAM image start address and size ++ */ ++#define RAM_CODE_START_ADDR 6144 ++#define RAM_CODE_SIZE 263 ++ ++/*! ++ * Buffer that holds the SDMA RAM image ++ */ ++__attribute__ ((__aligned__(4))) ++#ifndef CONFIG_XIP_KERNEL ++const ++#endif ++static const short sdma_code[] = { ++ 0x0e70, 0x0611, 0x5616, 0xc18a, 0x7d2a, 0x5ade, 0x008e, 0xc19c, ++ 0x7c26, 0x5be0, 0x5ef0, 0x5ce8, 0x0688, 0x08ff, 0x0011, 0x28ff, ++ 0x00bc, 0x53f6, 0x05df, 0x7d0b, 0x6dc5, 0x03df, 0x7d03, 0x6bd5, ++ 0xd84f, 0x982b, 0x6b05, 0xc6d8, 0x7e27, 0x7f29, 0x982b, 0x6d01, ++ 0x03df, 0x7d05, 0x6bd5, 0xc702, 0x7e18, 0x7f1a, 0x982b, 0x6b05, ++ 0xc678, 0x7e07, 0x7f06, 0x52de, 0x53e6, 0xc1a8, 0x7dd7, 0x0200, ++ 0x9803, 0x0007, 0x6004, 0x680c, 0x53f6, 0x028e, 0x00a3, 0xc2ad, ++ 0x048b, 0x0498, 0x0454, 0x068a, 0x982b, 0x0207, 0x680c, 0x6ddf, ++ 0x0107, 0x68ff, 0x60d0, 0x9834, 0x0207, 0x68ff, 0x6d28, 0x0107, ++ 0x6004, 0x680c, 0x9834, 0x0007, 0x68ff, 0x60d0, 0x9834, 0x0288, ++ 0x03a5, 0x3b03, 0x3d03, 0x4d00, 0x7d0a, 0x0804, 0x00a5, 0x00da, ++ 0x7d1a, 0x02a0, 0x7b01, 0x65d8, 0x7eee, 0x65ff, 0x7eec, 0x0804, ++ 0x02d0, 0x7d11, 0x4b00, 0x7c0f, 0x008a, 0x3003, 0x6dcf, 0x6bdf, ++ 0x0015, 0x0015, 0x7b02, 0x65d8, 0x0000, 0x7edd, 0x63ff, 0x7edb, ++ 0x3a03, 0x6dcd, 0x6bdd, 0x008a, 0x7b02, 0x65d8, 0x0000, 0x7ed3, ++ 0x65ff, 0x7ed1, 0x0006, 0xc23a, 0x57db, 0x52f3, 0x6ad5, 0x56fb, ++ 0x028e, 0x1a94, 0x6ac3, 0x62c8, 0x0269, 0x7d1e, 0x1e94, 0x6ee3, ++ 0x62d0, 0x5aeb, 0x62c8, 0x0248, 0x6ed3, 0x6ac8, 0x2694, 0x52eb, ++ 0x6ad5, 0x6ee3, 0x62c8, 0x026e, 0x7d27, 0x6ac8, 0x7f23, 0x2501, ++ 0x4d00, 0x7d26, 0x028e, 0x1a98, 0x6ac3, 0x62c8, 0x6ec3, 0x0260, ++ 0x7df1, 0x62d0, 0xc2d1, 0x98c0, 0x6ee3, 0x008f, 0x2001, 0x00d5, ++ 0x7d01, 0x008d, 0x05a0, 0x62c8, 0x026e, 0x7d0e, 0x6ac8, 0x7f0a, ++ 0x2001, 0x7cf9, 0x6add, 0x7f06, 0x0000, 0x4d00, 0x7d09, 0xc251, ++ 0x57db, 0x987f, 0x0007, 0x6aff, 0x62d0, 0xc2d1, 0x0458, 0x0454, ++ 0x6add, 0x7ff8, 0xc261, 0x987c, 0xc230, 0xc23a, 0x57db, 0x52f3, ++ 0x6ad5, 0x56fb, 0x028e, 0x1a94, 0x5202, 0x0269, 0x7d17, 0x1e94, ++ 0x5206, 0x0248, 0x5a06, 0x2694, 0x5206, 0x026e, 0x7d26, 0x6ac8, ++ 0x7f22, 0x2501, 0x4d00, 0x7d27, 0x028e, 0x1a98, 0x5202, 0x0260, ++ 0x7df3, 0x6add, 0x7f18, 0x62d0, 0xc2d1, 0x9903, 0x008f, 0x2001, ++ 0x00d5, 0x7d01, 0x008d, 0x05a0, 0x5206, 0x026e, 0x7d0e, 0x6ac8, ++ 0x7f0a, 0x2001, 0x7cf9, 0x6add, 0x7f06, 0x0000, 0x4d00, 0x7d0b, ++ 0xc251, 0x57db, 0x98c9, 0x0007, 0x6aff, 0x6add, 0x7ffc, 0x62d0, ++ 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:59:18.000000000 +0200 +@@ -0,0 +1,1003 @@ ++/* ++ * arch/arm/mach-mx2/stk5-baseboard.c ++ * ++ * Copyright (C) 2009 Lothar Wassmann ++ * ++ * ++ * 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 ++ * ++ * This file adds support for devices found on Ka-Ro electronics ++ * Starterkit-5 (STK5) baseboard ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++//#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++//#include ++#include ++#include ++#include ++//#include ++//#include ++#include ++ ++#include "crm_regs.h" ++#include "devices.h" ++#include "karo.h" ++ ++#if defined(CONFIG_SERIAL_IMX) || defined(CONFIG_SERIAL_IMX_MODULE) ++static struct pad_desc stk5_uart_pads[][4] = { ++ { ++ MX25_PAD_UART1_TXD__UART1_TXD, ++ MX25_PAD_UART1_RXD__UART1_RXD, ++ MX25_PAD_UART1_CTS__UART1_CTS, ++ MX25_PAD_UART1_RTS__UART1_RTS, ++ }, { ++ MX25_PAD_UART2_TXD__UART2_TXD, ++ MX25_PAD_UART2_RXD__UART2_RXD, ++ MX25_PAD_UART2_CTS__UART2_CTS, ++ MX25_PAD_UART2_RTS__UART2_RTS, ++ }, { ++ MX25_PAD_ECB__UART5_TXD_MUX, ++ MX25_PAD_LBA__UART5_RXD_MUX, ++ MX25_PAD_CS4__UART5_CTS, ++ MX25_PAD_CS5__UART5_RTS, ++#if 0 ++ }, { ++ MX25_PAD_UART4_TXD__UART4_TXD, ++ MX25_PAD_UART4_RXD__UART4_RXD, ++ MX25_PAD_UART4_CTS__UART4_CTS, ++ MX25_PAD_UART4_RTS__UART4_RTS, ++ }, { ++ MX25_PAD_UART5_TXD__UART5_TXD, ++ MX25_PAD_UART5_RXD__UART5_RXD, ++ MX25_PAD_UART5_CTS__UART5_CTS, ++ MX25_PAD_UART5_RTS__UART5_RTS, ++#endif ++ }, ++}; ++ ++static int stk5_uart_init(struct platform_device *pdev) ++{ ++ DBG(0, "%s: \n", __FUNCTION__); ++ return mxc_iomux_v3_setup_multiple_pads(stk5_uart_pads[pdev->id], ++ ARRAY_SIZE(stk5_uart_pads[pdev->id])); ++} ++ ++static void stk5_uart_exit(struct platform_device *pdev) ++{ ++ DBG(0, "%s: \n", __FUNCTION__); ++ mxc_iomux_v3_release_multiple_pads(stk5_uart_pads[pdev->id], ++ ARRAY_SIZE(stk5_uart_pads[pdev->id])); ++} ++ ++static struct imxuart_platform_data stk5_uart_ports[] = { ++ { ++ .init = stk5_uart_init, ++ .exit = stk5_uart_exit, ++ .flags = IMXUART_HAVE_RTSCTS, ++ }, { ++ .init = stk5_uart_init, ++ .exit = stk5_uart_exit, ++ .flags = IMXUART_HAVE_RTSCTS, ++ }, { ++ .init = stk5_uart_init, ++ .exit = stk5_uart_exit, ++ .flags = IMXUART_HAVE_RTSCTS, ++ }, { ++ .init = stk5_uart_init, ++ .exit = stk5_uart_exit, ++ .flags = IMXUART_HAVE_RTSCTS, ++ }, { ++ .init = stk5_uart_init, ++ .exit = stk5_uart_exit, ++ .flags = IMXUART_HAVE_RTSCTS, ++ }, { ++ .init = stk5_uart_init, ++ .exit = stk5_uart_exit, ++ .flags = IMXUART_HAVE_RTSCTS, ++ }, ++}; ++ ++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 void __init karo_stk5_serial_init(void) ++{ ++} ++#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) ++{ ++ if ((unsigned long)view & 0x400) { ++ return "USBH2"; ++ } else { ++ return "USBOTG"; ++ } ++} ++ ++static int usb3317_init(void __iomem *view) ++{ ++ int vid, pid, ret; ++ ++ 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) { ++ 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; ++ } ++ return 0; ++} ++ ++static int usb3317_set_vbus_power(void __iomem *view, int on) ++{ ++ 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); ++ } ++ } ++ 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 stk5_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 stk5_usbh2_exit(struct platform_device *pdev) ++{ ++ gpio_usbh2_inactive(); ++ return 0; ++} ++ ++static struct mxc_usbh_platform_data stk5_usbh2_data = { ++ .init = stk5_usbh2_init, ++ .exit = stk5_usbh2_exit, ++}; ++ ++static int __init karo_stk5_usbh2_register(void) ++{ ++ int ret; ++ ++ ret = mxc_register_device(&mxc_ehci2, &stk5_usbh2_data); ++ return ret; ++} ++#else ++static inline int karo_stk5_usbh2_register(void) ++{ ++ return 0; ++} ++#endif // CONFIG_USB_EHCI_MXC ++ ++#if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE) ++static struct gpio_led stk5_leds[] = { ++ { ++ .name = "GPIO-LED", ++ .default_trigger = "heartbeat", ++ .gpio = GPIO_PORTB | 7, ++ }, ++}; ++ ++static struct gpio_led_platform_data stk5_led_data = { ++ .leds = stk5_leds, ++ .num_leds = ARRAY_SIZE(stk5_leds), ++}; ++ ++static struct platform_device stk5_led_device = { ++ .name = "leds-gpio", ++ .id = -1, ++ .dev = { ++ .platform_data = &stk5_led_data, ++ }, ++}; ++#endif ++ ++#if defined(CONFIG_KEYBOARD_MXC) || defined(CONFIG_KEYBOARD_MXC_MODULE) ++/*! ++ * This array is used for mapping mx25 ADS keypad scancodes to input keyboard ++ * keycodes. ++ */ ++static u16 stk5_kpd_keycodes[] = { ++ KEY_POWER, ++}; ++ ++static struct keypad_data stk5_keypad = { ++ .rowmax = 1, ++ .colmax = 1, ++ .irq = MXC_INT_KPP, ++ .learning = 0, ++ //.delay = 2, /* unused in the driver! */ ++ .matrix = stk5_kpd_keycodes, ++}; ++ ++static struct resource stk5_kpp_resources[] = { ++ { ++ .start = MXC_INT_KPP, ++ .end = MXC_INT_KPP, ++ .flags = IORESOURCE_IRQ, ++ }, ++}; ++ ++/* stk5 keypad driver */ ++static struct platform_device stk5_keypad_device = { ++ .name = "mxc_keypad", ++ .id = 0, ++ .num_resources = ARRAY_SIZE(stk5_kpp_resources), ++ .resource = stk5_kpp_resources, ++ .dev = { ++ .platform_data = &stk5_keypad, ++ }, ++}; ++#endif ++ ++#if defined(CONFIG_FB_IMX) || defined(CONFIG_FB_IMX_MODULE) ++/* ++ * Setup GPIO for LCDC device to be active ++ * ++ */ ++static struct pad_desc mx25_lcdc_gpios[] = { ++#if 0 ++ MXC_PIN(A, 30, GPIO, GPIO_OUT | GPIO_DFLT_LOW), /* PA30 */ ++ MXC_PIN(A, 25, GPIO, GPIO_OUT | GPIO_DFLT_LOW), /* PA25 */ ++ MXC_PIN(A, 26, GPIO, GPIO_OUT | GPIO_DFLT_LOW), /* PA26 */ ++ MXC_PIN(A, 24, GPIO, GPIO_OUT | GPIO_DFLT_LOW), /* PA24 */ ++ MXC_PIN(A, 27, GPIO, GPIO_OUT | GPIO_DFLT_LOW), /* PA27 */ ++#endif ++ MX25_PAD_LSCLK__LSCLK, ++ MX25_PAD_LD0__LD0, ++ MX25_PAD_LD1__LD1, ++ MX25_PAD_LD2__LD2, ++ MX25_PAD_LD3__LD3, ++ MX25_PAD_LD4__LD4, ++ MX25_PAD_LD5__LD5, ++ MX25_PAD_LD6__LD6, ++ MX25_PAD_LD7__LD7, ++ MX25_PAD_LD8__LD8, ++ MX25_PAD_LD9__LD9, ++ MX25_PAD_LD10__LD10, ++ MX25_PAD_LD11__LD11, ++ MX25_PAD_LD12__LD12, ++ MX25_PAD_LD13__LD13, ++ MX25_PAD_LD14__LD14, ++ MX25_PAD_LD15__LD15, ++ MX25_PAD_D15__LD16, ++ MX25_PAD_D14__LD17, ++ MX25_PAD_HSYNC__HSYNC, ++ MX25_PAD_VSYNC__VSYNC, ++ MX25_PAD_OE_ACD__OE_ACD, ++}; ++ ++static int stk5_gpio_lcdc_active(struct platform_device *dev) ++{ ++ int ret; ++ ++ DBG(0, "%s: Setting up GPIO pins for LCD\n", __FUNCTION__); ++ ret = mxc_iomux_v3_setup_multiple_pads(mx25_lcdc_gpios, ++ ARRAY_SIZE(mx25_lcdc_gpios)); ++ if (ret) { ++ DBG(0, "%s: Failed to setup GPIO pins for LCD: %d\n", ++ __FUNCTION__, ret); ++ return ret; ++ } ++ return 0; ++} ++ ++/* ++ * Setup GPIO for LCDC device to be inactive ++ * ++ */ ++static void stk5_gpio_lcdc_inactive(struct platform_device *dev) ++{ ++ mxc_iomux_v3_release_multiple_pads(mx25_lcdc_gpios, ++ ARRAY_SIZE(mx25_lcdc_gpios)); ++} ++ ++static struct imx_fb_platform_data stk5_fb_data[] __initdata = { ++ { ++ //.fb_mode = "Xenarc_700_Y-18", ++ .init = stk5_gpio_lcdc_active, ++ .exit = stk5_gpio_lcdc_inactive, ++ .lcd_power = NULL, ++ .backlight_power = NULL, ++ ++ .pixclock = 34576, ++ .xres = 640, ++ .yres = 480, ++ ++ .bpp = 32, ++ ++ .hsync_len = 64, ++ .right_margin = 60 + 1, ++ .left_margin = 80 + 3, ++ ++ .vsync_len = 2, ++ .upper_margin = 54, ++ .lower_margin = 54, ++#if 0 ++ /* currently not used by driver! */ ++ .sync = ((0*FB_SYNC_HOR_HIGH_ACT) | ++ (0*FB_SYNC_VERT_HIGH_ACT) | ++ (1*FB_SYNC_OE_ACT_HIGH)), ++#else ++ .pcr = PCR_TFT | PCR_COLOR | PCR_PBSIZ_8 | ++ PCR_BPIX_18 | PCR_END_SEL | PCR_FLMPOL | PCR_LPPOL | PCR_SCLK_SEL, ++ .dmacr = 0x800a0078, ++#endif ++ .cmap_greyscale = 0, ++ .cmap_inverse = 0, ++ .cmap_static = 0, ++ ++ .fixed_screen_cpu = NULL, ++ }, { ++ //.fb_mode = "Xenarc_700_Y-16", ++ .init = stk5_gpio_lcdc_active, ++ .exit = stk5_gpio_lcdc_inactive, ++ .lcd_power = NULL, ++ .backlight_power = NULL, ++ ++ .pixclock = 34576, ++ .xres = 640, ++ .yres = 480, ++ ++ .bpp = 16, ++ ++ .hsync_len = 64, ++ .right_margin = 138 + 1, ++ .left_margin = 118 + 3, ++ ++ .vsync_len = 7, ++ .upper_margin = 44, ++ .lower_margin = 44, ++#if 0 ++ /* currently not used by driver! */ ++ .sync = ((0*FB_SYNC_HOR_HIGH_ACT) | ++ (0*FB_SYNC_VERT_HIGH_ACT) | ++ (1*FB_SYNC_OE_ACT_HIGH)), ++#else ++ .pcr = PCR_TFT | PCR_COLOR | PCR_PBSIZ_8 | ++ PCR_BPIX_16 | PCR_FLMPOL | PCR_LPPOL | PCR_SCLK_SEL, ++ .dmacr = 0x80040060, ++#endif ++ .cmap_greyscale = 0, ++ .cmap_inverse = 0, ++ .cmap_static = 0, ++ ++ .fixed_screen_cpu = NULL, ++ }, { ++ //.fb_mode = "SHARP LQ10D42-16", ++ .init = stk5_gpio_lcdc_active, ++ .exit = stk5_gpio_lcdc_inactive, ++ .lcd_power = NULL, ++ .backlight_power = NULL, ++ ++ .pixclock = 34576, ++ .xres = 640, ++ .yres = 480, ++ ++#ifdef USE_18BPP ++ .bpp = 32, ++#else ++ .bpp = 16, ++#endif ++ .hsync_len = 64, ++ .right_margin = 138 + 1, ++ .left_margin = 118 + 3, ++ ++ .vsync_len = 7, ++ .upper_margin = 28, ++ .lower_margin = 60, ++#if 0 ++ /* currently not used by driver! */ ++ .sync = ((0*FB_SYNC_HOR_HIGH_ACT) | ++ (0*FB_SYNC_VERT_HIGH_ACT) | ++ (1*FB_SYNC_OE_ACT_HIGH)), ++#else ++ .pcr = PCR_TFT | PCR_COLOR | PCR_PBSIZ_8 | ++#ifdef USE_18BPP ++ PCR_BPIX_18 | PCR_END_SEL | PCR_FLMPOL | PCR_LPPOL | PCR_SCLK_SEL, ++#else ++ PCR_BPIX_16 | PCR_FLMPOL | PCR_LPPOL | PCR_SCLK_SEL, ++#endif ++ .dmacr = 0x80040060, ++#endif ++ .cmap_greyscale = 0, ++ .cmap_inverse = 0, ++ .cmap_static = 0, ++ ++ .fixed_screen_cpu = NULL, ++ }, { ++ //.fb_mode = "SHARP LQ104V1DG61-16", ++ .init = stk5_gpio_lcdc_active, ++ .exit = stk5_gpio_lcdc_inactive, ++ .lcd_power = NULL, ++ .backlight_power = NULL, ++ ++ .pixclock = 40000, ++ .xres = 640, ++ .yres = 480, ++ ++#ifdef USE_18BPP ++ .bpp = 32, ++#else ++ .bpp = 16, ++#endif ++ .hsync_len = 32, ++ .right_margin = 32 + 1, ++ .left_margin = 0 + 3, ++ ++ .vsync_len = 35, ++ .upper_margin = 0, ++ .lower_margin = 0, ++#if 0 ++ /* currently not used by driver! */ ++ .sync = ((0*FB_SYNC_HOR_HIGH_ACT) | ++ (0*FB_SYNC_VERT_HIGH_ACT) | ++ (1*FB_SYNC_OE_ACT_HIGH)), ++#else ++ .pcr = PCR_TFT | PCR_COLOR | PCR_PBSIZ_8 | ++#ifdef USE_18BPP ++ PCR_BPIX_18 | PCR_END_SEL | PCR_FLMPOL | PCR_LPPOL | PCR_SCLK_SEL, ++#else ++ PCR_BPIX_16 | PCR_FLMPOL | PCR_LPPOL | PCR_CLKPOL | PCR_SCLK_SEL, ++#endif ++ .dmacr = 0x80040060, ++#endif ++ .cmap_greyscale = 0, ++ .cmap_inverse = 0, ++ .cmap_static = 0, ++ ++ .fixed_screen_cpu = NULL, ++ }, ++}; ++ ++static int __init karo_stk5_fb_register(void) ++{ ++ int ret; ++ ++ ret = mxc_register_device(&mxc_fb_device, &stk5_fb_data[0]); ++ if (ret != 0) { ++ DBG(0, "%s: Failed to register FB device: %d\n", __FUNCTION__, ret); ++ } ++ return ret; ++} ++#else ++static inline int karo_stk5_fb_register(void) ++{ ++ return 0; ++} ++#endif ++ ++#if defined(CONFIG_MMC_MXC) || defined(CONFIG_MMC_MXC_MODULE) ++/*! ++ * Resource definition for the SDHC1 ++ */ ++static struct resource stk5_sdhc1_resources[] = { ++ { ++ .start = MMC_SDHC1_BASE_ADDR, ++ .end = MMC_SDHC1_BASE_ADDR + SZ_4K - 1, ++ .flags = IORESOURCE_MEM, ++ }, { ++ .start = MXC_INT_SDHC1, ++ .end = MXC_INT_SDHC1, ++ .flags = IORESOURCE_IRQ, ++ }, { ++ .start = gpio_to_irq(4 * 32 + 4), ++ .end = gpio_to_irq(4 * 32 + 4), ++ .flags = IORESOURCE_IRQ, ++#if 0 ++ }, { ++ .name = "sdhc1", ++ .start = DMA_REQ_SDHC1, ++ .end = DMA_REQ_SDHC1, ++ .flags = IORESOURCE_DMA ++#endif ++ }, ++}; ++ ++static inline int stk5_mmc_get_irq(int id) ++{ ++ int irq; ++ ++ switch (id) { ++ case 0: ++ irq = stk5_sdhc1_resources[2].start; ++ break; ++ default: ++ BUG(); ++ } ++ return irq; ++} ++ ++static const char *stk5_mmc_irqdesc[] = { ++ "MMC card 0 detect", ++}; ++ ++static struct pad_desc stk5_sdhc_pads[] = { ++}; ++ ++static int stk5_mmc_init(struct device *dev, irqreturn_t (*mmc_detect_irq)(int, void *), ++ void *data) ++{ ++ int err; ++ int id = to_platform_device(dev)->id; ++ struct mmc_host *host = data; ++ int irq = stk5_mmc_get_irq(id); ++ ++ err = mxc_iomux_v3_setup_multiple_pads(stk5_sdhc_pads, ++ ARRAY_SIZE(stk5_sdhc_pads)); ++ if (err) { ++ return err; ++ } ++ ++ host->caps |= MMC_CAP_4_BIT_DATA; ++ ++ err = request_irq(irq, mmc_detect_irq, ++ IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING, ++ stk5_mmc_irqdesc[id], data); ++ if (err) { ++ printk(KERN_ERR "%s: MMC/SD: can't request MMC card detect IRQ %d\n", ++ __FUNCTION__, irq); ++ return err; ++ } ++ device_set_wakeup_capable(dev, 1); ++ ++ return 0; ++} ++ ++static void stk5_mmc_exit(struct device *dev, void *data) ++{ ++ int id = to_platform_device(dev)->id; ++ int irq = stk5_mmc_get_irq(id); ++ ++ free_irq(irq, data); ++ mxc_iomux_v3_release_multiple_pads(stk5_sdhc_pads, ++ ARRAY_SIZE(stk5_sdhc_pads)); ++} ++ ++#if 0 ++static int stk5_mmc_suspend(struct device *dev, pm_message_t state) ++{ ++ int id = to_platform_device(dev)->id; ++ int irq = stk5_mmc_get_irq(id); ++ ++ if (device_may_wakeup(dev)) { ++ DBG(0, "%s: Enabling IRQ %d wakeup\n", __FUNCTION__, irq); ++ return enable_irq_wake(irq); ++ } ++ return 0; ++} ++ ++static int stk5_mmc_resume(struct device *dev) ++{ ++ int id = to_platform_device(dev)->id; ++ int irq = stk5_mmc_get_irq(id); ++ ++ if (device_may_wakeup(dev)) { ++ DBG(0, "%s: Disabling IRQ %d wakeup\n", __FUNCTION__, irq); ++ return disable_irq_wake(irq); ++ } ++ return 0; ++} ++#endif ++ ++static struct imxmmc_platform_data stk5_sdhc1_data = { ++ //.ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, ++ //.min_clk = 150000, ++ //.max_clk = 25000000, ++ //.detect_delay = 20, ++ .init = stk5_mmc_init, ++ .exit = stk5_mmc_exit, ++// .suspend = stk5_mmc_suspend, ++// .resume = stk5_mmc_resume, ++}; ++ ++static struct platform_device stk5_sdhc1_device = { ++ .name = "imx-mmc", ++ .id = 0, ++ .dev = { ++ .platform_data = &stk5_sdhc1_data, ++ }, ++ .num_resources = ARRAY_SIZE(stk5_sdhc1_resources), ++ .resource = stk5_sdhc1_resources, ++}; ++#endif ++ ++#if defined(CONFIG_SPI_MXC) || defined(CONFIG_SPI_MXC_MODULE) ++static struct resource mxcspi1_resources[] = { ++ { ++ .start = CSPI1_BASE_ADDR, ++ .end = CSPI1_BASE_ADDR + SZ_4K - 1, ++ .flags = IORESOURCE_MEM, ++ }, { ++ .start = MXC_INT_CSPI1, ++ .end = MXC_INT_CSPI1, ++ .flags = IORESOURCE_IRQ, ++ }, ++}; ++ ++static struct mxc_spi_master mxcspi1_data = { ++ .maxchipselect = 2, ++ .spi_version = 0, ++}; ++ ++static struct platform_device mxcspi1_device = { ++ .name = "mxc_spi", ++ .id = 0, ++ .dev = { ++ .platform_data = &mxcspi1_data, ++ }, ++ .num_resources = ARRAY_SIZE(mxcspi1_resources), ++ .resource = mxcspi1_resources, ++}; ++#endif // defined(CONFIG_SPI_MXC) || defined(CONFIG_SPI_MXC_MODULE) ++ ++#if defined(CONFIG_AC97_BUS) || defined(CONFIG_AC97_BUS_MODULE) ++static u64 stk5_dma_mask = ~0UL; ++ ++static struct pad_desc stk5_ac97_pads_on[] = { ++ MX25_PAD_VSTBY_ACK__GPIO_3_18, /* UCB1400 Reset */ ++ MX25_PAD_RW__AUD4_TXFS, ++ MX25_PAD_EB0__AUD4_TXD, ++ MX25_PAD_EB1__AUD4_RXD, ++ MX25_PAD_OE__AUD4_TXC, ++}; ++ ++static struct pad_desc stk5_ac97_pads_off[] = { ++ MX25_PAD_VSTBY_ACK__GPIO_3_18, /* UCB1400 Reset */ ++ MX25_PAD_RW__GPIO_3_25, ++ MX25_PAD_EB0__GPIO_2_12, ++ MX25_PAD_EB1__AUD4_RXD, ++ MX25_PAD_OE__AUD4_TXC, ++}; ++ ++static struct gpio_desc { ++ unsigned int gpio:7; ++ unsigned int dir:1; ++ unsigned int level:1; ++} stk5_ac97_gpios[] = { ++ /* configure the PHY strap pins to the correct values */ ++ { GPIO_PORTC | 18, 1, 0, }, ++ { GPIO_PORTC | 25, 1, 0, }, ++ { GPIO_PORTB | 12, 1, 0, }, ++}; ++ ++static int stk5_ac97_init(struct platform_device *dev) ++{ ++ int ret; ++ int i; ++ ++ DBG(0, "%s: \n", __FUNCTION__); ++ ++ ret = mxc_iomux_v3_setup_multiple_pads(stk5_ac97_pads_off, ++ ARRAY_SIZE(stk5_ac97_pads_off)); ++ if (ret == 0) { ++ for (i = 0; i < ARRAY_SIZE(stk5_ac97_gpios); i++) { ++ struct gpio_desc *pd = &stk5_ac97_gpios[i]; ++ ++ ret = gpio_request(pd->gpio, "AC97"); ++ if (ret < 0) { ++ DBG(0, "%s: Failed to request GPIO%d_%d: %d\n", ++ __FUNCTION__, pd->gpio / 32 + 1, pd->gpio % 32, ret); ++ goto rel_mux; ++ } ++ if (pd->dir) { ++ gpio_direction_output(pd->gpio, ++ pd->level); ++ } else { ++ gpio_direction_input(pd->gpio); ++ } ++ } ++ ++ ret = mxc_iomux_v3_setup_multiple_pads(stk5_ac97_pads_on, ++ ARRAY_SIZE(stk5_ac97_pads_on)); ++ if (ret != 0) { ++ goto rel_gpio; ++ } ++ udelay(1); ++ gpio_set_value(stk5_ac97_gpios[0].gpio, !stk5_ac97_gpios[0].level); ++ } ++ return ret; ++ ++ rel_mux: ++ mxc_iomux_v3_release_multiple_pads(stk5_ac97_gpios_off, ++ ARRAY_SIZE(stk5_ac97_gpios_off)); ++ rel_gpio: ++ while (--i >= 0) { ++ struct gpio_desc *pd = &stk5_ac97_gpios[i]; ++ int grp = pd->gpio / 32 + 1; ++ int ofs = pd->gpio % 32; ++ ++ DBG(0, "%s: Freeing GPIO%d_%d\n", __FUNCTION__, ++ grp, ofs); ++ gpio_free(pd->gpio); ++ } ++ return ret; ++} ++ ++static void stk5_ac97_exit(struct platform_device *dev) ++{ ++ int i; ++ ++ DBG(0, "%s: Releasing AC97 GPIO pins\n", __FUNCTION__); ++ ++ mxc_iomux_v3_release_multiple_pads(stk5_ac97_pads_on, ++ ARRAY_SIZE(stk5_ac97_pads_on)); ++ for (i = 0; i < ARRAY_SIZE(stk5_ac97_gpios); i++) { ++ struct gpio_desc *pd = &stk5_ac97_gpios[i]; ++ int grp = pd->gpio / 32 + 1; ++ int ofs = pd->gpio % 32; ++ ++ DBG(0, "%s: Freeing GPIO%d_%d\n", __FUNCTION__, ++ grp, ofs); ++ gpio_free(pd->gpio); ++ } ++} ++ ++static struct mxc_ac97_audio_ops stk5_ac97_ops = { ++ .init = stk5_ac97_init, ++ .exit = stk5_ac97_exit, ++ .startup = NULL, ++ .shutdown = NULL, ++ .suspend = NULL, ++ .resume = NULL, ++ .priv = NULL, ++}; ++ ++static struct platform_device ac97_device = { ++ .name = "mx25-ac97", ++ .id = -1, ++ .dev = { ++ .dma_mask = &stk5_dma_mask, ++ .coherent_dma_mask = ~0UL, ++ .platform_data = &stk5_ac97_ops, ++ }, ++}; ++#endif ++ ++static struct platform_dev_list { ++ struct platform_device *pdev; ++ int flag; ++} stk5_devices[] __initdata = { ++#if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE) ++ { .pdev = &stk5_led_device, .flag = -1, }, ++#endif ++#if defined(CONFIG_KEYBOARD_MXC) || defined(CONFIG_KEYBOARD_MXC_MODULE) ++ { .pdev = &stk5_keypad_device, .flag = 1, }, ++#endif ++#if defined(CONFIG_SPI_MXC) || defined(CONFIG_SPI_MXC_MODULE) ++ { .pdev = &mxcspi1_device, .flag = 1, }, ++#endif ++#if defined(CONFIG_AC97_BUS) || defined(CONFIG_AC97_BUS_MODULE) ++ { .pdev = &ac97_device, .flag = 1, }, ++#endif ++#if defined(CONFIG_MMC_MXC) || defined(CONFIG_MMC_MXC_MODULE) ++ { .pdev = &stk5_sdhc1_device, .flag = 1, }, ++#endif ++}; ++#define STK5_NUM_DEVICES ARRAY_SIZE(stk5_devices) ++ ++static __init int karo_stk5_board_init(void) ++{ ++ int ret; ++ int i; ++ ++ if (karo_get_board_type() != BOARD_KARO_STK5) { ++ return -ENODEV; ++ } ++ DBG(0, "%s: \n", __FUNCTION__); ++ ++ karo_stk5_serial_init(); ++ ++ dump_regs(); ++ ++ /* enable SSI1_INT (GPIO_3_15) for IRQ probing */ ++ set_irq_flags(gpio_to_irq(GPIO_PORTC | 15), IRQF_VALID | IRQF_PROBE); ++ ++ ret = karo_stk5_fb_register(); ++ if (ret) { ++ 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; ++ if (!stk5_devices[i].flag) { ++ DBG(0, "%s: Skipping platform device[%d] @ %p dev %p: %s\n", ++ __FUNCTION__, i, stk5_devices[i].pdev, &stk5_devices[i].pdev->dev, ++ stk5_devices[i].pdev->name); ++ continue; ++ } ++ DBG(0, "%s: Registering platform device[%d] @ %p dev %p: %s\n", ++ __FUNCTION__, i, stk5_devices[i].pdev, &stk5_devices[i].pdev->dev, ++ stk5_devices[i].pdev->name); ++ ret = platform_device_register(stk5_devices[i].pdev); ++ if (ret) { ++ printk(KERN_WARNING "%s: Failed to register platform_device[%d]: %s: %d\n", ++ __FUNCTION__, i, stk5_devices[i].pdev->name, ret); ++ } ++ } ++ DBG(0, "%s: Done\n", __FUNCTION__); ++ 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:59:19.000000000 +0200 +@@ -381,7 +381,7 @@ DEFINE_CLOCK(gpu2d_clk, 0, CCM_CGR3, 4 + .clk = &c, \ + }, + +-static struct clk_lookup lookups[] __initdata = { ++static struct clk_lookup lookups[] = { + _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:59:19.000000000 +0200 +@@ -516,7 +516,7 @@ DEFINE_CLOCK(ipg_clk, 0, NULL, + .clk = &c, \ + }, + +-static struct clk_lookup lookups[] __initdata = { ++static struct clk_lookup lookups[] = { + _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 18:01:59.000000000 +0200 +@@ -56,6 +56,9 @@ config ARCH_HAS_RNGA + bool + depends on ARCH_MXC + ++config ARCH_MXC_IOMUX_V2 ++ bool ++ + 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 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 + +-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 ++obj-$(CONFIG_ARCH_MXC_IOMUX_V2) += iomux-mx1-mx2.o dma-mx1-mx2.o ++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 18:02:13.000000000 +0200 +@@ -0,0 +1,17 @@ ++/* ++ * Copyright 2009 ++ * ++ * 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 ++ */ ++ ++#define UART1_ENABLED 1 ++#define UART2_ENABLED 1 ++#define UART3_ENABLED 1 ++/* 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 18:02:13.000000000 +0200 +@@ -0,0 +1,13 @@ ++/* ++ * Copyright 2009 ++ * ++ * 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 ++ */ ++ ++#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 18:02:05.000000000 +0200 +@@ -17,6 +17,7 @@ struct clk; + extern void mx1_map_io(void); + extern void mx21_map_io(void); + extern void mx27_map_io(void); ++extern void mx25_map_io(void); + extern void mx31_map_io(void); + extern void mx35_map_io(void); + extern void mxc_init_irq(void); +@@ -24,6 +25,7 @@ extern void mxc_timer_init(struct clk *t + extern int mx1_clocks_init(unsigned long fref); + extern int mx21_clocks_init(unsigned long lref, unsigned long fref); + extern int mx27_clocks_init(unsigned long fref); ++extern int mx25_clocks_init(unsigned long fref); + 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 18:02:13.000000000 +0200 +@@ -0,0 +1,259 @@ ++/* ++ * Copyright 2004-2008 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_DMA_H__ ++#define __ASM_ARCH_MXC_DMA_H__ ++ ++#include ++ ++#define MXC_DMA_DYNAMIC_CHANNEL 255 ++ ++#define MXC_DMA_DONE 0x0 ++#define MXC_DMA_REQUEST_TIMEOUT 0x1 ++#define MXC_DMA_TRANSFER_ERROR 0x2 ++ ++/*! This defines the list of device ID's for DMA */ ++typedef enum mxc_dma_device { ++ MXC_DMA_UART1_RX, ++ MXC_DMA_UART1_TX, ++ MXC_DMA_UART2_RX, ++ MXC_DMA_UART2_TX, ++ MXC_DMA_UART3_RX, ++ MXC_DMA_UART3_TX, ++ MXC_DMA_UART4_RX, ++ MXC_DMA_UART4_TX, ++ MXC_DMA_UART5_RX, ++ MXC_DMA_UART5_TX, ++ MXC_DMA_UART6_RX, ++ MXC_DMA_UART6_TX, ++ MXC_DMA_MMC1_WIDTH_1, ++ MXC_DMA_MMC1_WIDTH_4, ++ MXC_DMA_MMC2_WIDTH_1, ++ MXC_DMA_MMC2_WIDTH_4, ++ MXC_DMA_SSI1_8BIT_RX0, ++ MXC_DMA_SSI1_8BIT_TX0, ++ MXC_DMA_SSI1_16BIT_RX0, ++ MXC_DMA_SSI1_16BIT_TX0, ++ MXC_DMA_SSI1_24BIT_RX0, ++ MXC_DMA_SSI1_24BIT_TX0, ++ MXC_DMA_SSI1_8BIT_RX1, ++ MXC_DMA_SSI1_8BIT_TX1, ++ MXC_DMA_SSI1_16BIT_RX1, ++ MXC_DMA_SSI1_16BIT_TX1, ++ MXC_DMA_SSI1_24BIT_RX1, ++ MXC_DMA_SSI1_24BIT_TX1, ++ MXC_DMA_SSI2_8BIT_RX0, ++ MXC_DMA_SSI2_8BIT_TX0, ++ MXC_DMA_SSI2_16BIT_RX0, ++ MXC_DMA_SSI2_16BIT_TX0, ++ MXC_DMA_SSI2_24BIT_RX0, ++ MXC_DMA_SSI2_24BIT_TX0, ++ MXC_DMA_SSI2_8BIT_RX1, ++ MXC_DMA_SSI2_8BIT_TX1, ++ MXC_DMA_SSI2_16BIT_RX1, ++ MXC_DMA_SSI2_16BIT_TX1, ++ MXC_DMA_SSI2_24BIT_RX1, ++ MXC_DMA_SSI2_24BIT_TX1, ++ MXC_DMA_FIR_RX, ++ MXC_DMA_FIR_TX, ++ MXC_DMA_CSPI1_RX, ++ MXC_DMA_CSPI1_TX, ++ MXC_DMA_CSPI2_RX, ++ MXC_DMA_CSPI2_TX, ++ MXC_DMA_CSPI3_RX, ++ MXC_DMA_CSPI3_TX, ++ MXC_DMA_ATA_RX, ++ MXC_DMA_ATA_TX, ++ MXC_DMA_MEMORY, ++ MXC_DMA_FIFO_MEMORY, ++ MXC_DMA_DSP_PACKET_DATA0_RD, ++ MXC_DMA_DSP_PACKET_DATA0_WR, ++ MXC_DMA_DSP_PACKET_DATA1_RD, ++ MXC_DMA_DSP_PACKET_DATA1_WR, ++ MXC_DMA_DSP_LOG0_CHNL, ++ MXC_DMA_DSP_LOG1_CHNL, ++ MXC_DMA_DSP_LOG2_CHNL, ++ MXC_DMA_DSP_LOG3_CHNL, ++ MXC_DMA_CSI_RX, ++ MXC_DMA_SPDIF_16BIT_TX, ++ MXC_DMA_SPDIF_16BIT_RX, ++ MXC_DMA_SPDIF_32BIT_TX, ++ MXC_DMA_SPDIF_32BIT_RX, ++ MXC_DMA_ASRC_A_RX, ++ MXC_DMA_ASRC_A_TX, ++ MXC_DMA_ASRC_B_RX, ++ MXC_DMA_ASRC_B_TX, ++ MXC_DMA_ASRC_C_RX, ++ MXC_DMA_ASRC_C_TX, ++ MXC_DMA_ESAI_16BIT_RX, ++ MXC_DMA_ESAI_16BIT_TX, ++ MXC_DMA_ESAI_24BIT_RX, ++ MXC_DMA_ESAI_24BIT_TX, ++ MXC_DMA_TEST_RAM2D2RAM, ++ MXC_DMA_TEST_RAM2RAM2D, ++ MXC_DMA_TEST_RAM2D2RAM2D, ++ MXC_DMA_TEST_RAM2RAM, ++ MXC_DMA_TEST_HW_CHAINING, ++ MXC_DMA_TEST_SW_CHAINING ++} mxc_dma_device_t; ++ ++/*! This defines the prototype of callback funtion registered by the drivers */ ++typedef void (*mxc_dma_callback_t) (void *arg, int error_status, ++ unsigned int count); ++ ++/*! This defines the type of DMA transfer requested */ ++typedef enum mxc_dma_mode { ++ MXC_DMA_MODE_READ, ++ MXC_DMA_MODE_WRITE, ++} mxc_dma_mode_t; ++ ++/*! This defines the DMA channel parameters */ ++typedef struct mxc_dma_channel { ++ unsigned int active:1; /*!< When there has a active tranfer, it is set to 1 */ ++ unsigned int lock; /*!< Defines the channel is allocated or not */ ++ int curr_buf; /*!< Current buffer */ ++ mxc_dma_mode_t mode; /*!< Read or Write */ ++ unsigned int channel; /*!< Channel info */ ++ unsigned int dynamic:1; /*!< Channel not statically allocated when 1 */ ++ char *dev_name; /*!< Device name */ ++ void *private; /*!< Private structure for platform */ ++ mxc_dma_callback_t cb_fn; /*!< The callback function */ ++ void *cb_args; /*!< The argument of callback function */ ++} mxc_dma_channel_t; ++ ++/*! This structure contains the information about a dma transfer */ ++typedef struct mxc_dma_requestbuf { ++ dma_addr_t src_addr; /*!< source address */ ++ dma_addr_t dst_addr; /*!< destination address */ ++ int num_of_bytes; /*!< the length of this transfer : bytes */ ++} mxc_dma_requestbuf_t; ++ ++/*! ++ * This function is generally called by the driver at open time. ++ * The DMA driver would do any initialization steps that is required ++ * to get the channel ready for data transfer. ++ * ++ * @param channel_id a pre-defined id. The peripheral driver would specify ++ * the id associated with its peripheral. This would be ++ * used by the DMA driver to identify the peripheral ++ * requesting DMA and do the necessary setup on the ++ * channel associated with the particular peripheral. ++ * The DMA driver could use static or dynamic DMA channel ++ * allocation. ++ * @param dev_name module name or device name ++ * @return returns a negative number on error if request for a DMA channel did not ++ * succeed, returns the channel number to be used on success. ++ */ ++extern int mxc_dma_request(mxc_dma_device_t channel_id, char *dev_name); ++ ++/*! ++ * This function is generally called by the driver at close time. The DMA ++ * driver would do any cleanup associated with this channel. ++ * ++ * @param channel_num the channel number returned at request time. This ++ * would be used by the DMA driver to identify the calling ++ * driver and do the necessary cleanup on the channel ++ * associated with the particular peripheral ++ * @return returns a negative number on error or 0 on success ++ */ ++extern int mxc_dma_free(int channel_num); ++ ++/*! ++ * This function would just configure the buffers specified by the user into ++ * dma channel. The caller must call mxc_dma_enable to start this transfer. ++ * ++ * @param channel_num the channel number returned at request time. This ++ * would be used by the DMA driver to identify the calling ++ * driver and do the necessary cleanup on the channel ++ * associated with the particular peripheral ++ * @param dma_buf an array of physical addresses to the user defined ++ * buffers. The caller must guarantee the dma_buf is ++ * available until the transfer is completed. ++ * @param num_buf number of buffers in the array ++ * @param mode specifies whether this is READ or WRITE operation ++ * @return This function returns a negative number on error if buffer could not be ++ * added with DMA for transfer. On Success, it returns 0 ++ */ ++extern int mxc_dma_config(int channel_num, mxc_dma_requestbuf_t * dma_buf, ++ int num_buf, mxc_dma_mode_t mode); ++ ++/*! ++ * This function would just configure the scatterlist specified by the ++ * user into dma channel. This is a slight variation of mxc_dma_config(), ++ * it is provided for the convenience of drivers that have a scatterlist ++ * passed into them. It is the calling driver's responsibility to have the ++ * correct physical address filled in the "dma_address" field of the ++ * scatterlist. ++ * ++ * @param channel_num the channel number returned at request time. This ++ * would be used by the DMA driver to identify the calling ++ * driver and do the necessary cleanup on the channel ++ * associated with the particular peripheral ++ * @param sg a scatterlist of buffers. The caller must guarantee ++ * the dma_buf is available until the transfer is ++ * completed. ++ * @param num_buf number of buffers in the array ++ * @param num_of_bytes total number of bytes to transfer. If set to 0, this ++ * would imply to use the length field of the scatterlist ++ * for each DMA transfer. Else it would calculate the size ++ * for each DMA transfer. ++ * @param mode specifies whether this is READ or WRITE operation ++ * @return This function returns a negative number on error if buffer could not ++ * be added with DMA for transfer. On Success, it returns 0 ++ */ ++extern int mxc_dma_sg_config(int channel_num, struct scatterlist *sg, ++ int num_buf, int num_of_bytes, ++ mxc_dma_mode_t mode); ++ ++/*! ++ * This function is provided if the driver would like to set/change its ++ * callback function. ++ * ++ * @param channel_num the channel number returned at request time. This ++ * would be used by the DMA driver to identify the calling ++ * driver and do the necessary cleanup on the channel ++ * associated with the particular peripheral ++ * @param callback a callback function to provide notification on transfer ++ * completion, user could specify NULL if he does not wish ++ * to be notified ++ * @param arg an argument that gets passed in to the callback ++ * function, used by the user to do any driver specific ++ * operations. ++ * @return this function returns a negative number on error if the callback ++ * could not be set for the channel or 0 on success ++ */ ++extern int mxc_dma_callback_set(int channel_num, mxc_dma_callback_t callback, ++ void *arg); ++ ++/*! ++ * This stops the DMA channel and any ongoing transfers. Subsequent use of ++ * mxc_dma_enable() will restart the channel and restart the transfer. ++ * ++ * @param channel_num the channel number returned at request time. This ++ * would be used by the DMA driver to identify the calling ++ * driver and do the necessary cleanup on the channel ++ * associated with the particular peripheral ++ * @return returns a negative number on error or 0 on success ++ */ ++extern int mxc_dma_disable(int channel_num); ++ ++/*! ++ * This starts DMA transfer. Or it restarts DMA on a stopped channel ++ * previously stopped with mxc_dma_disable(). ++ * ++ * @param channel_num the channel number returned at request time. This ++ * would be used by the DMA driver to identify the calling ++ * driver and do the necessary cleanup on the channel ++ * associated with the particular peripheral ++ * @return returns a negative number on error or 0 on success ++ */ ++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 18:02:06.000000000 +0200 +@@ -29,13 +29,18 @@ + #endif + + #ifdef CONFIG_ARCH_MX2 ++#ifndef CONFIG_MACH_MX25 + # include ++#endif + # ifdef CONFIG_MACH_MX21 + # include + # endif + # ifdef CONFIG_MACH_MX27 + # include + # endif ++# ifdef CONFIG_MACH_MX25 ++# include ++# endif + #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 18:02:06.000000000 +0200 +@@ -13,7 +13,8 @@ + #define PCR_BPIX_4 (2 << 25) + #define PCR_BPIX_8 (3 << 25) + #define PCR_BPIX_12 (4 << 25) +-#define PCR_BPIX_16 (4 << 25) ++#define PCR_BPIX_16 (5 << 25) ++#define PCR_BPIX_18 (6 << 25) + #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 18:02:13.000000000 +0200 +@@ -0,0 +1,905 @@ ++/* ++ * arch/arm/plat-mxc/include/mach/iomux-mx25.h ++ * ++ * Copyright (C) 2009 by Lothar Wassmann ++ * ++ * based on arch/arm/mach-mx25/mx25_pins.h ++ * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved. ++ * and ++ * arch/arm/plat-mxc/include/mach/iomux-mx35.h ++ * Copyright (C, NO_PAD_CTRL) 2009 by Jan Weitzel Phytec Messtechnik GmbH ++ * ++ * 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 __IOMUX_MX25_H__ ++#define __IOMUX_MX25_H__ ++ ++#include ++ ++/* ++ * ++ * @brief MX25 I/O Pin List ++ * ++ * @ingroup GPIO_MX25 ++ */ ++ ++#ifndef __ASSEMBLY__ ++ ++/* ++ * 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 IOMUX_TO_GPIO(__pad_desc) ({ \ ++ int __gpio = -1; \ ++ struct pad_desc *__pd = __pad_desc; \ ++ \ ++ switch (__pd->mux_ctrl_ofs) { \ ++ case MX25_PAD_GPIO_A__GPIO_A: \ ++ __gpio = GPIO_A; \ ++ break; \ ++ case MX25_PAD_GPIO_B__GPIO_B: \ ++ __gpio = GPIO_B; \ ++ break; \ ++ case MX25_PAD_GPIO_C__GPIO_C: \ ++ __gpio = GPIO_C; \ ++ break; \ ++ case MX25_PAD_GPIO_D__GPIO_D: \ ++ __gpio = GPIO_D; \ ++ break; \ ++ case MX25_PAD_GPIO_E__GPIO_E: \ ++ __gpio = GPIO_E; \ ++ break; \ ++ case MX25_PAD_GPIO_F__GPIO_F: \ ++ __gpio = GPIO_F; \ ++ break; \ ++ case MX25_PAD_CSI_D7__GPIO_1_6: \ ++ __gpio = GPIO_1_6; \ ++ break; \ ++ case MX25_PAD_CSI_D8__GPIO_1_7: \ ++ __gpio = GPIO_1_7; \ ++ break; \ ++ case MX25_PAD_CSI_MCLK__GPIO_1_8: \ ++ __gpio = GPIO_1_8; \ ++ break; \ ++ case MX25_PAD_CSI_VSYNC__GPIO_1_9: \ ++ __gpio = GPIO_1_9; \ ++ break; \ ++ case MX25_PAD_CSI_HSYNC__GPIO_1_10: \ ++ __gpio = GPIO_1_10; \ ++ break; \ ++ case MX25_PAD_CSI_PIXCLK__GPIO_1_11: \ ++ __gpio = GPIO_1_11; \ ++ break; \ ++ case MX25_PAD_I2C1_CLK__GPIO_1_12: \ ++ __gpio = GPIO_1_12; \ ++ break; \ ++ case MX25_PAD_I2C1_DAT__GPIO_1_13: \ ++ __gpio = GPIO_1_13; \ ++ break; \ ++ case MX25_PAD_CSPI1_MOSI__GPIO_1_14: \ ++ __gpio = GPIO_1_14; \ ++ break; \ ++ case MX25_PAD_CSPI1_MISO__GPIO_1_15: \ ++ __gpio = GPIO_1_15; \ ++ break; \ ++ case MX25_PAD_CSPI1_SS0__GPIO_1_16: \ ++ __gpio = GPIO_1_16; \ ++ break; \ ++ case MX25_PAD_CSPI1_SS1__GPIO_1_17: \ ++ __gpio = GPIO_1_17; \ ++ break; \ ++ case MX25_PAD_CSPI1_SCLK__GPIO_1_18: \ ++ __gpio = GPIO_1_18; \ ++ break; \ ++ case MX25_PAD_LD5__GPIO_1_19: \ ++ __gpio = GPIO_1_19; \ ++ break; \ ++ case MX25_PAD_LD6__GPIO_1_20: \ ++ __gpio = GPIO_1_20; \ ++ break; \ ++ case MX25_PAD_LD7__GPIO_1_21: \ ++ __gpio = GPIO_1_21; \ ++ break; \ ++ case MX25_PAD_HSYNC__GPIO_1_22: \ ++ __gpio = GPIO_1_22; \ ++ break; \ ++ case MX25_PAD_VSYNC__GPIO_1_23: \ ++ __gpio = GPIO_1_23; \ ++ break; \ ++ case MX25_PAD_LSCLK__GPIO_1_24: \ ++ __gpio = GPIO_1_24; \ ++ break; \ ++ case MX25_PAD_OE_ACD__GPIO_1_25: \ ++ __gpio = GPIO_1_25; \ ++ break; \ ++ case MX25_PAD_PWM__GPIO_1_26: \ ++ __gpio = GPIO_1_26; \ ++ break; \ ++ case MX25_PAD_CSI_D2__GPIO_1_27: \ ++ __gpio = GPIO_1_27; \ ++ break; \ ++ case MX25_PAD_CSI_D3__GPIO_1_28: \ ++ __gpio = GPIO_1_28; \ ++ break; \ ++ case MX25_PAD_CSI_D4__GPIO_1_29: \ ++ __gpio = GPIO_1_29; \ ++ break; \ ++ case MX25_PAD_CSI_D5__GPIO_1_30: \ ++ __gpio = GPIO_1_30; \ ++ break; \ ++ case MX25_PAD_CSI_D6__GPIO_1_31: \ ++ __gpio = GPIO_1_31; \ ++ break; \ ++ \ ++ case MX25_PAD_A14__GPIO_2_0: \ ++ __gpio = GPIO_2_0; \ ++ break; \ ++ case MX25_PAD_A15__GPIO_2_1: \ ++ __gpio = GPIO_2_1; \ ++ break; \ ++ case MX25_PAD_A16__GPIO_2_2: \ ++ __gpio = GPIO_2_2; \ ++ break; \ ++ case MX25_PAD_A17__GPIO_2_3: \ ++ __gpio = GPIO_2_3; \ ++ break; \ ++ case MX25_PAD_A18__GPIO_2_4: \ ++ __gpio = GPIO_2_4; \ ++ break; \ ++ case MX25_PAD_A19__GPIO_2_5: \ ++ __gpio = GPIO_2_5; \ ++ break; \ ++ case MX25_PAD_A20__GPIO_2_6: \ ++ __gpio = GPIO_2_6; \ ++ break; \ ++ case MX25_PAD_A21__GPIO_2_7: \ ++ __gpio = GPIO_2_7; \ ++ break; \ ++ case MX25_PAD_A22__GPIO_2_8: \ ++ __gpio = GPIO_2_8; \ ++ break; \ ++ case MX25_PAD_A23__GPIO_2_9: \ ++ __gpio = GPIO_2_9; \ ++ break; \ ++ case MX25_PAD_A24__GPIO_2_10: \ ++ __gpio = GPIO_2_10; \ ++ break; \ ++ case MX25_PAD_A25__GPIO_2_11: \ ++ __gpio = GPIO_2_11; \ ++ break; \ ++ case MX25_PAD_EB0__GPIO_2_12: \ ++ __gpio = GPIO_2_12; \ ++ break; \ ++ case MX25_PAD_EB1__GPIO_2_13: \ ++ __gpio = GPIO_2_13; \ ++ break; \ ++ case MX25_PAD_OE__GPIO_2_14: \ ++ __gpio = GPIO_2_14; \ ++ break; \ ++ case MX25_PAD_LD0__GPIO_2_15: \ ++ __gpio = GPIO_2_15; \ ++ break; \ ++ case MX25_PAD_LD1__GPIO_2_16: \ ++ __gpio = GPIO_2_16; \ ++ break; \ ++ case MX25_PAD_LD2__GPIO_2_17: \ ++ __gpio = GPIO_2_17; \ ++ break; \ ++ case MX25_PAD_LD3__GPIO_2_18: \ ++ __gpio = GPIO_2_18; \ ++ break; \ ++ case MX25_PAD_LD4__GPIO_2_19: \ ++ __gpio = GPIO_2_19; \ ++ break; \ ++ case MX25_PAD_DE_B__GPIO_2_20: \ ++ __gpio = GPIO_2_20; \ ++ break; \ ++ case MX25_PAD_CLKO__GPIO_2_21: \ ++ __gpio = GPIO_2_21; \ ++ break; \ ++ case MX25_PAD_CSPI1_RDY__GPIO_2_22: \ ++ __gpio = GPIO_2_22; \ ++ break; \ ++ case MX25_PAD_SD1_CMD__GPIO_2_23: \ ++ __gpio = GPIO_2_23; \ ++ break; \ ++ case MX25_PAD_SD1_CLK__GPIO_2_24: \ ++ __gpio = GPIO_2_24; \ ++ break; \ ++ case MX25_PAD_SD1_DATA0__GPIO_2_25: \ ++ __gpio = GPIO_2_25; \ ++ break; \ ++ case MX25_PAD_SD1_DATA1__GPIO_2_26: \ ++ __gpio = GPIO_2_26; \ ++ break; \ ++ case MX25_PAD_SD1_DATA2__GPIO_2_27: \ ++ __gpio = GPIO_2_27; \ ++ break; \ ++ case MX25_PAD_SD1_DATA3__GPIO_2_28: \ ++ __gpio = GPIO_2_28; \ ++ break; \ ++ case MX25_PAD_KPP_ROW0__GPIO_2_29: \ ++ __gpio = GPIO_2_29; \ ++ break; \ ++ case MX25_PAD_KPP_ROW1__GPIO_2_30: \ ++ __gpio = GPIO_2_30; \ ++ break; \ ++ case MX25_PAD_KPP_ROW2__GPIO_2_31: \ ++ __gpio = GPIO_2_31; \ ++ break; \ ++ \ ++ case MX25_PAD_KPP_ROW3__GPIO_3_0: \ ++ __gpio = GPIO_3_0; \ ++ break; \ ++ case MX25_PAD_KPP_COL0__GPIO_3_1: \ ++ __gpio = GPIO_3_1; \ ++ break; \ ++ case MX25_PAD_KPP_COL1__GPIO_3_2: \ ++ __gpio = GPIO_3_2; \ ++ break; \ ++ case MX25_PAD_KPP_COL2__GPIO_3_3: \ ++ __gpio = GPIO_3_3; \ ++ break; \ ++ case MX25_PAD_KPP_COL3__GPIO_3_4: \ ++ __gpio = GPIO_3_4; \ ++ break; \ ++ case MX25_PAD_FEC_MDC__GPIO_3_5: \ ++ __gpio = GPIO_3_5; \ ++ break; \ ++ case MX25_PAD_FEC_MDIO__GPIO_3_6: \ ++ __gpio = GPIO_3_6; \ ++ break; \ ++ case MX25_PAD_FEC_TDATA0__GPIO_3_7: \ ++ __gpio = GPIO_3_7; \ ++ break; \ ++ case MX25_PAD_FEC_TDATA1__GPIO_3_8: \ ++ __gpio = GPIO_3_8; \ ++ break; \ ++ case MX25_PAD_FEC_TX_EN__GPIO_3_9: \ ++ __gpio = GPIO_3_9; \ ++ break; \ ++ case MX25_PAD_FEC_RDATA0__GPIO_3_10: \ ++ __gpio = GPIO_3_10; \ ++ break; \ ++ case MX25_PAD_FEC_RDATA1__GPIO_3_11: \ ++ __gpio = GPIO_3_11; \ ++ break; \ ++ case MX25_PAD_FEC_RX_DV__GPIO_3_12: \ ++ __gpio = GPIO_3_12; \ ++ break; \ ++ case MX25_PAD_FEC_TX_CLK__GPIO_3_13: \ ++ __gpio = GPIO_3_13; \ ++ break; \ ++ case MX25_PAD_RTCK__GPIO_3_14: \ ++ __gpio = GPIO_3_14; \ ++ break; \ ++ case MX25_PAD_EXT_ARMCLK__GPIO_3_15: \ ++ __gpio = GPIO_3_15; \ ++ break; \ ++ case MX25_PAD_UPLL_BYPCLK__GPIO_3_16: \ ++ __gpio = GPIO_3_16; \ ++ break; \ ++ case MX25_PAD_VSTBY_REQ__GPIO_3_17: \ ++ __gpio = GPIO_3_17; \ ++ break; \ ++ case MX25_PAD_VSTBY_ACK__GPIO_3_18: \ ++ __gpio = GPIO_3_18; \ ++ break; \ ++ case MX25_PAD_POWER_FAIL__GPIO_3_19: \ ++ __gpio = GPIO_3_19; \ ++ break; \ ++ case MX25_PAD_CS4__GPIO_3_20: \ ++ __gpio = GPIO_3_20; \ ++ break; \ ++ case MX25_PAD_CS5__GPIO_3_21: \ ++ __gpio = GPIO_3_21; \ ++ break; \ ++ case MX25_PAD_NF_CE0__GPIO_3_22: \ ++ __gpio = GPIO_3_22; \ ++ break; \ ++ case MX25_PAD_ECB__GPIO_3_23: \ ++ __gpio = GPIO_3_23; \ ++ break; \ ++ case MX25_PAD_LBA__GPIO_3_24: \ ++ __gpio = GPIO_3_24; \ ++ break; \ ++ case MX25_PAD_RW__GPIO_3_25: \ ++ __gpio = GPIO_3_25; \ ++ break; \ ++ case MX25_PAD_NFWE_B__GPIO_3_26: \ ++ __gpio = GPIO_3_26; \ ++ break; \ ++ case MX25_PAD_NFRE_B__GPIO_3_27: \ ++ __gpio = GPIO_3_27; \ ++ break; \ ++ case MX25_PAD_NFALE__GPIO_3_28: \ ++ __gpio = GPIO_3_28; \ ++ break; \ ++ case MX25_PAD_NFCLE__GPIO_3_29: \ ++ __gpio = GPIO_3_29; \ ++ break; \ ++ case MX25_PAD_NFWP_B__GPIO_3_30: \ ++ __gpio = GPIO_3_30; \ ++ break; \ ++ case MX25_PAD_NFRB__GPIO_3_31: \ ++ __gpio = GPIO_3_31; \ ++ break; \ ++ \ ++ case MX25_PAD_A10__GPIO_4_0: \ ++ __gpio = GPIO_4_0; \ ++ break; \ ++ case MX25_PAD_A13__GPIO_4_1: \ ++ __gpio = GPIO_4_1; \ ++ break; \ ++ case MX25_PAD_CS0__GPIO_4_2: \ ++ __gpio = GPIO_4_2; \ ++ break; \ ++ case MX25_PAD_CS1__GPIO_4_3: \ ++ __gpio = GPIO_4_3; \ ++ break; \ ++ case MX25_PAD_BCLK__GPIO_4_4: \ ++ __gpio = GPIO_4_4; \ ++ break; \ ++ case MX25_PAD_D15__GPIO_4_5: \ ++ __gpio = GPIO_4_5; \ ++ break; \ ++ case MX25_PAD_D14__GPIO_4_6: \ ++ __gpio = GPIO_4_6; \ ++ break; \ ++ case MX25_PAD_D13__GPIO_4_7: \ ++ __gpio = GPIO_4_7; \ ++ break; \ ++ case MX25_PAD_D12__GPIO_4_8: \ ++ __gpio = GPIO_4_8; \ ++ break; \ ++ case MX25_PAD_D11__GPIO_4_9: \ ++ __gpio = GPIO_4_9; \ ++ break; \ ++ case MX25_PAD_D10__GPIO_4_10: \ ++ __gpio = GPIO_4_10; \ ++ break; \ ++ case MX25_PAD_D9__GPIO_4_11: \ ++ __gpio = GPIO_4_11; \ ++ break; \ ++ case MX25_PAD_D8__GPIO_4_12: \ ++ __gpio = GPIO_4_12; \ ++ break; \ ++ case MX25_PAD_D7__GPIO_4_13: \ ++ __gpio = GPIO_4_13; \ ++ break; \ ++ case MX25_PAD_D6__GPIO_4_14: \ ++ __gpio = GPIO_4_14; \ ++ break; \ ++ case MX25_PAD_D5__GPIO_4_15: \ ++ __gpio = GPIO_4_15; \ ++ break; \ ++ case MX25_PAD_D4__GPIO_4_16: \ ++ __gpio = GPIO_4_16; \ ++ break; \ ++ case MX25_PAD_D3__GPIO_4_17: \ ++ __gpio = GPIO_4_17; \ ++ break; \ ++ case MX25_PAD_D2__GPIO_4_18: \ ++ __gpio = GPIO_4_18; \ ++ break; \ ++ case MX25_PAD_D1__GPIO_4_19: \ ++ __gpio = GPIO_4_19; \ ++ break; \ ++ case MX25_PAD_D0__GPIO_4_20: \ ++ __gpio = GPIO_4_20; \ ++ break; \ ++ case MX25_PAD_CSI_D9__GPIO_4_21: \ ++ __gpio = GPIO_4_21; \ ++ break; \ ++ case MX25_PAD_UART1_RXD__GPIO_4_22: \ ++ __gpio = GPIO_4_22; \ ++ break; \ ++ case MX25_PAD_UART1_TXD__GPIO_4_23: \ ++ __gpio = GPIO_4_23; \ ++ break; \ ++ case MX25_PAD_UART1_RTS__GPIO_4_24: \ ++ __gpio = GPIO_4_24; \ ++ break; \ ++ case MX25_PAD_UART1_CTS__GPIO_4_25: \ ++ __gpio = GPIO_4_25; \ ++ break; \ ++ case MX25_PAD_UART2_RXD__GPIO_4_26: \ ++ __gpio = GPIO_4_26; \ ++ break; \ ++ case MX25_PAD_UART2_TXD__GPIO_4_27: \ ++ __gpio = GPIO_4_27; \ ++ break; \ ++ case MX25_PAD_UART2_RTS__GPIO_4_28: \ ++ __gpio = GPIO_4_28; \ ++ break; \ ++ case MX25_PAD_UART2_CTS__GPIO_4_29: \ ++ __gpio = GPIO_4_29; \ ++ break; \ ++ case MX25_PAD_BOOT_MODE0__GPIO_4_30: \ ++ __gpio = GPIO_4_30; \ ++ break; \ ++ case MX25_PAD_BOOT_MODE1__GPIO_4_31: \ ++ __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 18:02:08.000000000 +0200 +@@ -54,7 +54,7 @@ struct pad_desc { + unsigned select_input:3; + }; + +-#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 { + /* + * 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_DRIVE_VOLTAGE_3_3_V (0 << 13) ++#define PAD_CTL_DRIVE_VOLTAGE_1_8_V (1 << 13) + +-#define PAD_CTL_NO_HYSTERESIS 0 +-#define PAD_CTL_HYSTERESIS 1 ++#define PAD_CTL_NO_HYSTERESIS (0 << 8) ++#define PAD_CTL_HYSTERESIS (1 << 8) + +-#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_PULL_DISABLED (0x0 << 4) ++#define PAD_CTL_PULL_KEEPER (0x8 << 4) ++#define PAD_CTL_PULL_DOWN_100K (0xc << 4) ++#define PAD_CTL_PULL_UP_47K (0xd << 4) ++#define PAD_CTL_PULL_UP_100K (0xe << 4) ++#define PAD_CTL_PULL_UP_22K (0xf << 4) ++ ++#define PAD_CTL_OUTPUT_CMOS (0 << 3) ++#define PAD_CTL_OUTPUT_OPEN_DRAIN (1 << 3) ++ ++#define PAD_CTL_DRIVE_STRENGTH_NORM (0 << 1) ++#define PAD_CTL_DRIVE_STRENGTH_HIGH (1 << 1) ++#define PAD_CTL_DRIVE_STRENGTH_MAX (2 << 1) + +-#define PAD_CTL_SLEW_RATE_SLOW 0 +-#define PAD_CTL_SLEW_RATE_FAST 1 ++#define PAD_CTL_SLEW_RATE_SLOW (0 << 0) ++#define PAD_CTL_SLEW_RATE_FAST (1 << 0) + + /* + * 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 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 + */ ++#ifndef CONFIG_MACH_MX25 + #define VA_GPIO_BASE IO_ADDRESS(GPIO_BASE_ADDR) ++#endif + #define MXC_DDIR(x) (0x00 + ((x) << 8)) ++#ifndef CONFIG_MACH_MX25 + #define MXC_OCR1(x) (0x04 + ((x) << 8)) + #define MXC_OCR2(x) (0x08 + ((x) << 8)) ++#endif + #define MXC_ICONFA1(x) (0x0c + ((x) << 8)) + #define MXC_ICONFA2(x) (0x10 + ((x) << 8)) + #define MXC_ICONFB1(x) (0x14 + ((x) << 8)) +@@ -96,16 +100,20 @@ + + + #ifdef CONFIG_ARCH_MX1 +-#include ++# include + #endif + #ifdef CONFIG_ARCH_MX2 +-#include +-#ifdef CONFIG_MACH_MX21 +-#include +-#endif +-#ifdef CONFIG_MACH_MX27 +-#include +-#endif ++# ifndef CONFIG_MACH_MX25 ++# include ++# ifdef CONFIG_MACH_MX21 ++# include ++# endif ++# endif ++# ifdef CONFIG_MACH_MX27 ++# include ++# else ++# include ++# endif + #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 18:02:09.000000000 +0200 +@@ -21,7 +21,11 @@ + #if defined CONFIG_ARCH_MX1 + #define MXC_GPIO_IRQS (32 * 4) + #elif defined CONFIG_ARCH_MX2 ++#ifndef CONFIG_MACH_MX25 + #define MXC_GPIO_IRQS (32 * 6) ++#else ++#define MXC_GPIO_IRQS (32 * 4) ++#endif + #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 18:02:09.000000000 +0200 +@@ -14,12 +14,13 @@ + #if defined CONFIG_ARCH_MX1 + #define PHYS_OFFSET UL(0x08000000) + #elif defined CONFIG_ARCH_MX2 +-#ifdef CONFIG_MACH_MX21 ++# if defined(CONFIG_MACH_MX21) + #define PHYS_OFFSET UL(0xC0000000) +-#endif +-#ifdef CONFIG_MACH_MX27 ++# elif defined(CONFIG_MACH_MX27) + #define PHYS_OFFSET UL(0xA0000000) +-#endif ++# elif defined(CONFIG_MACH_MX25) ++#define PHYS_OFFSET UL(0x80000000) ++# endif + #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 18:02:13.000000000 +0200 +@@ -0,0 +1,482 @@ ++/* ++ * Copyright 2008-2009 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 ++ */ ++ ++/*! ++ * @file arch-mxc/mx25.h ++ * @brief This file contains register definitions. ++ * ++ * @ingroup MSL_MX25 ++ */ ++ ++#ifndef __ASM_ARCH_MXC_MX25_H__ ++#define __ASM_ARCH_MXC_MX25_H__ ++ ++#ifndef __ASM_ARCH_MXC_HARDWARE_H__ ++#error "Do not include directly." ++#endif ++ ++#ifdef CONFIG_DEBUG_LL ++#ifdef CONFIG_MACH_TX25 ++#include ++#endif ++#endif // CONFIG_DEBUG_LL ++ ++/* ++ * MX25 memory map: ++ * ++ * Virt Phys Size What ++ * --------------------------------------------------------------------------- ++ * FC000000 43F00000 1M AIPS 1 ++ * FC100000 50000000 1M SPBA ++ * FC200000 53F00000 1M AIPS 2 ++ * FC300000 60000000 1M ROMPATCH (128M) ++ * FC400000 68000000 1M ASIC (128M) ++ * FC500000 78000000 128K FBC RAM (IRAM) ++ * 80000000 256M SDRAM0 ++ * 90000000 256M SDRAM1 ++ * A0000000 128M CS0 Flash ++ * A8000000 128M CS1 Flash ++ * B0000000 32M CS2 SRAM ++ * B2000000 32M CS3 ++ * B4000000 32M CS4 ++ * B6000000 32M CS5 ++ * FC520000 B8000000 64K SDRAM, WEIM, M3IF, EMI controllers ++ * FC530000 BB000000 8K NFC ++ */ ++ ++#include ++#define VA(x) _AT(void __force __iomem *,x) ++ ++/* ++ * IRAM ++ */ ++#define IRAM_BASE_ADDR UL(0x78000000) /* internal ram */ ++#define IRAM_BASE_ADDR_VIRT VA(0xFC500000) ++#define IRAM_SIZE SZ_128K ++ ++/* ++ * AIPS 1 ++ */ ++#define AIPS1_BASE_ADDR UL(0x43F00000) ++#define AIPS1_BASE_ADDR_VIRT VA(0xFC000000) ++#define AIPS1_SIZE SZ_1M ++ ++#define MAX_BASE_ADDR (AIPS1_BASE_ADDR + 0x00004000) ++#define CLKCTL_BASE_ADDR (AIPS1_BASE_ADDR + 0x00008000) ++#define ETB_SLOT4_BASE_ADDR (AIPS1_BASE_ADDR + 0x0000C000) ++#define ETB_SLOT5_BASE_ADDR (AIPS1_BASE_ADDR + 0x00010000) ++#define AAPE_BASE_ADDR (AIPS1_BASE_ADDR + 0x00014000) ++#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 UART1_BASE_ADDR (AIPS1_BASE_ADDR + 0x00090000) ++#define UART2_BASE_ADDR (AIPS1_BASE_ADDR + 0x00094000) ++#define I2C2_BASE_ADDR (AIPS1_BASE_ADDR + 0x00098000) ++#define OWIRE_BASE_ADDR (AIPS1_BASE_ADDR + 0x0009C000) ++#define ATA_BASE_ADDR (AIPS1_BASE_ADDR + 0x000A0000) ++#define CSPI1_BASE_ADDR (AIPS1_BASE_ADDR + 0x000A4000) ++#define KPP_BASE_ADDR (AIPS1_BASE_ADDR + 0x000A8000) ++#define IOMUXC_BASE_ADDR (AIPS1_BASE_ADDR + 0x000AC000) ++#define AUDMUX_BASE_ADDR (AIPS1_BASE_ADDR + 0x000B0000) ++#define ECT_A_BASE_ADDR (AIPS1_BASE_ADDR + 0x000B8000) ++#define ECT_B_BASE_ADDR (AIPS1_BASE_ADDR + 0x000BC000) ++ ++/* ++ * SPBA global module enabled #0 ++ */ ++#define SPBA0_BASE_ADDR UL(0x50000000) ++#define SPBA0_BASE_ADDR_VIRT VA(0xFC100000) ++#define SPBA0_SIZE SZ_1M ++ ++#define CSPI3_BASE_ADDR (SPBA0_BASE_ADDR + 0x00004000) ++#define UART4_BASE_ADDR (SPBA0_BASE_ADDR + 0x00008000) ++#define UART3_BASE_ADDR (SPBA0_BASE_ADDR + 0x0000C000) ++#define CSPI2_BASE_ADDR (SPBA0_BASE_ADDR + 0x00010000) ++#define SSI2_BASE_ADDR (SPBA0_BASE_ADDR + 0x00014000) ++#define ESAI_BASE_ADDR (SPBA0_BASE_ADDR + 0x00018000) ++#define ATA_DMA_BASE_ADDR (SPBA0_BASE_ADDR + 0x00020000) ++#define SIM1_BASE_ADDR (SPBA0_BASE_ADDR + 0x00024000) ++#define SIM2_BASE_ADDR (SPBA0_BASE_ADDR + 0x00028000) ++#define UART5_BASE_ADDR (SPBA0_BASE_ADDR + 0x0002C000) ++#define TSC_BASE_ADDR (SPBA0_BASE_ADDR + 0x00030000) ++#define SSI1_BASE_ADDR (SPBA0_BASE_ADDR + 0x00034000) ++#define FEC_BASE_ADDR (SPBA0_BASE_ADDR + 0x00038000) ++#define SPBA_CTRL_BASE_ADDR (SPBA0_BASE_ADDR + 0x0003C000) ++ ++/*! ++ * defines for SPBA modules ++ */ ++#define SPBA_CSPI3 (0x1 << 2) ++#define SPBA_UART4 (0x2 << 2) ++#define SPBA_UART3 (0x3 << 2) ++#define SPBA_CSPI2 (0x4 << 2) ++#define SPBA_SSI2 (0x5 << 2) ++#define SPBA_ESAI (0x6 << 2) ++#define SPBA_ATA (0x8 << 2) ++#define SPBA_SIM1 (0x9 << 2) ++#define SPBA_SIM2 (0xA << 2) ++#define SPBA_UART5 (0xB << 2) ++#define SPBA_ANALOG (0xC << 2) ++#define SPBA_SSI1 (0xD << 2) ++#define SPBA_FEC (0xE << 2) ++ ++/*! ++ * Defines for modules using static and dynamic DMA channels ++ */ ++#define MXC_DMA_CHANNEL_IRAM 30 ++#define MXC_DMA_CHANNEL_UART1_RX MXC_DMA_DYNAMIC_CHANNEL ++#define MXC_DMA_CHANNEL_UART1_TX MXC_DMA_DYNAMIC_CHANNEL ++#define MXC_DMA_CHANNEL_UART2_RX MXC_DMA_DYNAMIC_CHANNEL ++#define MXC_DMA_CHANNEL_UART2_TX MXC_DMA_DYNAMIC_CHANNEL ++#define MXC_DMA_CHANNEL_UART3_RX MXC_DMA_DYNAMIC_CHANNEL ++#define MXC_DMA_CHANNEL_UART3_TX MXC_DMA_DYNAMIC_CHANNEL ++#define MXC_DMA_CHANNEL_UART4_RX MXC_DMA_DYNAMIC_CHANNEL ++#define MXC_DMA_CHANNEL_UART4_TX MXC_DMA_DYNAMIC_CHANNEL ++#define MXC_DMA_CHANNEL_UART5_RX MXC_DMA_DYNAMIC_CHANNEL ++#define MXC_DMA_CHANNEL_UART5_TX MXC_DMA_DYNAMIC_CHANNEL ++#define MXC_DMA_CHANNEL_MMC1 MXC_DMA_DYNAMIC_CHANNEL ++#define MXC_DMA_CHANNEL_SSI1_RX MXC_DMA_DYNAMIC_CHANNEL ++#ifdef CONFIG_SDMA_IRAM ++#define MXC_DMA_CHANNEL_SSI1_TX (MXC_DMA_CHANNEL_IRAM + 1) ++#else ++#define MXC_DMA_CHANNEL_SSI1_TX MXC_DMA_DYNAMIC_CHANNEL ++#endif ++#define MXC_DMA_CHANNEL_SSI2_RX MXC_DMA_DYNAMIC_CHANNEL ++#define MXC_DMA_CHANNEL_SSI2_TX MXC_DMA_DYNAMIC_CHANNEL ++#define MXC_DMA_CHANNEL_CSPI1_RX MXC_DMA_DYNAMIC_CHANNEL ++#define MXC_DMA_CHANNEL_CSPI1_TX MXC_DMA_DYNAMIC_CHANNEL ++#define MXC_DMA_CHANNEL_CSPI2_RX MXC_DMA_DYNAMIC_CHANNEL ++#define MXC_DMA_CHANNEL_CSPI2_TX MXC_DMA_DYNAMIC_CHANNEL ++#define MXC_DMA_CHANNEL_CSPI3_RX MXC_DMA_DYNAMIC_CHANNEL ++#define MXC_DMA_CHANNEL_CSPI3_TX MXC_DMA_DYNAMIC_CHANNEL ++#define MXC_DMA_CHANNEL_ATA_RX MXC_DMA_DYNAMIC_CHANNEL ++#define MXC_DMA_CHANNEL_ATA_TX MXC_DMA_DYNAMIC_CHANNEL ++#define MXC_DMA_CHANNEL_MEMORY MXC_DMA_DYNAMIC_CHANNEL ++#define MXC_DMA_CHANNEL_ESAI_RX MXC_DMA_DYNAMIC_CHANNEL ++#define MXC_DMA_CHANNEL_ESAI_TX MXC_DMA_DYNAMIC_CHANNEL ++ ++/* ++ * AIPS 2 ++ */ ++#define AIPS2_BASE_ADDR UL(0x53F00000) ++#define AIPS2_BASE_ADDR_VIRT VA(0xFC200000) ++#define AIPS2_SIZE SZ_1M ++ ++#define CCM_BASE_ADDR (AIPS2_BASE_ADDR + 0x00080000) ++#define GPT4_BASE_ADDR (AIPS2_BASE_ADDR + 0x00084000) ++#define GPT3_BASE_ADDR (AIPS2_BASE_ADDR + 0x00088000) ++#define GPT2_BASE_ADDR (AIPS2_BASE_ADDR + 0x0008C000) ++#define GPT1_BASE_ADDR (AIPS2_BASE_ADDR + 0x00090000) ++#define EPIT1_BASE_ADDR (AIPS2_BASE_ADDR + 0x00094000) ++#define EPIT2_BASE_ADDR (AIPS2_BASE_ADDR + 0x00098000) ++#define GPIO4_BASE_ADDR (AIPS2_BASE_ADDR + 0x0009C000) ++#define PWM2_BASE_ADDR (AIPS2_BASE_ADDR + 0x000A0000) ++#define GPIO3_BASE_ADDR (AIPS2_BASE_ADDR + 0x000A4000) ++#define PWM3_BASE_ADDR (AIPS2_BASE_ADDR + 0x000A8000) ++#define SCC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000AC000) ++#define RNGD_BASE_ADDR (AIPS2_BASE_ADDR + 0x000B0000) ++#define MMC_SDHC1_BASE_ADDR (AIPS2_BASE_ADDR + 0x000B4000) ++#define MMC_SDHC2_BASE_ADDR (AIPS2_BASE_ADDR + 0x000B8000) ++#define LCDC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000BC000) ++#define SLCDC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000C0000) ++#define PWM4_BASE_ADDR (AIPS2_BASE_ADDR + 0x000C8000) ++#define GPIO1_BASE_ADDR (AIPS2_BASE_ADDR + 0x000CC000) ++#define GPIO2_BASE_ADDR (AIPS2_BASE_ADDR + 0x000D0000) ++#define SDMA_BASE_ADDR (AIPS2_BASE_ADDR + 0x000D4000) ++#define WDOG_BASE_ADDR (AIPS2_BASE_ADDR + 0x000DC000) ++#define PWM1_BASE_ADDR (AIPS2_BASE_ADDR + 0x000E0000) ++#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 CSI_BASE_ADDR (AIPS2_BASE_ADDR + 0x000F8000) ++#define DRYICE_BASE_ADDR (AIPS2_BASE_ADDR + 0x000FC000) ++ ++/* ++ * ROMP and ASIC ++ */ ++#define ROMP_BASE_ADDR UL(0x60000000) ++#define ROMP_BASE_ADDR_VIRT VA(0xFC300000) ++#define ROMP_SIZE SZ_1M ++ ++#define ASIC_BASE_ADDR UL(0x68000000) ++#define ASIC_BASE_ADDR_VIRT VA(0xFC400000) ++#define ASIC_SIZE SZ_1M ++#define AVIC_BASE_ADDR ASIC_BASE_ADDR ++#define AVIC_BASE_ADDR_VIRT ASIC_BASE_ADDR_VIRT ++#define AVIC_SIZE ASIC_SIZE ++ ++/* ++ * SDRAM, WEIM, M3IF, EMI controllers ++ */ ++#define X_MEMC_BASE_ADDR UL(0xB8000000) ++#define X_MEMC_BASE_ADDR_VIRT VA(0xFC520000) ++#define X_MEMC_SIZE SZ_64K ++ ++#define SDRAMC_BASE_ADDR (X_MEMC_BASE_ADDR + 0x1000) ++#define WEIM_BASE_ADDR (X_MEMC_BASE_ADDR + 0x2000) ++#define M3IF_BASE_ADDR (X_MEMC_BASE_ADDR + 0x3000) ++#define EMI_CTL_BASE_ADDR (X_MEMC_BASE_ADDR + 0x4000) ++ ++/* ++ * NFC controller ++ */ ++#define NFC_BASE_ADDR UL(0xBB000000) ++#define NFC_BASE_ADDR_VIRT VA(0xFC530000) ++#define NFC_SIZE SZ_8K ++ ++/* ++ * Memory regions and CS ++ */ ++#define CSD0_BASE_ADDR UL(0x80000000) ++#define CSD1_BASE_ADDR UL(0x90000000) ++ ++#define SDRAM_BASE_ADDR CSD0_BASE_ADDR ++ ++#define CS0_BASE_ADDR UL(0xA0000000) ++#define CS1_BASE_ADDR UL(0xA8000000) ++#define CS2_BASE_ADDR UL(0xB0000000) ++#define CS3_BASE_ADDR UL(0xB2000000) ++#define CS4_BASE_ADDR UL(0xB4000000) ++#define CS4_SIZE SZ_32M ++#define CS5_BASE_ADDR UL(0xB6000000) ++#define CS5_SIZE SZ_32M ++ ++/*! ++ * 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 ++ * and returning the virtual address. If the physical address is not mapped, ++ * it returns 0 ++ */ ++#define IO_ADDRESS(x) \ ++ VA((((x) >= AIPS1_BASE_ADDR) && ((x) < (AIPS1_BASE_ADDR + AIPS1_SIZE))) ? AIPS1_IO_ADDRESS(x): \ ++ (((x) >= SPBA0_BASE_ADDR) && ((x) < (SPBA0_BASE_ADDR + SPBA0_SIZE))) ? SPBA0_IO_ADDRESS(x): \ ++ (((x) >= AIPS2_BASE_ADDR) && ((x) < (AIPS2_BASE_ADDR + AIPS2_SIZE))) ? AIPS2_IO_ADDRESS(x): \ ++ (((x) >= ROMP_BASE_ADDR) && ((x) < (ROMP_BASE_ADDR + ROMP_SIZE))) ? ROMP_IO_ADDRESS(x): \ ++ (((x) >= ASIC_BASE_ADDR) && ((x) < (ASIC_BASE_ADDR + AVIC_SIZE))) ? ASIC_IO_ADDRESS(x): \ ++ (((x) >= IRAM_BASE_ADDR) && ((x) < (IRAM_BASE_ADDR + IRAM_SIZE))) ? IRAM_IO_ADDRESS(x): \ ++ (((x) >= X_MEMC_BASE_ADDR) && ((x) < (X_MEMC_BASE_ADDR + X_MEMC_SIZE))) ? X_MEMC_IO_ADDRESS(x): \ ++ (((x) >= NFC_BASE_ADDR) && ((x) < (NFC_BASE_ADDR + NFC_SIZE))) ? NFC_IO_ADDRESS(x): \ ++ 0) ++ ++#define MXC_VADDR_RANGE(v,n) \ ++ (((v)) >= n##_BASE_ADDR_VIRT) && \ ++ (((v)) < n##_BASE_ADDR_VIRT + n##_SIZE) ? \ ++ ((v)-n##_BASE_ADDR_VIRT + n##_BASE_ADDR) : ++ ++#define MXC_PHYS_ADDRESS(v) \ ++ UL(MXC_VADDR_RANGE(v,AIPS1) \ ++ MXC_VADDR_RANGE(v,AIPS2) \ ++ MXC_VADDR_RANGE(v,SPBA0) \ ++ MXC_VADDR_RANGE(v,ROMP) \ ++ MXC_VADDR_RANGE(v,ASIC) \ ++ MXC_VADDR_RANGE(v,IRAM) \ ++ MXC_VADDR_RANGE(v,X_MEMC) \ ++ MXC_VADDR_RANGE(v,NFC) \ ++ 0) ++ ++#define GPIO_BASE_ADDR(port) \ ++ ((port == 1 ? GPIO1_BASE_ADDR : \ ++ (port == 2 ? GPIO2_BASE_ADDR : \ ++ (port == 3 ? GPIO3_BASE_ADDR : \ ++ (port == 4 ? GPIO4_BASE_ADDR : 0))))) ++ ++/* ++ * define the address mapping macros: in physical address order ++ */ ++ ++#define AIPS1_IO_ADDRESS(x) \ ++ (((x) - AIPS1_BASE_ADDR) + AIPS1_BASE_ADDR_VIRT) ++ ++#define SPBA0_IO_ADDRESS(x) \ ++ (((x) - SPBA0_BASE_ADDR) + SPBA0_BASE_ADDR_VIRT) ++ ++#define AIPS2_IO_ADDRESS(x) \ ++ (((x) - AIPS2_BASE_ADDR) + AIPS2_BASE_ADDR_VIRT) ++ ++#define ROMP_IO_ADDRESS(x) \ ++ (((x) - ROMP_BASE_ADDR) + ROMP_BASE_ADDR_VIRT) ++ ++#define ASIC_IO_ADDRESS(x) \ ++ (((x) - ASIC_BASE_ADDR) + ASIC_BASE_ADDR_VIRT) ++ ++/* for entry-macro.S */ ++#define AVIC_IO_ADDRESS(x) ASIC_IO_ADDRESS(x) ++ ++#define IRAM_IO_ADDRESS(x) \ ++ (((x) - IRAM_BASE_ADDR) + IRAM_BASE_ADDR_VIRT) ++ ++#define X_MEMC_IO_ADDRESS(x) \ ++ (((x) - X_MEMC_BASE_ADDR) + X_MEMC_BASE_ADDR_VIRT) ++ ++#define NFC_IO_ADDRESS(x) \ ++ (((x) - NFC_BASE_ADDR) + NFC_BASE_ADDR_VIRT) ++ ++/* ++ * DMA request assignments ++ */ ++#define DMA_REQ_EXTREQ0 0 ++#define DMA_REQ_CCM 1 ++#define DMA_REQ_ATA_TX_END 2 ++#define DMA_REQ_ATA_TX 3 ++#define DMA_REQ_ATA_RX 4 ++#define DMA_REQ_CSPI2_RX 6 ++#define DMA_REQ_CSPI2_TX 7 ++#define DMA_REQ_CSPI1_RX 8 ++#define DMA_REQ_CSPI1_TX 9 ++#define DMA_REQ_UART3_RX 10 ++#define DMA_REQ_UART3_TX 11 ++#define DMA_REQ_UART4_RX 12 ++#define DMA_REQ_UART4_TX 13 ++#define DMA_REQ_EXTREQ1 14 ++#define DMA_REQ_EXTREQ2 15 ++#define DMA_REQ_UART2_RX 16 ++#define DMA_REQ_UART2_TX 17 ++#define DMA_REQ_UART1_RX 18 ++#define DMA_REQ_UART1_TX 19 ++#define DMA_REQ_SSI2_RX1 22 ++#define DMA_REQ_SSI2_TX1 23 ++#define DMA_REQ_SSI2_RX0 24 ++#define DMA_REQ_SSI2_TX0 25 ++#define DMA_REQ_SSI1_RX1 26 ++#define DMA_REQ_SSI1_TX1 27 ++#define DMA_REQ_SSI1_RX0 28 ++#define DMA_REQ_SSI1_TX0 29 ++#define DMA_REQ_NFC 30 ++#define DMA_REQ_ECT 31 ++#define DMA_REQ_ESAI_RX 32 ++#define DMA_REQ_ESAI_TX 33 ++#define DMA_REQ_CSPI3_RX 34 ++#define DMA_REQ_CSPI3_TX 35 ++#define DMA_REQ_SIM2_RX 36 ++#define DMA_REQ_SIM2_TX 37 ++#define DMA_REQ_SIM1_RX 38 ++#define DMA_REQ_SIM1_TX 39 ++#define DMA_REQ_TSC_GCQ 44 ++#define DMA_REQ_TSC_TCQ 45 ++#define DMA_REQ_UART5_RX 46 ++#define DMA_REQ_UART5_TX 47 ++ ++/* ++ * Interrupt numbers ++ */ ++#define MXC_INT_CSPI3 0 ++#define MXC_INT_GPT4 1 ++#define MXC_INT_OWIRE 2 ++#define MXC_INT_I2C 3 ++#define MXC_INT_I2C2 4 ++#define MXC_INT_UART4 5 ++#define MXC_INT_RTIC 6 ++#define MXC_INT_ESAI 7 ++#define MXC_INT_SDHC2 8 ++#define MXC_INT_SDHC1 9 ++#define MXC_INT_I2C3 10 ++#define MXC_INT_SSI2 11 ++#define MXC_INT_SSI1 12 ++#define MXC_INT_CSPI2 13 ++#define MXC_INT_CSPI1 14 ++#define MXC_INT_ATA 15 ++#define MXC_INT_GPIO3 16 ++#define MXC_INT_CSI 17 ++#define MXC_INT_UART3 18 ++#define MXC_INT_IIM 19 ++#define MXC_INT_SIM1 20 ++#define MXC_INT_SIM2 21 ++#define MXC_INT_RNGD 22 ++#define MXC_INT_GPIO4 23 ++#define MXC_INT_KPP 24 ++#define MXC_INT_DRYICE_RTC 25 ++#define MXC_INT_PWM 26 ++#define MXC_INT_EPIT2 27 ++#define MXC_INT_EPIT1 28 ++#define MXC_INT_GPT3 29 ++#define MXC_INT_POWER_FAIL 30 ++#define MXC_INT_CRM 31 ++#define MXC_INT_UART2 32 ++#define MXC_INT_NANDFC 33 ++#define MXC_INT_SDMA 34 ++#define MXC_INT_USB_HTG 35 ++#define MXC_INT_PWM2 36 ++#define MXC_INT_USB_OTG 37 ++#define MXC_INT_SLCDC 38 ++#define MXC_INT_LCDC 39 ++#define MXC_INT_UART5 40 ++#define MXC_INT_PWM3 41 ++#define MXC_INT_PWM4 42 ++#define MXC_INT_CAN1 43 ++#define MXC_INT_CAN2 44 ++#define MXC_INT_UART1 45 ++#define MXC_INT_TSC 46 ++#define MXC_INT_ECT 48 ++#define MXC_INT_SCC_SCM 49 ++#define MXC_INT_SCC_SMN 50 ++#define MXC_INT_GPIO2 51 ++#define MXC_INT_GPIO1 52 ++#define MXC_INT_GPT2 53 ++#define MXC_INT_GPT1 54 ++#define MXC_INT_WDOG 55 ++#define MXC_INT_DRYICE 56 ++#define MXC_INT_FEC 57 ++#define MXC_INT_EXT_INT5 58 ++#define MXC_INT_EXT_INT4 59 ++#define MXC_INT_EXT_INT3 60 ++#define MXC_INT_EXT_INT2 61 ++#define MXC_INT_EXT_INT1 62 ++#define MXC_INT_EXT_INT0 63 ++ ++#define MXC_INT_GPT MXC_INT_GPT1 ++ ++/* silicon revisions specific to i.MX25 */ ++#define CHIP_REV_1_0 0x00 ++#define CHIP_REV_1_1 0x01 ++ ++/* gpio and gpio based interrupt handling */ ++#define GPIO_DR 0x00 ++#define GPIO_GDIR 0x04 ++#define GPIO_PSR 0x08 ++#define GPIO_ICR1 0x0C ++#define GPIO_ICR2 0x10 ++#define GPIO_IMR 0x14 ++#define GPIO_ISR 0x18 ++#define GPIO_INT_LOW_LEV 0x0 ++#define GPIO_INT_HIGH_LEV 0x1 ++#define GPIO_INT_RISE_EDGE 0x2 ++#define GPIO_INT_FALL_EDGE 0x3 ++#define GPIO_INT_NONE 0x4 ++ ++/* Mandatory defines used globally */ ++ ++/* this CPU supports up to 96 GPIOs */ ++#define ARCH_NR_GPIOS 128 ++ ++#define MXC_TIMER_GPT1 1 ++#define MXC_TIMER_GPT2 2 ++#define MXC_TIMER_GPT3 3 ++#define MXC_TIMER_GPT4 4 ++ ++/*! ++ * NFMS bit in RCSR register for pagesize of nandflash ++ */ ++#define NFMS_REG IO_ADDRESS(CCM_BASE_ADDR + 0x28) ++#define NFMS_NF_DWIDTH 14 ++#define NFMS_NF_PG_SZ 8 ++ ++#if !defined(__ASSEMBLY__) && !defined(__MXC_BOOT_UNCOMPRESS) ++#include ++ ++extern int mx25_revision(void); ++ ++#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 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 + * and returning the virtual address. If the physical address is not mapped, +- * it returns 0xDEADBEEF ++ * it returns 0 + */ + #define IO_ADDRESS(x) \ + (void __force __iomem *) \ +@@ -88,7 +88,7 @@ + ((x >= SAHB1_BASE_ADDR) && (x < (SAHB1_BASE_ADDR + SAHB1_SIZE))) ? \ + SAHB1_IO_ADDRESS(x) : \ + ((x >= X_MEMC_BASE_ADDR) && (x < (X_MEMC_BASE_ADDR + X_MEMC_SIZE))) ? \ +- X_MEMC_IO_ADDRESS(x) : 0xDEADBEEF) ++ X_MEMC_IO_ADDRESS(x) : 0) + + /* 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 18:02:12.000000000 +0200 +@@ -27,6 +27,7 @@ + #define MXC_CPU_MX1 1 + #define MXC_CPU_MX21 21 + #define MXC_CPU_MX27 27 ++#define MXC_CPU_MX25 25 + #define MXC_CPU_MX31 31 + #define MXC_CPU_MX35 35 + +@@ -70,6 +71,18 @@ extern unsigned int __mxc_cpu_type; + # define cpu_is_mx27() (0) + #endif + ++#ifdef CONFIG_MACH_MX25 ++# ifdef mxc_cpu_type ++# undef mxc_cpu_type ++# define mxc_cpu_type __mxc_cpu_type ++# else ++# define mxc_cpu_type MXC_CPU_MX25 ++# endif ++# define cpu_is_mx25() (mxc_cpu_type == MXC_CPU_MX25) ++#else ++# define cpu_is_mx25() (0) ++#endif ++ + #ifdef CONFIG_ARCH_MX31 + # ifdef mxc_cpu_type + # undef mxc_cpu_type +@@ -101,6 +114,6 @@ extern unsigned int __mxc_cpu_type; + #endif + + #define cpu_is_mx3() (cpu_is_mx31() || cpu_is_mx35()) +-#define cpu_is_mx2() (cpu_is_mx21() || cpu_is_mx27()) ++#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 18:02:13.000000000 +0200 +@@ -0,0 +1,504 @@ ++ ++/* ++ * Copyright 2004-2008 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_SDMA_H__ ++#define __ASM_ARCH_MXC_SDMA_H__ ++ ++/*! ++ * @defgroup SDMA Smart Direct Memory Access (SDMA) Driver ++ */ ++ ++/*! ++ * @file arch-mxc/sdma.h ++ * ++ * @brief This file contains the SDMA API declarations. ++ * ++ * SDMA is responsible on moving data between peripherals and memories (MCU, EMI and DSP). ++ * ++ * @ingroup SDMA ++ */ ++ ++#include ++#include ++#include ++#include ++ ++/*! ++ * This defines maximum DMA address ++ */ ++#define MAX_DMA_ADDRESS 0xffffffff ++ ++/*! ++ * This defines maximum number of DMA channels ++ */ ++#ifdef CONFIG_MXC_SDMA_API ++#define MAX_DMA_CHANNELS 32 ++#define MAX_BD_NUMBER 16 ++#define MXC_SDMA_DEFAULT_PRIORITY 1 ++#define MXC_SDMA_MIN_PRIORITY 1 ++#define MXC_SDMA_MAX_PRIORITY 7 ++#else ++#define MAX_DMA_CHANNELS 0 ++#endif ++ ++#define MXC_FIFO_MEM_DEST_FIXED 0x1 ++#define MXC_FIFO_MEM_SRC_FIXED 0x2 ++/*! ++ * This enumerates transfer types ++ */ ++typedef enum { ++ emi_2_per = 0, /*!< EMI memory to peripheral */ ++ emi_2_int, /*!< EMI memory to internal RAM */ ++ emi_2_emi, /*!< EMI memory to EMI memory */ ++ emi_2_dsp, /*!< EMI memory to DSP memory */ ++ per_2_int, /*!< Peripheral to internal RAM */ ++ per_2_emi, /*!< Peripheral to internal EMI memory */ ++ per_2_dsp, /*!< Peripheral to DSP memory */ ++ per_2_per, /*!< Peripheral to Peripheral */ ++ int_2_per, /*!< Internal RAM to peripheral */ ++ int_2_int, /*!< Internal RAM to Internal RAM */ ++ int_2_emi, /*!< Internal RAM to EMI memory */ ++ int_2_dsp, /*!< Internal RAM to DSP memory */ ++ dsp_2_per, /*!< DSP memory to peripheral */ ++ dsp_2_int, /*!< DSP memory to internal RAM */ ++ dsp_2_emi, /*!< DSP memory to EMI memory */ ++ dsp_2_dsp, /*!< DSP memory to DSP memory */ ++ emi_2_dsp_loop, /*!< EMI memory to DSP memory loopback */ ++ dsp_2_emi_loop, /*!< DSP memory to EMI memory loopback */ ++ dvfs_pll, /*!< DVFS script with PLL change */ ++ dvfs_pdr /*!< DVFS script without PLL change */ ++} sdma_transferT; ++ ++/*! ++ * This enumerates peripheral types ++ */ ++typedef enum { ++ SSI, /*!< MCU domain SSI */ ++ SSI_SP, /*!< Shared SSI */ ++ MMC, /*!< MMC */ ++ SDHC, /*!< SDHC */ ++ UART, /*!< MCU domain UART */ ++ UART_SP, /*!< Shared UART */ ++ FIRI, /*!< FIRI */ ++ CSPI, /*!< MCU domain CSPI */ ++ CSPI_SP, /*!< Shared CSPI */ ++ SIM, /*!< SIM */ ++ ATA, /*!< ATA */ ++ CCM, /*!< CCM */ ++ EXT, /*!< External peripheral */ ++ MSHC, /*!< Memory Stick Host Controller */ ++ MSHC_SP, /*!< Shared Memory Stick Host Controller */ ++ DSP, /*!< DSP */ ++ MEMORY, /*!< Memory */ ++ FIFO_MEMORY, /*!< FIFO type Memory */ ++ SPDIF, /*!< SPDIF */ ++ IPU_MEMORY, /*!< IPU Memory */ ++ ASRC, /*!< ASRC */ ++ ESAI, /*!< ESAI */ ++} sdma_periphT; ++ ++#ifndef TRANSFER_32BIT ++/*! ++ * This defines SDMA access data size ++ */ ++#define TRANSFER_32BIT 0x00 ++#define TRANSFER_8BIT 0x01 ++#define TRANSFER_16BIT 0x02 ++#define TRANSFER_24BIT 0x03 ++ ++#endif ++ ++/*! ++ * This defines maximum device name length passed during mxc_request_dma(). ++ */ ++#define MAX_DEVNAME_LENGTH 32 ++ ++/*! ++ * This defines SDMA interrupt callback function prototype. ++ */ ++typedef void (*dma_callback_t) (void *arg); ++ ++/*! ++ * Structure containing sdma channel parameters. ++ */ ++typedef struct { ++ __u32 watermark_level; /*!< Lower/upper threshold that ++ * triggers SDMA event ++ */ ++ __u32 per_address; /*!< Peripheral source/destination ++ * physical address ++ */ ++ sdma_periphT peripheral_type; /*!< Peripheral type */ ++ sdma_transferT transfer_type; /*!< Transfer type */ ++ int event_id; /*!< Event number, ++ * needed by all channels ++ * that started by peripherals dma ++ * request (per_2_*,*_2_per) ++ * Not used for memory and DSP ++ * transfers. ++ */ ++ int event_id2; /*!< Second event number, ++ * used in ATA scripts only. ++ */ ++ int bd_number; /*!< Buffer descriptors number. ++ * If not set, single buffer ++ * descriptor will be used. ++ */ ++ dma_callback_t callback; /*! callback function */ ++ void *arg; /*! callback argument */ ++ unsigned long word_size:8; /*!< SDMA data access word size */ ++} dma_channel_params; ++ ++/*! ++ * Structure containing sdma request parameters. ++ */ ++typedef struct { ++ /*! physical source memory address */ ++ __u8 *sourceAddr; ++ /*! physical destination memory address */ ++ __u8 *destAddr; ++ /*! amount of data to transfer, ++ * updated during mxc_dma_get_config ++ */ ++ __u16 count; ++ /*!< DONE bit of the buffer descriptor, ++ * updated during mxc_dma_get_config ++ * 0 - means the BD is done and closed by SDMA ++ * 1 - means the BD is still being processed by SDMA ++ */ ++ int bd_done; ++ /*!< CONT bit of the buffer descriptor, ++ * set it if full multi-buffer descriptor mechanism ++ * required. ++ */ ++ int bd_cont; ++ /*!< ERROR bit of the buffer descriptor, ++ * updated during mxc_dma_get_config. ++ * If it is set - there was an error during BD processing. ++ */ ++ int bd_error; ++} dma_request_t; ++ ++/*! ++ * Structure containing sdma request parameters. ++ */ ++typedef struct { ++ /*! address of ap_2_ap script */ ++ int mxc_sdma_ap_2_ap_addr; ++ /*! address of ap_2_bp script */ ++ int mxc_sdma_ap_2_bp_addr; ++ /*! address of ap_2_ap_fixed script */ ++ int mxc_sdma_ap_2_ap_fixed_addr; ++ /*! address of bp_2_ap script */ ++ int mxc_sdma_bp_2_ap_addr; ++ /*! address of loopback_on_dsp_side script */ ++ int mxc_sdma_loopback_on_dsp_side_addr; ++ /*! address of mcu_interrupt_only script */ ++ int mxc_sdma_mcu_interrupt_only_addr; ++ ++ /*! address of firi_2_per script */ ++ int mxc_sdma_firi_2_per_addr; ++ /*! address of firi_2_mcu script */ ++ int mxc_sdma_firi_2_mcu_addr; ++ /*! address of per_2_firi script */ ++ int mxc_sdma_per_2_firi_addr; ++ /*! address of mcu_2_firi script */ ++ int mxc_sdma_mcu_2_firi_addr; ++ ++ /*! address of uart_2_per script */ ++ int mxc_sdma_uart_2_per_addr; ++ /*! address of uart_2_mcu script */ ++ int mxc_sdma_uart_2_mcu_addr; ++ /*! address of per_2_app script */ ++ int mxc_sdma_per_2_app_addr; ++ /*! address of mcu_2_app script */ ++ int mxc_sdma_mcu_2_app_addr; ++ /*! address of per_2_per script */ ++ int mxc_sdma_per_2_per_addr; ++ ++ /*! address of uartsh_2_per script */ ++ int mxc_sdma_uartsh_2_per_addr; ++ /*! address of uartsh_2_mcu script */ ++ int mxc_sdma_uartsh_2_mcu_addr; ++ /*! address of per_2_shp script */ ++ int mxc_sdma_per_2_shp_addr; ++ /*! address of mcu_2_shp script */ ++ int mxc_sdma_mcu_2_shp_addr; ++ ++ /*! address of ata_2_mcu script */ ++ int mxc_sdma_ata_2_mcu_addr; ++ /*! address of mcu_2_ata script */ ++ int mxc_sdma_mcu_2_ata_addr; ++ ++ /*! address of app_2_per script */ ++ int mxc_sdma_app_2_per_addr; ++ /*! address of app_2_mcu script */ ++ int mxc_sdma_app_2_mcu_addr; ++ /*! address of shp_2_per script */ ++ int mxc_sdma_shp_2_per_addr; ++ /*! address of shp_2_mcu script */ ++ int mxc_sdma_shp_2_mcu_addr; ++ ++ /*! address of mshc_2_mcu script */ ++ int mxc_sdma_mshc_2_mcu_addr; ++ /*! address of mcu_2_mshc script */ ++ int mxc_sdma_mcu_2_mshc_addr; ++ ++ /*! address of spdif_2_mcu script */ ++ int mxc_sdma_spdif_2_mcu_addr; ++ /*! address of mcu_2_spdif script */ ++ int mxc_sdma_mcu_2_spdif_addr; ++ ++ /*! address of asrc_2_mcu script */ ++ int mxc_sdma_asrc_2_mcu_addr; ++ ++ /*! address of ext_mem_2_ipu script */ ++ int mxc_sdma_ext_mem_2_ipu_addr; ++ ++ /*! address of descrambler script */ ++ int mxc_sdma_descrambler_addr; ++ ++ /*! address of dptc_dvfs script */ ++ int mxc_sdma_dptc_dvfs_addr; ++ ++ int mxc_sdma_utra_addr; ++ ++ /*! address where ram code starts */ ++ int mxc_sdma_ram_code_start_addr; ++ /*! size of the ram code */ ++ int mxc_sdma_ram_code_size; ++ /*! RAM image address */ ++ unsigned short *mxc_sdma_start_addr; ++} sdma_script_start_addrs; ++ ++/*! Structure to store the initialized dma_channel parameters */ ++typedef struct mxc_sdma_channel_params { ++ /*! Channel params */ ++ dma_channel_params chnl_params; ++ /*! Channel type (static channel number or dynamic channel) */ ++ unsigned int channel_num; ++ /*! Channel priority [0x1(lowest) - 0x7(highest)] */ ++ unsigned int chnl_priority; ++} mxc_sdma_channel_params_t; ++ ++/*! Private SDMA data structure */ ++typedef struct mxc_dma_channel_private { ++ /*! ID of the buffer that was processed */ ++ unsigned int buf_tail; ++ /*! Tasklet for the channel */ ++ struct tasklet_struct chnl_tasklet; ++ /*! Flag indicates if interrupt is required after every BD transfer */ ++ int intr_after_every_bd; ++} mxc_dma_channel_private_t; ++ ++/*! ++ * Setup channel according to parameters. ++ * Must be called once after mxc_request_dma() ++ * ++ * @param channel channel number ++ * @param p channel parameters pointer ++ * @return 0 on success, error code on fail ++ */ ++int mxc_dma_setup_channel(int channel, dma_channel_params * p); ++ ++/*! ++ * Setup the channel priority. This can be used to change the default priority ++ * for the channel. ++ * ++ * @param channel channel number ++ * @param priority priority to be set for the channel ++ * ++ * @return 0 on success, error code on failure ++ */ ++int mxc_dma_set_channel_priority(unsigned int channel, unsigned int priority); ++ ++/*! ++ * Allocates dma channel. ++ * If channel's value is 0, then the function allocates a free channel ++ * dynamically and sets its value to channel. ++ * Else allocates requested channel if it is free. ++ * If the channel is busy or no free channels (in dynamic allocation) -EBUSY returned. ++ * ++ * @param channel pointer to channel number ++ * @param devicename device name ++ * @return 0 on success, error code on fail ++ */ ++int mxc_request_dma(int *channel, const char *devicename); ++ ++/*! ++ * Configures request parameters. Can be called multiple times after ++ * mxc_request_dma() and mxc_dma_setup_channel(). ++ * ++ * ++ * @param channel channel number ++ * @param p request parameters pointer ++ * @param bd_index index of buffer descriptor to set ++ * @return 0 on success, error code on fail ++ */ ++/* int mxc_dma_set_config(int channel, dma_request_t *p, int bd_index); */ ++int mxc_dma_set_config(int channel, dma_request_t * p, int bd_index); ++ ++/*! ++ * Returns request parameters. ++ * ++ * @param channel channel number ++ * @param p request parameters pointer ++ * @param bd_index index of buffer descriptor to get ++ * @return 0 on success, error code on fail ++ */ ++/* int mxc_dma_get_config(int channel, dma_request_t *p, int bd_index); */ ++int mxc_dma_get_config(int channel, dma_request_t * p, int bd_index); ++ ++/*! ++ * This function is used by MXC IPC's write_ex2. It passes the a pointer to the ++ * data control structure to iapi_write_ipcv2() ++ * ++ * @param channel SDMA channel number ++ * @param ctrl_ptr Data Control structure pointer ++ */ ++int mxc_sdma_write_ipcv2(int channel, void *ctrl_ptr); ++ ++/*! ++ * This function is used by MXC IPC's read_ex2. It passes the a pointer to the ++ * data control structure to iapi_read_ipcv2() ++ * ++ * @param channel SDMA channel number ++ * @param ctrl_ptr Data Control structure pointer ++ */ ++int mxc_sdma_read_ipcv2(int channel, void *ctrl_ptr); ++ ++/*! ++ * Starts dma channel. ++ * ++ * @param channel channel number ++ */ ++int mxc_dma_start(int channel); ++ ++/*! ++ * Stops dma channel. ++ * ++ * @param channel channel number ++ */ ++int mxc_dma_stop(int channel); ++ ++/*! ++ * Frees dma channel. ++ * ++ * @param channel channel number ++ */ ++void mxc_free_dma(int channel); ++ ++/*! ++ * Sets callback function. Used with standard dma api ++ * for supporting interrupts ++ * ++ * @param channel channel number ++ * @param callback callback function pointer ++ * @param arg argument for callback function ++ */ ++void mxc_dma_set_callback(int channel, dma_callback_t callback, void *arg); ++ ++/*! ++ * Allocates uncachable buffer. Uses hash table. ++ * ++ * @param size size of allocated buffer ++ * @return pointer to buffer ++ */ ++void *sdma_malloc(size_t size); ++ ++#ifdef CONFIG_SDMA_IRAM ++/*! ++ * Allocates uncachable buffer from IRAM.. ++ * ++ * @param size size of allocated buffer ++ * @return pointer to buffer ++ */ ++void *sdma_iram_malloc(size_t size); ++#endif /*CONFIG_SDMA_IRAM */ ++ ++/*! ++ * Frees uncachable buffer. Uses hash table. ++ */ ++void sdma_free(void *buf); ++ ++/*! ++ * Converts virtual to physical address. Uses hash table. ++ * ++ * @param buf virtual address pointer ++ * @return physical address value ++ */ ++unsigned long sdma_virt_to_phys(void *buf); ++ ++/*! ++ * Converts physical to virtual address. Uses hash table. ++ * ++ * @param buf physical address value ++ * @return virtual address pointer ++ */ ++void *sdma_phys_to_virt(unsigned long buf); ++ ++/*! ++ * Configures the BD_INTR bit on a buffer descriptor parameters. ++ * ++ * ++ * @param channel channel number ++ * @param bd_index index of buffer descriptor to set ++ * @param bd_intr flag to set or clear the BD_INTR bit ++ */ ++void mxc_dma_set_bd_intr(int channel, int bd_index, int bd_intr); ++ ++/*! ++ * Gets the BD_INTR bit on a buffer descriptor. ++ * ++ * ++ * @param channel channel number ++ * @param bd_index index of buffer descriptor to set ++ * ++ * @return returns the BD_INTR bit status ++ */ ++int mxc_dma_get_bd_intr(int channel, int bd_index); ++ ++/*! ++ * Stop the current transfer ++ * ++ * @param channel channel number ++ * @param buffer_number number of buffers (beginning with 0), ++ * whose done bits should be reset to 0 ++ */ ++int mxc_dma_reset(int channel, int buffer_number); ++ ++/*! ++ * This functions Returns the SDMA paramaters associated for a module ++ * ++ * @param channel_id the ID of the module requesting DMA ++ * @return returns the sdma parameters structure for the device ++ */ ++mxc_sdma_channel_params_t *mxc_sdma_get_channel_params(mxc_dma_device_t ++ channel_id); ++ ++/*! ++ * This functions marks the SDMA channels that are statically allocated ++ * ++ * @param chnl the channel array used to store channel information ++ */ ++void mxc_get_static_channels(mxc_dma_channel_t * chnl); ++ ++/*! ++ * Initializes SDMA driver ++ */ ++int __init sdma_init(void); ++ ++#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 18:02:13.000000000 +0200 +@@ -0,0 +1,66 @@ ++ ++/* ++ * Copyright 2004-2008 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 ++ */ ++ ++/*! ++ * @defgroup SPBA Shared Peripheral Bus Arbiter (SPBA) ++ * @ingroup MSL_MX31 MSL_MX35 MSL_MX37 MSL_MX51 MSL_MXC91321 ++ */ ++ ++/*! ++ * @file arch-mxc/spba.h ++ * @brief This file contains the Shared Peripheral Bus Arbiter (spba) API. ++ * ++ * @ingroup SPBA ++ */ ++ ++#ifndef __ASM_ARCH_MXC_SPBA_H__ ++#define __ASM_ARCH_MXC_SPBA_H__ ++ ++#ifdef __KERNEL__ ++ ++#define MXC_SPBA_RAR_MASK 0x7 ++ ++/*! ++ * Defines three SPBA masters: A - ARM, C - SDMA (no master B for MX31) ++ */ ++enum spba_masters { ++ SPBA_MASTER_A = 1, ++ SPBA_MASTER_B = 2, ++ SPBA_MASTER_C = 4, ++}; ++ ++/*! ++ * This function allows the three masters (A, B, C) to take ownership of a ++ * shared peripheral. ++ * ++ * @param mod specified module as defined in \b enum \b #spba_module ++ * @param master one of more (or-ed together) masters as defined in \b enum \b #spba_masters ++ * ++ * @return 0 if successful; -1 otherwise. ++ */ ++int spba_take_ownership(int mod, int master); ++ ++/*! ++ * This function releases the ownership for a shared peripheral. ++ * ++ * @param mod specified module as defined in \b enum \b #spba_module ++ * @param master one of more (or-ed together) masters as defined in \b enum \b #spba_masters ++ * ++ * @return 0 if successful; -1 otherwise. ++ */ ++int spba_rel_ownership(int mod, int master); ++ ++#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 18:02:12.000000000 +0200 +@@ -23,7 +23,11 @@ + #if defined CONFIG_ARCH_MX1 + #define CLOCK_TICK_RATE 16000000 + #elif defined CONFIG_ARCH_MX2 ++#ifndef CONFIG_MACH_MX25 + #define CLOCK_TICK_RATE 13300000 ++#else ++#define CLOCK_TICK_RATE 12000000 ++#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 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)); + + if (pin < 16) { ++#ifndef CONFIG_MACH_MX25 + tmp = __raw_readl(VA_GPIO_BASE + MXC_OCR1(port)); + tmp &= ~(3 << (pin * 2)); + tmp |= (ocr << (pin * 2)); + __raw_writel(tmp, VA_GPIO_BASE + MXC_OCR1(port)); +- ++#endif + tmp = __raw_readl(VA_GPIO_BASE + MXC_ICONFA1(port)); + tmp &= ~(3 << (pin * 2)); + tmp |= ((gpio_mode >> GPIO_AOUT_SHIFT) & 3) << (pin * 2); +@@ -90,12 +91,12 @@ void mxc_gpio_mode(int gpio_mode) + __raw_writel(tmp, VA_GPIO_BASE + MXC_ICONFB1(port)); + } else { + pin -= 16; +- ++#ifndef CONFIG_MACH_MX25 + tmp = __raw_readl(VA_GPIO_BASE + MXC_OCR2(port)); + tmp &= ~(3 << (pin * 2)); + tmp |= (ocr << (pin * 2)); + __raw_writel(tmp, VA_GPIO_BASE + MXC_OCR2(port)); +- ++#endif + 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 18:02:02.000000000 +0200 +@@ -31,7 +31,24 @@ + + #define IOMUX_BASE IO_ADDRESS(IOMUXC_BASE_ADDR) + +-static unsigned long iomux_v3_pad_alloc_map[0x200 / BITS_PER_LONG]; ++#ifdef CONFIG_MACH_MX25 ++#define NUM_PADS 0x228 ++#else ++#define NUM_PADS 0x200 ++#endif ++ ++static unsigned long iomux_v3_pad_alloc_map[NUM_PADS / BITS_PER_LONG]; ++ ++static inline int mxc_iomux_v3_pad_offset(struct pad_desc *pad) ++{ ++ int pad_ofs; ++ if (cpu_is_mx25()) ++ pad_ofs = pad->mux_ctrl_ofs; ++ else ++ pad_ofs = pad->pad_ctrl_ofs; ++ BUG_ON((pad_ofs >> 7) >= ARRAY_SIZE(iomux_v3_pad_alloc_map)); ++ return pad_ofs; ++} + + /* + * setups a single pin: +@@ -40,7 +57,7 @@ static unsigned long iomux_v3_pad_alloc_ + */ + int mxc_iomux_v3_setup_pad(struct pad_desc *pad) + { +- unsigned int pad_ofs = pad->pad_ctrl_ofs; ++ unsigned int pad_ofs = mxc_iomux_v3_pad_offset(pad); + + if (test_and_set_bit(pad_ofs >> 2, iomux_v3_pad_alloc_map)) + return -EBUSY; +@@ -65,8 +82,10 @@ int mxc_iomux_v3_setup_multiple_pads(str + + for (i = 0; i < count; i++) { + ret = mxc_iomux_v3_setup_pad(p); +- if (ret) ++ if (ret) { ++ printk(KERN_ERR "Failed to setup PAD[%d]: %d\n", i, ret); + goto setup_error; ++ } + p++; + } + return 0; +@@ -79,7 +98,7 @@ EXPORT_SYMBOL(mxc_iomux_v3_setup_multipl + + void mxc_iomux_v3_release_pad(struct pad_desc *pad) + { +- unsigned int pad_ofs = pad->pad_ctrl_ofs; ++ unsigned int pad_ofs = mxc_iomux_v3_pad_offset(pad); + + 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 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; + +- if (cpu_is_mx27() || cpu_is_mx3()) { ++ if (cpu_is_mx27() || cpu_is_mx3() || cpu_is_mx25()) { + 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 18:02:03.000000000 +0200 +@@ -0,0 +1,143 @@ ++/* ++ * Copyright 2004-2008 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 ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++/*! ++ * @file plat-mxc/spba.c ++ * ++ * @brief This file contains the SPBA API implementation details. ++ * ++ * @ingroup SPBA ++ */ ++ ++static DEFINE_SPINLOCK(spba_lock); ++ ++#define SPBA_MASTER_MIN 1 ++#define SPBA_MASTER_MAX 7 ++ ++/*! ++ * the base addresses for the SPBA modules ++ */ ++static unsigned long spba_base = (unsigned long)IO_ADDRESS(SPBA_CTRL_BASE_ADDR); ++ ++/*! ++ * SPBA clock ++ */ ++static struct clk *spba_clk; ++/*! ++ * This function allows the three masters (A, B, C) to take ownership of a ++ * shared peripheral. ++ * ++ * @param mod specified module as defined in \b enum \b #spba_module ++ * @param master one of more (or-ed together) masters as defined in \b enum \b #spba_masters ++ * ++ * @return 0 if successful; a negative errno value otherwise. ++ */ ++int spba_take_ownership(int mod, int master) ++{ ++ unsigned long spba_flags; ++ int rtn_val = -EIO; ++ ++ if (master < SPBA_MASTER_MIN || master > SPBA_MASTER_MAX) { ++ printk("%s() invalid master %d\n", __FUNCTION__, master); ++ return -EINVAL; ++ } ++ ++ if (spba_clk == NULL) { ++ spba_clk = clk_get(NULL, "spba"); ++ if (IS_ERR(spba_clk)) { ++ int ret = PTR_ERR(spba_clk); ++ ++ spba_clk = NULL; ++ return ret; ++ } ++ } ++ clk_enable(spba_clk); ++ ++ spin_lock_irqsave(&spba_lock, spba_flags); ++ __raw_writel(master, spba_base + mod); ++ ++ if ((__raw_readl(spba_base + mod) & MXC_SPBA_RAR_MASK) == master) { ++ rtn_val = 0; ++ } ++ ++ spin_unlock_irqrestore(&spba_lock, spba_flags); ++ ++ clk_disable(spba_clk); ++ return rtn_val; ++} ++ ++/*! ++ * This function releases the ownership for a shared peripheral. ++ * ++ * @param mod specified module as defined in \b enum \b #spba_module ++ * @param master one of more (or-ed together) masters as defined in \b enum \b #spba_masters ++ * ++ * @return 0 if successful; a negativ errno value otherwise. ++ */ ++int spba_rel_ownership(int mod, int master) ++{ ++ unsigned long spba_flags; ++ volatile unsigned long rar; ++ ++ if (master < SPBA_MASTER_MIN || master > SPBA_MASTER_MAX) { ++ printk("%s() invalid master %d\n", __FUNCTION__, master); ++ return -EINVAL; ++ } ++ ++ if (spba_clk == NULL) { ++ spba_clk = clk_get(NULL, "spba"); ++ if (IS_ERR(spba_clk)) { ++ int ret = PTR_ERR(spba_clk); ++ spba_clk = NULL; ++ return ret; ++ } ++ } ++ clk_enable(spba_clk); ++ ++ if ((__raw_readl(spba_base + mod) & master) == 0) { ++ clk_disable(spba_clk); ++ return -EBUSY; /* does not own it */ ++ } ++ ++ spin_lock_irqsave(&spba_lock, spba_flags); ++ ++ /* Since only the last 3 bits are writeable, doesn't need to mask off ++ bits 31-3 */ ++ rar = __raw_readl(spba_base + mod) & (~master); ++ __raw_writel(rar, spba_base + mod); ++ ++ if ((__raw_readl(spba_base + mod) & master) != 0) { ++ spin_unlock_irqrestore(&spba_lock, spba_flags); ++ clk_disable(spba_clk); ++ return -EIO; ++ } ++ spin_unlock_irqrestore(&spba_lock, spba_flags); ++ ++ clk_disable(spba_clk); ++ return 0; ++} ++ ++EXPORT_SYMBOL(spba_take_ownership); ++EXPORT_SYMBOL(spba_rel_ownership); ++ ++MODULE_AUTHOR("Freescale Semiconductor, Inc."); ++MODULE_DESCRIPTION("SPBA"); ++MODULE_LICENSE("GPL"); +diff -urNp linux-2.6.30-rc4/arch/arm/plat-mxc/system.c linux-2.6.30-rc4-karo/arch/arm/plat-mxc/system.c +--- linux-2.6.30-rc4/arch/arm/plat-mxc/system.c 2009-05-13 09:46:19.000000000 +0200 ++++ linux-2.6.30-rc4-karo/arch/arm/plat-mxc/system.c 2009-06-08 12:48:23.000000000 +0200 +@@ -21,6 +21,7 @@ + */ + + #include ++#include + #include + #include + #include +@@ -38,18 +39,15 @@ + #define WDOG_WCR_ENABLE (1 << 2) + #endif + ++static struct clk *mxc_wdt_clk; ++ + /* + * Reset the system. It is called by machine_restart(). + */ + 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); +- } ++ if (mxc_wdt_clk) ++ clk_enable(mxc_wdt_clk); + + /* Assert SRS signal */ + __raw_writew(WDOG_WCR_ENABLE, WDOG_WCR_REG); +@@ -65,3 +63,20 @@ 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) ++{ ++ if (cpu_is_mx1()) ++ return 0; ++ ++ mxc_wdt_clk = clk_get_sys("imx-wdt.0", NULL); ++ if (IS_ERR(mxc_wdt_clk)) { ++ int ret = PTR_ERR(mxc_wdt_clk); ++ ++ printk(KERN_ERR "%s: Failed to get imx-wdt.0 clk: %d\n", __FUNCTION__, ret); ++ mxc_wdt_clk = NULL; ++ return ret; ++ } ++ return 0; ++} ++arch_initcall(mxc_wdt_init); +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 18:02:02.000000000 +0200 +@@ -66,7 +66,7 @@ static inline void gpt_irq_disable(void) + { + unsigned int tmp; + +- if (cpu_is_mx3()) ++ if (cpu_is_mx3() || cpu_is_mx25()) + __raw_writel(0, timer_base + MX3_IR); + else { + tmp = __raw_readl(timer_base + MXC_TCTL); +@@ -76,7 +76,7 @@ static inline void gpt_irq_disable(void) + + static inline void gpt_irq_enable(void) + { +- if (cpu_is_mx3()) ++ if (cpu_is_mx3() || cpu_is_mx25()) + __raw_writel(1<<0, timer_base + MX3_IR); + else { + __raw_writel(__raw_readl(timer_base + MXC_TCTL) | MX1_2_TCTL_IRQEN, +@@ -88,9 +88,9 @@ static void gpt_irq_acknowledge(void) + { + if (cpu_is_mx1()) + __raw_writel(0, timer_base + MX1_2_TSTAT); +- if (cpu_is_mx2()) ++ if (cpu_is_mx2() && !cpu_is_mx25()) + __raw_writel(MX2_TSTAT_CAPT | MX2_TSTAT_COMP, timer_base + MX1_2_TSTAT); +- if (cpu_is_mx3()) ++ if (cpu_is_mx3() || cpu_is_mx25()) + __raw_writel(MX3_TSTAT_OF1, timer_base + MX3_TSTAT); + } + +@@ -117,7 +117,7 @@ static int __init mxc_clocksource_init(s + { + unsigned int c = clk_get_rate(timer_clk); + +- if (cpu_is_mx3()) ++ if (cpu_is_mx3() || cpu_is_mx25()) + clocksource_mxc.read = mx3_get_cycles; + + clocksource_mxc.mult = clocksource_hz2mult(c, +@@ -180,7 +180,7 @@ static void mxc_set_mode(enum clock_even + + if (mode != clockevent_mode) { + /* Set event time into far-far future */ +- if (cpu_is_mx3()) ++ if (cpu_is_mx3() || cpu_is_mx25()) + __raw_writel(__raw_readl(timer_base + MX3_TCN) - 3, + timer_base + MX3_TCMP); + else +@@ -233,7 +233,7 @@ static irqreturn_t mxc_timer_interrupt(i + struct clock_event_device *evt = &clockevent_mxc; + uint32_t tstat; + +- if (cpu_is_mx3()) ++ if (cpu_is_mx3() || cpu_is_mx25()) + tstat = __raw_readl(timer_base + MX3_TSTAT); + else + tstat = __raw_readl(timer_base + MX1_2_TSTAT); +@@ -264,7 +264,7 @@ static int __init mxc_clockevent_init(st + { + unsigned int c = clk_get_rate(timer_clk); + +- if (cpu_is_mx3()) ++ if (cpu_is_mx3() || cpu_is_mx25()) + 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 + __raw_writel(0, timer_base + MXC_TCTL); + __raw_writel(0, timer_base + MXC_TPRER); /* see datasheet note */ + +- if (cpu_is_mx3()) ++ if (cpu_is_mx3() || cpu_is_mx25()) + 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 18:02:54.000000000 +0200 +@@ -12,7 +12,7 @@ + # + # http://www.arm.linux.org.uk/developer/machines/?action=new + # +-# Last update: Mon Mar 23 20:09:01 2009 ++# Last update: Mon Apr 20 10:31:38 2009 + # + # machine_is_xxx CONFIG_xxxx MACH_TYPE_xxx number + # +@@ -1721,7 +1721,7 @@ sapphire MACH_SAPPHIRE SAPPHIRE 1729 + csb637xo MACH_CSB637XO CSB637XO 1730 + evisiong MACH_EVISIONG EVISIONG 1731 + stmp37xx MACH_STMP37XX STMP37XX 1732 +-stmp378x MACH_STMP38XX STMP38XX 1733 ++stmp378x MACH_STMP378X STMP378X 1733 + tnt MACH_TNT TNT 1734 + tbxt MACH_TBXT TBXT 1735 + playmate MACH_PLAYMATE PLAYMATE 1736 +@@ -2132,3 +2132,41 @@ apollo MACH_APOLLO APOLLO 2141 + at91cap9stk MACH_AT91CAP9STK AT91CAP9STK 2142 + spc300 MACH_SPC300 SPC300 2143 + eko MACH_EKO EKO 2144 ++ccw9m2443 MACH_CCW9M2443 CCW9M2443 2145 ++ccw9m2443js MACH_CCW9M2443JS CCW9M2443JS 2146 ++m2m_router_device MACH_M2M_ROUTER_DEVICE M2M_ROUTER_DEVICE 2147 ++str9104nas MACH_STAR9104NAS STAR9104NAS 2148 ++pca100 MACH_PCA100 PCA100 2149 ++z3_dm365_mod_01 MACH_Z3_DM365_MOD_01 Z3_DM365_MOD_01 2150 ++hipox MACH_HIPOX HIPOX 2151 ++omap3_piteds MACH_OMAP3_PITEDS OMAP3_PITEDS 2152 ++bm150r MACH_BM150R BM150R 2153 ++tbone MACH_TBONE TBONE 2154 ++merlin MACH_MERLIN MERLIN 2155 ++falcon MACH_FALCON FALCON 2156 ++davinci_da850_evm MACH_DAVINCI_DA850_EVM DAVINCI_DA850_EVM 2157 ++s5p6440 MACH_S5P6440 S5P6440 2158 ++at91sam9g10ek MACH_AT91SAM9G10EK AT91SAM9G10EK 2159 ++omap_4430sdp MACH_OMAP_4430SDP OMAP_4430SDP 2160 ++lpc313x MACH_LPC313X LPC313X 2161 ++magx_zn5 MACH_MAGX_ZN5 MAGX_ZN5 2162 ++magx_em30 MACH_MAGX_EM30 MAGX_EM30 2163 ++magx_ve66 MACH_MAGX_VE66 MAGX_VE66 2164 ++meesc MACH_MEESC MEESC 2165 ++otc570 MACH_OTC570 OTC570 2166 ++bcu2412 MACH_BCU2412 BCU2412 2167 ++beacon MACH_BEACON BEACON 2168 ++actia_tgw MACH_ACTIA_TGW ACTIA_TGW 2169 ++e4430 MACH_E4430 E4430 2170 ++ql300 MACH_QL300 QL300 2171 ++btmavb101 MACH_BTMAVB101 BTMAVB101 2172 ++btmawb101 MACH_BTMAWB101 BTMAWB101 2173 ++sq201 MACH_SQ201 SQ201 2174 ++quatro45xx MACH_QUATRO45XX QUATRO45XX 2175 ++openpad MACH_OPENPAD OPENPAD 2176 ++tx25 MACH_TX25 TX25 2177 ++omap3_torpedo MACH_OMAP3_TORPEDO OMAP3_TORPEDO 2178 ++htcraphael_k MACH_HTCRAPHAEL_K HTCRAPHAEL_K 2179 ++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 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", + template->gpio, template->name); +- return 0; ++ return -EINVAL; + } + + 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 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. + ++config MTD_NAND_MXC_FLASH_BBT ++ bool "Support a flash based bad block table" ++ depends on MTD_NAND_MXC ++ ++config ARCH_MXC_HAS_NFC_V1 ++ bool ++ ++config ARCH_MXC_HAS_NFC_V1_1 ++ select ARCH_MXC_HAS_NFC_V1 ++ bool ++ ++config ARCH_MXC_HAS_NFC_V2 ++ bool ++ ++config ARCH_MXC_HAS_NFC_V2_1 ++ bool ++ select ARCH_MXC_HAS_NFC_V2 ++ ++config ARCH_MXC_HAS_NFC_V3 ++ bool ++ + 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/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-08 12:51:07.000000000 +0200 +@@ -34,23 +34,52 @@ + #include + #include + ++#ifdef CONFIG_MTD_DEBUG ++static int debug = 0; ++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(l, fmt...) DBG(l, fmt) ++#else ++static int debug; ++module_param(debug, int, 0); ++ ++#define dbg_lvl(n) 0 ++#define DBG(lvl, fmt...) do { } while (0) ++#endif ++ ++ + #define DRIVER_NAME "mxc_nand" + + /* Addresses for NFC registers */ +-#define NFC_BUF_SIZE 0xE00 +-#define NFC_BUF_ADDR 0xE04 +-#define NFC_FLASH_ADDR 0xE06 +-#define NFC_FLASH_CMD 0xE08 +-#define NFC_CONFIG 0xE0A +-#define NFC_ECC_STATUS_RESULT 0xE0C +-#define NFC_RSLTMAIN_AREA 0xE0E +-#define NFC_RSLTSPARE_AREA 0xE10 +-#define NFC_WRPROT 0xE12 +-#define NFC_UNLOCKSTART_BLKADDR 0xE14 +-#define NFC_UNLOCKEND_BLKADDR 0xE16 +-#define NFC_NF_WRPRST 0xE18 +-#define NFC_CONFIG1 0xE1A +-#define NFC_CONFIG2 0xE1C ++#define NFC_BUF_SIZE 0x000 ++#define NFC_BUF_ADDR 0x004 ++#define NFC_FLASH_ADDR 0x006 ++#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_UNLOCKSTART_BLKADDR 0x014 ++#define NFC_UNLOCKEND_BLKADDR 0x016 ++#endif ++#define NFC_NF_WRPRST 0x018 ++#define NFC_CONFIG1 0x01A ++#define NFC_CONFIG2 0x01C ++#ifdef CONFIG_ARCH_MXC_HAS_NFC_V1_1 ++#define NFC_UNLOCKSTART_BLKADDR 0x020 ++#define NFC_UNLOCKEND_BLKADDR 0x022 ++#define NFC_UNLOCKSTART_BLKADDR1 0x024 ++#define NFC_UNLOCKEND_BLKADDR1 0x026 ++#define NFC_UNLOCKSTART_BLKADDR2 0x028 ++#define NFC_UNLOCKEND_BLKADDR2 0x02a ++#define NFC_UNLOCKSTART_BLKADDR3 0x02c ++#define NFC_UNLOCKEND_BLKADDR3 0x02e ++#endif + + /* Addresses for NFC RAM BUFFER Main area 0 */ + #define MAIN_AREA0 0x000 +@@ -59,10 +88,27 @@ + #define MAIN_AREA3 0x600 + + /* Addresses for NFC SPARE BUFFER Spare area 0 */ ++#ifndef CONFIG_ARCH_MXC_HAS_NFC_V1_1 ++#define SPARE_AREA_SIZE 16 + #define SPARE_AREA0 0x800 + #define SPARE_AREA1 0x810 + #define SPARE_AREA2 0x820 + #define SPARE_AREA3 0x830 ++#else ++#define SPARE_AREA_SIZE 64 ++#define MAIN_AREA4 0x800 ++#define MAIN_AREA5 0xa00 ++#define MAIN_AREA6 0xc00 ++#define MAIN_AREA7 0xe00 ++#define SPARE_AREA0 0x1000 ++#define SPARE_AREA1 0x1040 ++#define SPARE_AREA2 0x1080 ++#define SPARE_AREA3 0x10c0 ++#define SPARE_AREA4 0x1100 ++#define SPARE_AREA5 0x1140 ++#define SPARE_AREA6 0x1180 ++#define SPARE_AREA7 0x11c0 ++#endif + + /* 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 { + struct device *dev; + + void __iomem *regs; ++ void __iomem *nfc_buf; + int spare_only; + int status_request; + int pagesize_2k; +@@ -120,40 +167,149 @@ 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}} ++}; ++ + static struct nand_ecclayout nand_hw_eccoob_8 = { + .eccbytes = 5, + .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}} ++}; ++ ++#ifdef CONFIG_MTD_NAND_MXC_FLASH_BBT ++static u8 bbt_pattern[] = {'B', 'b', 't', '0' }; ++static u8 mirror_pattern[] = {'1', 't', 'b', 'B' }; ++ ++static struct nand_bbt_descr bbt_main_descr = { ++ .options = (NAND_BBT_LASTBLOCK | NAND_BBT_WRITE | ++ NAND_BBT_2BIT | NAND_BBT_VERSION | NAND_BBT_PERCHIP), ++ .offs = 12, ++ .len = 4, ++ .veroffs = 11, ++ .maxblocks = 4, ++ .pattern = bbt_pattern, + }; + ++static struct nand_bbt_descr bbt_mirror_descr = { ++ .options = (NAND_BBT_LASTBLOCK | NAND_BBT_WRITE | ++ NAND_BBT_2BIT | NAND_BBT_VERSION | NAND_BBT_PERCHIP), ++ .offs = 12, ++ .len = 4, ++ .veroffs = 11, ++ .maxblocks = 4, ++ .pattern = mirror_pattern, ++}; ++#endif ++#else ++/* ++ * 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 = {{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}, ++ .oobfree = {{0, 4}}, ++}; ++ ++static struct nand_ecclayout nand_hw_eccoob2k_16 = { ++ .eccbytes = 9, ++ .eccpos = {6, 7, 8, 9, 10, 11, 12, 13, 14}, ++ .oobfree = {{2, 4}, {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 ++*/ ++static u8 bbt_pattern[] = { 'B', 'b', 't', '0' }; ++static u8 mirror_pattern[] = { '1', 't', 'b', 'B' }; ++ ++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 ++}; ++ ++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 ++}; ++#endif ++#endif ++ + #ifdef CONFIG_MTD_PARTITIONS + static const char *part_probes[] = { "RedBoot", "cmdlinepart", NULL }; + #endif + ++#ifdef CONFIG_MTD_DEBUG ++#define nfc_read_reg(b, r) __nfc_read_reg(b, r, #r, __FUNCTION__) ++static inline u16 __nfc_read_reg(void __iomem *base, unsigned int reg, ++ const char *name, const char *fn) ++{ ++ u16 val = readw(base + reg); ++ DBG(3, "%s: Read %04x from %s[%02x]\n", fn, val, name, reg); ++ return val; ++} ++ ++#define nfc_write_reg(v, b, r) __nfc_write_reg(v, b, r, #r, __FUNCTION__) ++static inline void __nfc_write_reg(u16 val, void __iomem *base, unsigned int reg, ++ const char *name, const char *fn) ++{ ++ DBG(3, "%s: Writing %04x to %s[%02x]\n", fn, val, name, reg); ++ writew(val, base + reg); ++} ++#else ++#define nfc_read_reg(b, r) readw(b + r) ++#define nfc_write_reg(v, b, r) writew(v, b + r) ++#endif ++ + 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_LEVEL3, "%s(%d)\n", __FUNCTION__, irq); ++ ++ tmp = nfc_read_reg(host->regs, NFC_CONFIG1); + tmp |= NFC_INT_MSK; /* Disable interrupt */ +- writew(tmp, host->regs + NFC_CONFIG1); ++ nfc_write_reg(tmp, host->regs, NFC_CONFIG1); + + wake_up(&host->irq_waitq); + +@@ -166,35 +322,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; +- + if (useirq) { +- if ((readw(host->regs + NFC_CONFIG2) & NFC_INT) == 0) { +- +- tmp = readw(host->regs + NFC_CONFIG1); +- tmp &= ~NFC_INT_MSK; /* Enable interrupt */ +- writew(tmp, host->regs + NFC_CONFIG1); +- +- wait_event(host->irq_waitq, +- readw(host->regs + NFC_CONFIG2) & NFC_INT); +- +- tmp = readw(host->regs + NFC_CONFIG2); +- tmp &= ~NFC_INT; +- writew(tmp, host->regs + NFC_CONFIG2); ++ if (!(nfc_read_reg(host->regs, NFC_CONFIG2) & NFC_INT)) { ++ uint32_t cfg1; ++ 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_read_reg(host->regs, NFC_CONFIG2) & ++ NFC_INT, timeout); + } + } else { +- while (max_retries-- > 0) { +- if (readw(host->regs + NFC_CONFIG2) & NFC_INT) { +- tmp = readw(host->regs + NFC_CONFIG2); +- tmp &= ~NFC_INT; +- writew(tmp, host->regs + NFC_CONFIG2); +- break; +- } ++ 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); + } + } + +@@ -204,8 +354,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 +369,9 @@ 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); +@@ -230,22 +382,28 @@ static void send_addr(struct mxc_nand_ho + static void send_prog_page(struct mxc_nand_host *host, uint8_t buf_id, + int spare_only) + { ++ int i; + DEBUG(MTD_DEBUG_LEVEL3, "send_prog_page (%d)\n", spare_only); + ++ for (i = 0; i < 4; i++) { ++ void *src = host->nfc_buf + SPARE_AREA0 + i * 16; ++ void *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); ++ nfc_write_reg(buf_id, host->regs, NFC_BUF_ADDR); + + /* Configure spare or page+spare access */ + if (!host->pagesize_2k) { +- uint16_t config1 = readw(host->regs + NFC_CONFIG1); ++ uint16_t config1 = nfc_read_reg(host->regs, NFC_CONFIG1); + if (spare_only) + config1 |= NFC_SP_EN; + else +- 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); +@@ -256,25 +414,33 @@ 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 */ +- writew(buf_id, host->regs + NFC_BUF_ADDR); ++ nfc_write_reg(buf_id, host->regs, NFC_BUF_ADDR); + + /* Configure spare or page+spare access */ + if (!host->pagesize_2k) { +- uint32_t config1 = readw(host->regs + NFC_CONFIG1); ++ uint32_t config1 = nfc_read_reg(host->regs, NFC_CONFIG1); + if (spare_only) + config1 |= NFC_SP_EN; + else + config1 &= ~NFC_SP_EN; +- writew(config1, host->regs + NFC_CONFIG1); ++ nfc_write_reg(config1, host->regs, NFC_CONFIG1); + } + +- 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); ++ for (i = 0; i < 4; i++) { ++ void *src = host->nfc_buf + SPARE_AREA0 + i * 64; ++ void *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 +450,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 */ +- tmp = readw(host->regs + NFC_CONFIG1); ++ tmp = nfc_read_reg(host->regs, NFC_CONFIG1); + tmp &= ~NFC_SP_EN; +- writew(tmp, host->regs + NFC_CONFIG1); ++ 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 */ + wait_op_done(host, TROP_US_DELAY, 0, true); + + 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,32 +480,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_AREA1; + uint32_t store; + uint16_t ret, tmp; + /* 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 + * corruption of read/write buffer on status requests. */ +- writew(1, 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); ++ tmp = nfc_read_reg(host->regs, NFC_CONFIG1); + tmp &= ~NFC_SP_EN; +- writew(tmp, host->regs + NFC_CONFIG1); ++ nfc_write_reg(tmp, host->regs, NFC_CONFIG1); + +- writew(NFC_STATUS, host->regs + NFC_CONFIG2); ++ WARN_ON(nfc_read_reg(host->regs, NFC_CONFIG2)); ++ nfc_write_reg(NFC_STATUS, host->regs, NFC_CONFIG2); + + /* Wait for operation to complete */ + wait_op_done(host, TROP_US_DELAY, 0, true); + + /* Status is placed in first word of main buffer */ +- /* get status, then recovery area 1 data */ ++ /* get status, then recover area 1 data */ + ret = readw(main_buf); + writel(store, main_buf); + ++ DBG(0, "%s: status=%02x\n", __FUNCTION__, ret); ++ + return ret; + } + +@@ -369,7 +541,7 @@ static int mxc_nand_correct_data(struct + * 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, +@@ -392,8 +564,10 @@ 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; +- uint16_t __iomem *main_buf = host->regs + MAIN_AREA0; +- 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; ++ ++ WARN_ON(host->spare_only && host->col_addr >= 16); + + /* Check for status request */ + if (host->status_request) +@@ -431,14 +605,16 @@ static uint16_t mxc_nand_read_word(struc + "mxc_nand_read_word(col = %d)\n", host->col_addr); + + col = host->col_addr; ++ + /* Adjust saved column address */ + if (col < mtd->writesize && host->spare_only) + col += mtd->writesize; ++ WARN_ON(col >= mtd->writesize + 16); + + if (col < mtd->writesize) +- p = (host->regs + MAIN_AREA0) + (col >> 1); ++ p = (host->nfc_buf + MAIN_AREA0) + (col >> 1); + else +- p = (host->regs + SPARE_AREA0) + ((col - mtd->writesize) >> 1); ++ p = (host->nfc_buf + SPARE_AREA0) + ((col - mtd->writesize) >> 1); + + if (col & 1) { + rd_word = readw(p); +@@ -474,10 +650,13 @@ static void mxc_nand_write_buf(struct mt + /* 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 ++ 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); + +@@ -485,10 +664,10 @@ static void mxc_nand_write_buf(struct mt + void __iomem *p; + + if (col < mtd->writesize) +- p = host->regs + MAIN_AREA0 + (col & ~3); ++ p = host->nfc_buf + MAIN_AREA0 + (col & ~3); + else +- p = host->regs + SPARE_AREA0 - +- mtd->writesize + (col & ~3); ++ p = host->nfc_buf + SPARE_AREA0 + ++ (col & ~3) - mtd->writesize; + + DEBUG(MTD_DEBUG_LEVEL3, "%s:%d: p = %p\n", __func__, + __LINE__, p); +@@ -542,6 +721,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); + + memcpy(p, &buf[i], m); + col += m; +@@ -571,18 +751,28 @@ static void mxc_nand_read_buf(struct mtd + /* 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 ++ /* 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; + + if (col < mtd->writesize) +- p = host->regs + MAIN_AREA0 + (col & ~3); ++ p = host->nfc_buf + MAIN_AREA0 + (col & ~3); + else +- p = host->regs + SPARE_AREA0 - +- mtd->writesize + (col & ~3); ++ p = host->nfc_buf + SPARE_AREA0 + ++ (col & ~3) - mtd->writesize; ++ ++ if (dbg_lvl(3)) { ++ print_hex_dump(KERN_DEBUG, "spare: ", DUMP_PREFIX_ADDRESS, ++ 16, 2, p, 64, 0); ++ } + + if (((col | (int)&buf[i]) & 3) || n < 16) { + uint32_t data; +@@ -621,15 +811,20 @@ static void mxc_nand_read_buf(struct mtd + m += mtd->oobsize; + + 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; + } + } ++ 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 +@@ -637,7 +832,22 @@ 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; ++ ++ for (i = 0; i < len >> 1; i++) { ++ u16 w = *wp++; ++ u8 c1 = *buf++; ++ u8 c2 = *buf++; ++ if ((w & 0xff) != c1 || (w >> 8) != c2) { ++ DBG(0, "%s: verify error @ %03x: read: %02x %02x expected: %02x %02x\n", ++ __FUNCTION__, i, w & 0xff, w >> 8, c1, c2); ++ return -EFAULT; ++ } ++ } ++ return 0; + } + + /* This function is used by upper layer for select and +@@ -655,13 +865,15 @@ 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); + 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); + #endif + + switch (chip) { +@@ -679,9 +891,6 @@ static void mxc_nand_select_chip(struct + host->clk_act = 1; + } + break; +- +- default: +- break; + } + } + +@@ -692,7 +901,7 @@ 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", +@@ -712,13 +921,11 @@ static void mxc_nand_command(struct mtd_ + case NAND_CMD_READ0: + 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; +@@ -751,23 +958,25 @@ 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); +- ++#ifndef CONFIG_ARCH_MXC_HAS_NFC_V1_1 + if (host->pagesize_2k) { + /* 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); + } +- ++#endif ++ useirq = true; + break; + + case NAND_CMD_ERASE1: +- useirq = false; ++ break; ++ case NAND_CMD_ERASE2: ++ useirq = true; + break; + } + +@@ -791,23 +1000,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 +1022,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); ++#ifndef CONFIG_ARCH_MXC_HAS_NFC_V1_1 + send_read_page(host, 1, host->spare_only); + send_read_page(host, 2, host->spare_only); + send_read_page(host, 3, host->spare_only); ++#endif + } else + send_read_page(host, 0, host->spare_only); + break; + + case NAND_CMD_READID: ++ host->col_addr = 0; + send_read_id(host); + break; + +@@ -851,9 +1053,12 @@ 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; +- struct resource *res; ++ struct resource *res1, *res2; + 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 +1073,6 @@ static int __init mxcnd_probe(struct pla + mtd->owner = THIS_MODULE; + mtd->dev.parent = &pdev->dev; + +- /* 50 us command delay time */ +- this->chip_delay = 5; +- + this->priv = host; + this->dev_ready = mxc_nand_dev_ready; + this->cmdfunc = mxc_nand_command; +@@ -880,29 +1082,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; ++#ifdef CONFIG_MTD_NAND_MXC_FLASH_BBT ++ this->bbt_td = &bbt_main_descr; ++ this->bbt_md = &bbt_mirror_descr; ++ this->options |= NAND_USE_FLASH_BBT; ++#endif + +- host->clk = clk_get(&pdev->dev, "nfc"); +- if (IS_ERR(host->clk)) ++ host->clk = clk_get(&pdev->dev, "nfc_clk"); ++ if (IS_ERR(host->clk)) { ++ err = PTR_ERR(host->clk); + goto eclk; ++ } + + clk_enable(host->clk); + host->clk_act = 1; + +- res = platform_get_resource(pdev, IORESOURCE_MEM, 0); +- if (!res) { ++ res1 = platform_get_resource(pdev, IORESOURCE_MEM, 0); ++ res2 = platform_get_resource(pdev, IORESOURCE_MEM, 1); ++ if (!res1 || !res2) { + err = -ENODEV; + goto eres; + } + +- 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; ++ } ++ ++ if (!request_mem_region(res2->start, resource_size(res2), "mxc_nand buffer")) { ++ err = -EBUSY; ++ goto ereq2; ++ } ++ ++ host->regs = ioremap(res1->start, resource_size(res1)); + if (!host->regs) { +- err = -EIO; +- goto eres; ++ err = -ENOMEM; ++ goto eunmap1; + } + +- tmp = readw(host->regs + NFC_CONFIG1); ++ 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); + +@@ -912,57 +1139,84 @@ static int __init mxcnd_probe(struct pla + if (err) + goto eirq; + +- 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_ECC_EN; +- writew(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; +- tmp = readw(host->regs + NFC_CONFIG1); +- tmp &= ~NFC_ECC_EN; +- writew(tmp, host->regs + NFC_CONFIG1); +- } +- + /* Reset NAND */ + this->cmdfunc(mtd, NAND_CMD_RESET, -1, -1); + + /* preset operation */ + /* Unlock the internal RAM Buffer */ +- writew(0x2, host->regs + NFC_CONFIG); ++ nfc_write_reg(0x2, host->regs, NFC_CONFIG); + + /* Blocks to be unlocked */ +- writew(0x0, host->regs + NFC_UNLOCKSTART_BLKADDR); +- writew(0x4000, host->regs + NFC_UNLOCKEND_BLKADDR); ++ nfc_write_reg(0x0, host->regs, NFC_UNLOCKSTART_BLKADDR); ++ nfc_write_reg(0x4000, host->regs, NFC_UNLOCKEND_BLKADDR); + + /* Unlock Block Command for given address range */ +- writew(0x4, host->regs + NFC_WRPROT); ++ nfc_write_reg(0x4, host->regs, NFC_WRPROT); + + /* NAND bus width determines access funtions used by upper layer */ + if (pdata->width == 2) { + this->options |= NAND_BUSWIDTH_16; +- this->ecc.layout = &nand_hw_eccoob_16; + } + +- host->pagesize_2k = 0; +- + /* Scan to find existence of the device */ +- if (nand_scan(mtd, 1)) { ++ err = nand_scan_ident(mtd, 1); ++ if (err) { + DEBUG(MTD_DEBUG_LEVEL0, + "MXC_ND: Unable to find any NAND device.\n"); +- err = -ENXIO; ++ goto escan; ++ } ++ /* this is required before completing the scan */ ++ host->pagesize_2k = (mtd->writesize == 2048); ++ tmp = nfc_read_reg(host->regs, NFC_CONFIG1); ++ tmp |= NFC_ONE_CYCLE; ++ tmp &= ~(3 << 9); /* clear PPB mask */ ++ DBG(0, "%s: ppb=%d (%02x)\n", __FUNCTION__, ++ mtd->erasesize / mtd->writesize, ++ ffs(mtd->erasesize / mtd->writesize) - 6); ++ ++ /* set PPB (pages per block */ ++ tmp |= (ffs(mtd->erasesize / mtd->writesize) - 6) << 9; ++ nfc_write_reg(tmp, host->regs, NFC_CONFIG1); ++ if (pdata->width == 2) { ++ if (host->pagesize_2k) { ++ this->ecc.layout = &nand_hw_eccoob2k_16; ++ } else { ++ this->ecc.layout = &nand_hw_eccoob_16; ++ } ++ } 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; ++ nfc_write_reg(tmp, host->regs, NFC_CONFIG1); ++ } ++ ++ err = nand_scan_tail(mtd); ++ if (err) { + goto escan; + } + ++ 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 +1235,19 @@ static int __init mxcnd_probe(struct pla + return 0; + + escan: +- free_irq(host->irq, NULL); ++ free_irq(host->irq, host); + eirq: ++ if (res2) ++ iounmap(host->nfc_buf); ++eunmap2: + iounmap(host->regs); ++eunmap1: ++ release_mem_region(res2->start, resource_size(res2)); ++ereq2: ++ release_mem_region(res1->start, resource_size(res1)); ++ereq1: + eres: ++ clk_disable(host->clk); + clk_put(host->clk); + eclk: + kfree(host); +@@ -995,46 +1258,63 @@ eclk: + static int __devexit mxcnd_remove(struct platform_device *pdev) + { + struct mxc_nand_host *host = platform_get_drvdata(pdev); ++ struct resource *res; + ++ if (host->clk_act) ++ clk_disable(host->clk); + clk_put(host->clk); + +- platform_set_drvdata(pdev, NULL); +- + nand_release(&host->mtd); +- free_irq(host->irq, NULL); ++ free_irq(host->irq, host); + iounmap(host->regs); + kfree(host); + ++ res = platform_get_resource(pdev, IORESOURCE_MEM, 0); ++ if (res) { ++ release_mem_region(res->start, resource_size(res)); ++ } ++ res = platform_get_resource(pdev, IORESOURCE_MEM, 1); ++ if (res) { ++ release_mem_region(res->start, resource_size(res)); ++ } + return 0; + } + + #ifdef CONFIG_PM + static int mxcnd_suspend(struct platform_device *pdev, pm_message_t state) + { +- struct mtd_info *info = platform_get_drvdata(pdev); ++ struct mtd_info *mtd = platform_get_drvdata(pdev); ++ struct nand_chip *nand_chip = mtd->priv; ++ struct mxc_nand_host *host = nand_chip->priv; + int ret = 0; + + DEBUG(MTD_DEBUG_LEVEL0, "MXC_ND : NAND suspend\n"); +- if (info) +- ret = info->suspend(info); ++ if (mtd) ++ ret = mtd->suspend(mtd); + +- /* Disable the NFC clock */ +- clk_disable(nfc_clk); /* FIXME */ ++ if (host->clk_act) { ++ /* Disable the NFC clock */ ++ clk_disable(host->clk); ++ } + + return ret; + } + + static int mxcnd_resume(struct platform_device *pdev) + { +- struct mtd_info *info = platform_get_drvdata(pdev); ++ struct mtd_info *mtd = platform_get_drvdata(pdev); ++ struct nand_chip *nand_chip = mtd->priv; ++ struct mxc_nand_host *host = nand_chip->priv; + int ret = 0; + + DEBUG(MTD_DEBUG_LEVEL0, "MXC_ND : NAND resume\n"); +- /* Enable the NFC clock */ +- clk_enable(nfc_clk); /* FIXME */ + +- if (info) +- info->resume(info); ++ if (host->clk_act) { ++ /* Enable the NFC clock */ ++ clk_enable(host->clk); ++ } ++ if (mtd) ++ mtd->resume(mtd); + + return ret; + } +@@ -1047,7 +1327,7 @@ static int mxcnd_resume(struct platform_ + static struct platform_driver mxcnd_driver = { + .driver = { + .name = DRIVER_NAME, +- }, ++ }, + .remove = __exit_p(mxcnd_remove), + .suspend = mxcnd_suspend, + .resume = mxcnd_resume, +@@ -1055,13 +1335,14 @@ static struct platform_driver mxcnd_driv + + static int __init mxc_nd_init(void) + { ++ int ret; ++ + /* Register the device driver structure. */ +- pr_info("MXC MTD nand Driver\n"); +- if (platform_driver_probe(&mxcnd_driver, mxcnd_probe) != 0) { ++ ret = platform_driver_probe(&mxcnd_driver, mxcnd_probe); ++ if (ret != 0) { + printk(KERN_ERR "Driver register failed for mxcnd_driver\n"); +- return -ENODEV; + } +- return 0; ++ return ret; + } + + static void __exit mxc_nd_cleanup(void) +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 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 -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 18:43:03.000000000 +0200 +@@ -2,6 +2,12 @@ + * Fast Ethernet Controller (FEC) driver for Motorola MPC8xx. + * Copyright (c) 1997 Dan Malek (dmalek@jlc.net) + * ++ * This version of the driver is specific to the FADS implementation, ++ * since the board contains control registers external to the processor ++ * for the control of the LevelOne LXT970 transceiver. The MPC860T manual ++ * describes connections using the internal parallel port I/O, which ++ * is basically all of Port D. ++ * + * Right now, I am very wasteful with the buffers. I allocate memory + * pages and then divide them into 2K frame buffers. This way I know I + * have buffers large enough to hold one frame within one buffer descriptor. +@@ -18,77 +24,123 @@ + * Bug fixes and cleanup by Philippe De Muyter (phdm@macqel.be) + * Copyright (c) 2004-2006 Macq Electronique SA. + */ ++/* ++ * Copyright 2006-2007 Freescale Semiconductor, Inc. All Rights Reserved. ++ */ + + #include + #include +-#include +-#include ++#include + #include + #include + #include + #include +-#include +-#include ++#include + #include ++#include + #include + #include + #include + #include +-#include +-#include +-#include +-#include ++#include + #include +-#include ++#include ++#include + +-#include ++#include ++#include + +-#ifndef CONFIG_ARCH_MXC +-#include +-#include ++#define DRV_NAME "fec" ++#define DEBUG ++ ++#ifdef DEBUG ++static int debug = 0; ++#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 + ++#if defined(CONFIG_M523x) || defined(CONFIG_M527x) || \ ++ defined(CONFIG_M5272) || defined(CONFIG_M528x) || \ ++ defined(CONFIG_M520x) || defined(CONFIG_M532x) ++#include ++#include + #include "fec.h" +- +-#ifdef CONFIG_ARCH_MXC ++#define FEC_ALIGNMENT (0x03) /*FEC needs 4bytes alignment*/ ++#elif defined(CONFIG_ARCH_MXC) + #include +-#define FEC_ALIGNMENT 0xf ++#include ++#include "fec.h" ++#define FEC_ALIGNMENT (0x0F) /*FEC needs 128bits(16bytes) alignment*/ + #else +-#define FEC_ALIGNMENT 0x3 ++#include ++#include ++#include "commproc.h" ++#define FEC_ALIGNMENT (0x03) /*FEC needs 4bytes alignment */ + #endif + ++#define FEC_ADDR_ALIGNMENT(x) ((unsigned char *)(((unsigned long)(x) + (FEC_ALIGNMENT)) & (~FEC_ALIGNMENT))) ++ ++#if 0 + /* + * Define the fixed address of the FEC hardware. + */ ++/* USE resources provided by platform_device! */ ++static unsigned int fec_hw[] = { + #if defined(CONFIG_M5272) +-#define HAVE_mii_link_interrupt +- +-static unsigned char fec_mac_default[] = { +- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ (MCF_MBAR + 0x840), ++#elif defined(CONFIG_M527x) ++ (MCF_MBAR + 0x1000), ++ (MCF_MBAR + 0x1800), ++#elif defined(CONFIG_M523x) || defined(CONFIG_M528x) ++ (MCF_MBAR + 0x1000), ++#elif defined(CONFIG_M520x) ++ (MCF_MBAR+0x30000), ++#elif defined(CONFIG_M532x) ++ (MCF_MBAR+0xfc030000), ++#elif defined(CONFIG_ARCH_MXC) ++ (IO_ADDRESS(FEC_BASE_ADDR)), ++#else ++ &(((immap_t *)IMAP_ADDR)->im_cpm.cp_fec), ++#endif + }; ++#endif + ++#if 0 + /* + * Some hardware gets it MAC address out of local flash memory. + * if this is non-zero then assume it is the address to get MAC from. + */ ++/* implemented using platform_data! */ + #if defined(CONFIG_NETtel) + #define FEC_FLASHMAC 0xf0006006 + #elif defined(CONFIG_GILBARCONAP) || defined(CONFIG_SCALES) + #define FEC_FLASHMAC 0xf0006000 ++#elif defined (CONFIG_MTD_KeyTechnology) ++#define FEC_FLASHMAC 0xffe04000 + #elif defined(CONFIG_CANCam) + #define FEC_FLASHMAC 0xf0020000 + #elif defined (CONFIG_M5272C3) + #define FEC_FLASHMAC (0xffe04000 + 4) + #elif defined(CONFIG_MOD5272) +-#define FEC_FLASHMAC 0xffc0406b ++#define FEC_FLASHMAC 0xffc0406b + #else + #define FEC_FLASHMAC 0 + #endif +-#endif /* CONFIG_M5272 */ ++#endif ++ ++#define platform_func(p, args...) ((p) ? (p)(args) : 0) + + /* Forward declarations of some structures to support different PHYs + */ +- ++#ifndef CONFIG_PHYLIB + typedef struct { + uint mii_data; + void (*funct)(uint mii_reg, struct net_device *dev); +@@ -103,6 +155,7 @@ typedef struct { + const phy_cmd_t *ack_int; + const phy_cmd_t *shutdown; + } phy_info_t; ++#endif + + /* The number of Tx and Rx buffers. These are allocated from the page + * pool. The code may assume these are power of two, so it it best +@@ -116,12 +169,13 @@ typedef struct { + #define RX_RING_SIZE (FEC_ENET_RX_FRPPG * FEC_ENET_RX_PAGES) + #define FEC_ENET_TX_FRSIZE 2048 + #define FEC_ENET_TX_FRPPG (PAGE_SIZE / FEC_ENET_TX_FRSIZE) +-#define TX_RING_SIZE 16 /* Must be power of two */ +-#define TX_RING_MOD_MASK 15 /* for this to work */ ++#define TX_RING_SIZE 16 /* Must be power of two */ ++#define TX_RING_MOD_MASK (TX_RING_SIZE - 1) /* for this to work */ + + #if (((RX_RING_SIZE + TX_RING_SIZE) * 8) > PAGE_SIZE) + #error "FEC: descriptor ring size constants too large" + #endif ++#define CBD_BUF_SIZE ((RX_RING_SIZE + TX_RING_SIZE) * sizeof(cbd_t)) + + /* Interrupt events/masks. + */ +@@ -136,6 +190,17 @@ typedef struct { + #define FEC_ENET_MII ((uint)0x00800000) /* MII interrupt */ + #define FEC_ENET_EBERR ((uint)0x00400000) /* SDMA bus error */ + ++/* MXC arch interrupt bits */ ++#define FEC_ENET_LC ((uint)0x00200000) /* Late collision */ ++#define FEC_ENET_RL ((uint)0x00100000) /* Collision retry limit exceeded */ ++#define FEC_ENET_UN ((uint)0x00080000) /* TX Fifo underrun */ ++ ++#ifndef CONFIG_ARCH_MXC ++#define FEC_ENET_MASK ((uint)0xffc00000) ++#else ++#define FEC_ENET_MASK ((uint)0xfff80000) ++#endif ++ + /* The FEC stores dest/src/type, data, and checksum for receive packets. + */ + #define PKT_MAXBUF_SIZE 1518 +@@ -150,7 +215,7 @@ typedef struct { + */ + #if defined(CONFIG_M523x) || defined(CONFIG_M527x) || defined(CONFIG_M528x) || \ + defined(CONFIG_M520x) || defined(CONFIG_M532x) || defined(CONFIG_ARCH_MXC) +-#define OPT_FRAME_SIZE (PKT_MAXBUF_SIZE << 16) ++#define OPT_FRAME_SIZE (RCR_MAX_FL_set(PKT_MAXBUF_SIZE)) + #else + #define OPT_FRAME_SIZE 0 + #endif +@@ -165,31 +230,45 @@ typedef struct { + */ + struct fec_enet_private { + /* Hardware registers of the FEC device */ +- volatile fec_t *hwp; +- +- struct net_device *netdev; +- +- struct clk *clk; ++ void __iomem *reg_base; ++ void __iomem *mib_base; ++ struct resource *res_mem1; ++ struct resource *res_mem2; ++ int etn_irq; ++ int mii_irq; ++#ifndef CONFIG_PHYLIB ++ struct timer_list *phy_timer; ++#else ++ struct mii_bus *mii; ++ int mii_complete; ++#endif ++ u32 msg_enable; + + /* The saved address of a sent-in-place packet/buffer, for skfree(). */ +- unsigned char *tx_bounce[TX_RING_SIZE]; ++ void *tx_bounce[TX_RING_SIZE]; + struct sk_buff* tx_skbuff[TX_RING_SIZE]; ++ struct sk_buff* rx_skbuff[RX_RING_SIZE]; + ushort skb_cur; + ushort skb_dirty; + + /* CPM dual port RAM relative addresses. + */ +- dma_addr_t bd_dma; ++ struct device *dma_dev; /* pointer to (platform_)device for dma_sync*() functions */ ++ void *cbd_mem_base; /* save the virtual base address of rx&tx buffer descriptor */ ++ dma_addr_t cbd_phys_base; /* physical address of buffer descriptor memory for access by FEC HW */ ++ + cbd_t *rx_bd_base; /* Address of Rx and Tx buffers. */ + cbd_t *tx_bd_base; +- cbd_t *cur_rx, *cur_tx; /* The next free ring entry */ +- cbd_t *dirty_tx; /* The ring entries to be free()ed. */ ++ cbd_t *cur_rx, *cur_tx; /* The next free ring entry */ ++ cbd_t *dirty_tx; /* The ring entries to be free()ed. */ ++ struct net_device_stats stats; + uint tx_full; +- /* hold while accessing the HW like ringbuffer for tx/rx but not MAC */ +- spinlock_t hw_lock; +- /* hold while accessing the mii_list_t() elements */ +- spinlock_t mii_lock; ++ spinlock_t lock; + ++#ifdef CONFIG_PHYLIB ++ struct phy_device *phy; ++ uint phy_speed; ++#else + uint phy_id; + uint phy_id_done; + uint phy_status; +@@ -199,28 +278,41 @@ struct fec_enet_private { + + uint sequence_done; + uint mii_phy_task_queued; +- ++#endif + uint phy_addr; + +- int index; +- int opened; +- int link; +- int old_link; +- int full_duplex; ++ unsigned int opened:1; ++ unsigned int phy_int_enabled:1; ++ unsigned int linkstatus:1; ++#ifndef CONFIG_PHYLIB ++ unsigned int old_linkstatus:1; ++#endif ++ unsigned int full_duplex:1; ++ ++ struct clk *clk; + }; + +-static int fec_enet_open(struct net_device *dev); +-static int fec_enet_start_xmit(struct sk_buff *skb, struct net_device *dev); +-static void fec_enet_mii(struct net_device *dev); +-static irqreturn_t fec_enet_interrupt(int irq, void * dev_id); ++#ifdef CONFIG_PHYLIB ++static int fec_connect_phy(struct net_device *dev, struct fec_enet_private *fep); ++#else ++static irqreturn_t mii_link_interrupt(int irq, void *dev_id); ++#endif ++static void fec_restart(struct net_device *dev, int duplex); + static void fec_enet_tx(struct net_device *dev); + static void fec_enet_rx(struct net_device *dev); +-static int fec_enet_close(struct net_device *dev); +-static void set_multicast_list(struct net_device *dev); +-static void fec_restart(struct net_device *dev, int duplex); ++static void fec_enet_mii(struct net_device *dev); + static void fec_stop(struct net_device *dev); +-static void fec_set_mac_address(struct net_device *dev); ++static void _fec_set_mac_address(struct net_device *dev); + ++/* ++ * fec_copy_threshold controls the copy when receiving ethernet frame. ++ * If ethernet header is aligned on a 4byte boundary, the ip header and ++ * higher level header will not be aligned. ++ * The reason is, that an ethernet header is 14bytes long. ++ * And the max size of tcp & ip header is 128bytes. Normally it is 40bytes. ++ * So I set the default value between 128 to 256. ++ */ ++static int fec_copy_threshold = 192; + + /* MII processing. We keep this as simple as possible. Requests are + * placed on the list (if there is room). When the request is finished +@@ -232,14 +324,16 @@ typedef struct mii_list { + struct mii_list *mii_next; + } mii_list_t; + ++#ifndef CONFIG_PHYLIB + #define NMII 20 + static mii_list_t mii_cmds[NMII]; + static mii_list_t *mii_free; + static mii_list_t *mii_head; + static mii_list_t *mii_tail; + +-static int mii_queue(struct net_device *dev, int request, +- void (*func)(uint, struct net_device *)); ++static int mii_queue(struct net_device *dev, int request, ++ void (*func)(uint, struct net_device *)); ++#endif + + /* Make MII read/write commands for the FEC. + */ +@@ -284,87 +378,233 @@ 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 */ + ++#ifndef DEBUG ++static inline unsigned long fec_reg_read(struct fec_enet_private *fep, unsigned int reg) ++{ ++ return readl(fep->reg_base + reg); ++} ++ ++static inline void fec_reg_write(struct fec_enet_private *fep, unsigned int reg, unsigned long val) ++{ ++ writel(val, fep->reg_base + reg); ++} ++#else ++#define fec_reg_read(fep, reg) __fec_reg_read(fep, reg, __FUNCTION__, #reg) ++#define fec_reg_write(fep, reg, val) __fec_reg_write(fep, reg, val, __FUNCTION__, #reg) ++ ++static inline unsigned long __fec_reg_read(struct fec_enet_private *fep, unsigned int reg, ++ const char *func, const char *reg_name) ++{ ++ unsigned long val = readl(fep->reg_base + reg); ++ DBG(3, "%s: Read %08lx from %s(%03x)\n", func, val, reg_name, reg); ++ return val; ++} ++ ++static inline void __fec_reg_write(struct fec_enet_private *fep, unsigned int reg, ++ unsigned long val, const char *func, const char *reg_name) ++{ ++ DBG(3, "%s: Writing %08lx to %s(%03x)\n", func, val, reg_name, reg); ++ writel(val, fep->reg_base + reg); ++} ++#endif ++ ++static inline void fec_enet_cbd_get(struct fec_enet_private *fep) ++{ ++ DBG(2, "%s: Requesting cbd area: %08lx\n", __FUNCTION__, ++ (unsigned long)fep->cbd_phys_base); ++ dma_sync_single_for_cpu(fep->dma_dev, fep->cbd_phys_base, ++ CBD_BUF_SIZE, DMA_BIDIRECTIONAL); ++} ++ ++static inline void fec_enet_cbd_put(struct fec_enet_private *fep) ++{ ++ DBG(2, "%s: Flushing changes to cbd area\n", __FUNCTION__); ++ dma_sync_single_for_device(fep->dma_dev, fep->cbd_phys_base, ++ CBD_BUF_SIZE, DMA_BIDIRECTIONAL); ++} ++ ++static inline void fec_enet_rxbuf_get(struct fec_enet_private *fep, cbd_t *bdp, ushort len) ++{ ++ DBG(2, "%s: Requesting RX buffer %08lx(%u)\n", __FUNCTION__, ++ (unsigned long)bdp->cbd_bufaddr, len); ++ dma_sync_single_for_cpu(fep->dma_dev, bdp->cbd_bufaddr, ++ len, DMA_FROM_DEVICE); ++} ++ ++static inline void fec_enet_rxbuf_put(struct fec_enet_private *fep, cbd_t *bdp, ushort len) ++{ ++ DBG(2, "%s: Releasing RX buffer %08lx(%u)\n", __FUNCTION__, (ulong)bdp->cbd_bufaddr, len); ++ dma_sync_single_for_device(fep->dma_dev, bdp->cbd_bufaddr, len, DMA_FROM_DEVICE); ++} ++ ++static inline void fec_enet_rxbuf_map(struct fec_enet_private *fep, cbd_t *bdp, ++ void *buf, ushort len) ++{ ++ BUG_ON(!dma_mapping_error(fep->dma_dev, bdp->cbd_bufaddr)); ++ bdp->cbd_bufaddr = dma_map_single(fep->dma_dev, buf, ++ len, DMA_FROM_DEVICE); ++ DBG(2, "%s: RX buffer %p(%u) mapped to %08lx\n", __FUNCTION__, ++ buf, len, (unsigned long)bdp->cbd_bufaddr); ++} ++ ++static inline void fec_enet_rxbuf_unmap(struct fec_enet_private *fep, cbd_t *bdp, ushort len) ++{ ++ DBG(2, "%s: Unmapping RX buffer %08lx(%u)\n", __FUNCTION__, ++ (unsigned long)bdp->cbd_bufaddr, len); ++ BUG_ON(dma_mapping_error(fep->dma_dev, bdp->cbd_bufaddr)); ++ dma_unmap_single(fep->dma_dev, bdp->cbd_bufaddr, ++ len, DMA_FROM_DEVICE); ++ bdp->cbd_bufaddr = ~0; ++} ++ ++static inline void fec_enet_txbuf_map(struct fec_enet_private *fep, cbd_t *bdp, ++ void *buf, ushort len) ++{ ++ BUG_ON(!dma_mapping_error(fep->dma_dev, bdp->cbd_bufaddr)); ++ bdp->cbd_bufaddr = dma_map_single(fep->dma_dev, buf, ++ len, DMA_TO_DEVICE); ++ DBG(2, "%s: TX buffer %p(%u) mapped to %08lx\n", __FUNCTION__, ++ buf, len, (unsigned long)bdp->cbd_bufaddr); ++} ++ ++static inline void fec_enet_txbuf_unmap(struct fec_enet_private *fep, cbd_t *bdp, ushort len) ++{ ++ DBG(2, "%s: Unmapping TX buffer %08lx(%u)\n", __FUNCTION__, ++ (unsigned long)bdp->cbd_bufaddr, len); ++ BUG_ON(dma_mapping_error(fep->dma_dev, bdp->cbd_bufaddr)); ++ dma_unmap_single(fep->dma_dev, bdp->cbd_bufaddr, ++ len, DMA_TO_DEVICE); ++ bdp->cbd_bufaddr = ~0; ++} ++ ++static inline void fec_enet_txbuf_get(struct fec_enet_private *fep, cbd_t *bdp, ushort len) ++{ ++ DBG(2, "%s: Requesting TX buffer %08lx(%u)\n", __FUNCTION__, ++ (unsigned long)bdp->cbd_bufaddr, len); ++ dma_sync_single_for_cpu(fep->dma_dev, bdp->cbd_bufaddr, ++ len, DMA_TO_DEVICE); ++} ++ ++static inline void fec_enet_txbuf_put(struct fec_enet_private *fep, cbd_t *bdp, ushort len) ++{ ++ DBG(2, "%s: Releasing TX buffer %08lx(%u)\n", __FUNCTION__, ++ (unsigned long)bdp->cbd_bufaddr, len); ++ 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) + { +- struct fec_enet_private *fep; +- volatile fec_t *fecp; +- volatile cbd_t *bdp; +- unsigned short status; ++ struct fec_enet_private *fep = netdev_priv(dev); ++ cbd_t *bdp; ++ unsigned short status; + unsigned long flags; + +- fep = netdev_priv(dev); +- fecp = (volatile fec_t*)dev->base_addr; +- +- if (!fep->link) { ++ if (!fep->linkstatus) { ++ DBG(0, "%s: Cannot send packet; link is down\n", __FUNCTION__); + /* Link is down or autonegotiation is in progress. */ + return 1; + } + +- 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 */ + bdp = fep->cur_tx; + + status = bdp->cbd_sc; +-#ifndef final_version ++#ifdef DEBUG + if (status & BD_ENET_TX_READY) { + /* Ooops. All transmit buffers are full. Bail out. + * This should not happen, since dev->tbusy should be set. + */ + printk("%s: tx queue full!.\n", dev->name); +- spin_unlock_irqrestore(&fep->hw_lock, flags); ++ fec_enet_cbd_put(fep); ++ spin_unlock_irqrestore(&fep->lock, flags); + return 1; + } + #endif +- + /* Clear all of the status flags. + */ + status &= ~BD_ENET_TX_STATS; + + /* Set buffer length and buffer pointer. + */ +- 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 + * 4-byte boundaries. Use bounce buffers to copy data + * and get it aligned. Ugh. + */ +- if (bdp->cbd_bufaddr & FEC_ALIGNMENT) { ++ if (unlikely((bdp->cbd_bufaddr) & FEC_ALIGNMENT)) { + unsigned int index; + index = bdp - fep->tx_bd_base; +- memcpy(fep->tx_bounce[index], (void *)skb->data, skb->len); +- bdp->cbd_bufaddr = __pa(fep->tx_bounce[index]); ++ memcpy(fep->tx_bounce[index], skb->data, skb->len); ++ fec_enet_txbuf_map(fep, bdp, fep->tx_bounce[index], skb->len); ++ } else { ++ fec_enet_txbuf_map(fep, bdp, skb->data, skb->len); + } + + /* Save skb pointer. + */ + fep->tx_skbuff[fep->skb_cur] = skb; + +- dev->stats.tx_bytes += skb->len; +- fep->skb_cur = (fep->skb_cur+1) & TX_RING_MOD_MASK; +- +- /* Push the data cache so the CPM does not get stale memory +- * data. +- */ +- dma_sync_single(NULL, bdp->cbd_bufaddr, +- bdp->cbd_datlen, DMA_TO_DEVICE); ++ fep->stats.tx_bytes += skb->len; ++ fep->skb_cur = (fep->skb_cur + 1) & TX_RING_MOD_MASK; + + /* Send it on its way. Tell FEC it's ready, interrupt when done, + * it's the last BD of the frame, and to put the CRC on the end. + */ +- + status |= (BD_ENET_TX_READY | BD_ENET_TX_INTR + | BD_ENET_TX_LAST | BD_ENET_TX_TC); + bdp->cbd_sc = status; + + dev->trans_start = jiffies; + +- /* Trigger transmission start */ +- fecp->fec_x_des_active = 0; +- + /* 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, + + if (bdp == fep->dirty_tx) { + fep->tx_full = 1; ++ DBG(0, "TX ring full, stopping netif queue\n"); + netif_stop_queue(dev); + } + +- 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; + } +@@ -390,101 +640,126 @@ fec_timeout(struct net_device *dev) + { + struct fec_enet_private *fep = netdev_priv(dev); + +- printk("%s: transmit timed out.\n", dev->name); +- dev->stats.tx_errors++; +-#ifndef final_version ++ printk(KERN_WARNING "%s: transmit timed out.\n", dev->name); ++ fep->stats.tx_errors++; ++#ifdef DEBUG + { +- int i; +- cbd_t *bdp; ++ int i; ++ cbd_t *bdp; + +- printk("Ring data dump: cur_tx %lx%s, dirty_tx %lx cur_rx: %lx\n", +- (unsigned long)fep->cur_tx, fep->tx_full ? " (full)" : "", +- (unsigned long)fep->dirty_tx, +- (unsigned long)fep->cur_rx); ++ fec_enet_cbd_get(fep); + +- bdp = fep->tx_bd_base; +- printk(" tx: %u buffers\n", TX_RING_SIZE); +- for (i = 0 ; i < TX_RING_SIZE; i++) { +- printk(" %08x: %04x %04x %08x\n", +- (uint) bdp, +- bdp->cbd_sc, +- bdp->cbd_datlen, +- (int) bdp->cbd_bufaddr); +- bdp++; +- } ++ printk(KERN_DEBUG "%s: Ring data dump: cur_tx %p%s, dirty_tx %p cur_rx: %p\n", ++ __FUNCTION__, ++ fep->cur_tx, fep->tx_full ? " (full)" : "", ++ fep->dirty_tx, ++ fep->cur_rx); + +- bdp = fep->rx_bd_base; +- printk(" rx: %lu buffers\n", (unsigned long) RX_RING_SIZE); +- for (i = 0 ; i < RX_RING_SIZE; i++) { +- printk(" %08x: %04x %04x %08x\n", +- (uint) bdp, +- bdp->cbd_sc, +- bdp->cbd_datlen, +- (int) bdp->cbd_bufaddr); +- bdp++; +- } ++ bdp = fep->tx_bd_base; ++ printk(" tx: %u buffers\n", TX_RING_SIZE); ++ for (i = 0; i < TX_RING_SIZE; i++) { ++ printk(" %p: %04x %04x %08x\n", ++ bdp, ++ bdp->cbd_sc, ++ bdp->cbd_datlen, ++ bdp->cbd_bufaddr); ++ bdp++; ++ } ++ ++ bdp = fep->rx_bd_base; ++ printk(" rx: %lu buffers\n", RX_RING_SIZE); ++ for (i = 0; i < RX_RING_SIZE; i++) { ++ printk(" %p: %04x %04x %08x\n", ++ bdp, ++ bdp->cbd_sc, ++ bdp->cbd_datlen, ++ bdp->cbd_bufaddr); ++ bdp++; ++ } ++ fec_enet_cbd_put(fep); + } + #endif + fec_restart(dev, fep->full_duplex); +- netif_wake_queue(dev); ++ DBG(0, "%s: Scheduling netif queue\n", __FUNCTION__); ++ //netif_schedule(dev); + } + + /* The interrupt handler. + * This is called from the MPC core interrupt. + */ + static irqreturn_t +-fec_enet_interrupt(int irq, void * dev_id) ++fec_enet_interrupt(int irq, void *dev_id) + { +- struct net_device *dev = dev_id; +- volatile fec_t *fecp; +- uint int_events; +- irqreturn_t ret = IRQ_NONE; +- +- fecp = (volatile fec_t*)dev->base_addr; ++ struct net_device *dev = dev_id; ++ struct fec_enet_private *fep = netdev_priv(dev); ++ uint int_events; ++ int handled = 0; ++ unsigned int eimr = fec_reg_read(fep, FEC_EIMR); + ++ DBG(2, "%s: %08lx:%08lx\n", __FUNCTION__, ++ fec_reg_read(fep, FEC_EIR), fec_reg_read(fep, FEC_EIMR)); + /* Get the interrupt events that caused us to be here. + */ +- do { +- int_events = fecp->fec_ievent; +- fecp->fec_ievent = int_events; ++ while ((int_events = fec_reg_read(fep, FEC_EIR) & FEC_ENET_MASK) != 0) { ++ if (int_events & ~eimr) { ++ printk(KERN_WARNING "%s: masked interrupt condition: %08x\n", ++ __FUNCTION__, int_events & ~eimr); ++ } ++ ++ fec_reg_write(fep, FEC_EIR, int_events); + + /* Handle receive event in its own function. + */ +- if (int_events & FEC_ENET_RXF) { +- ret = IRQ_HANDLED; ++ if (int_events & (FEC_ENET_RXF | FEC_ENET_RXB)) { ++ DBG(2, "%s: Handling RX Interrupt\n", __FUNCTION__); ++ handled = 1; + fec_enet_rx(dev); + } + ++ if (int_events & FEC_ENET_UN) { ++ printk(KERN_WARNING "TX fifo underrun"); ++ } + /* Transmit OK, or non-fatal error. Update the buffer + descriptors. FEC handles all errors, we just discover + them as part of the transmit process. + */ +- if (int_events & FEC_ENET_TXF) { +- ret = IRQ_HANDLED; ++ if (int_events & (FEC_ENET_TXF | FEC_ENET_TXB)) { ++ DBG(2, "%s: Handling TX Interrupt\n", __FUNCTION__); ++ handled = 1; + fec_enet_tx(dev); + } + +- if (int_events & FEC_ENET_MII) { +- ret = IRQ_HANDLED; ++ if (int_events & (FEC_ENET_MII | FEC_ENET_HBERR)) { ++ DBG(2, "%s: Handling MII Interrupt\n", __FUNCTION__); ++ handled = 1; + fec_enet_mii(dev); + } +- +- } while (int_events); +- +- return ret; ++ } ++ return IRQ_RETVAL(handled); + } + ++static void fec_free_skb(struct fec_enet_private *fep, cbd_t *bdp, struct sk_buff **pskb) ++{ ++ struct sk_buff *skb = *pskb; ++ if (!dma_mapping_error(fep->dma_dev, bdp->cbd_bufaddr)) { ++ fec_enet_txbuf_unmap(fep, bdp, skb->len); ++ } ++ dev_kfree_skb_any(skb); ++ *pskb = NULL; ++} + + static void + fec_enet_tx(struct net_device *dev) + { +- struct fec_enet_private *fep; +- volatile cbd_t *bdp; ++ struct fec_enet_private *fep = netdev_priv(dev); ++ cbd_t *bdp; + unsigned short status; +- struct sk_buff *skb; ++ struct sk_buff *skb; + +- fep = netdev_priv(dev); +- 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) + if (status & (BD_ENET_TX_HB | BD_ENET_TX_LC | + BD_ENET_TX_RL | BD_ENET_TX_UN | + BD_ENET_TX_CSL)) { +- dev->stats.tx_errors++; ++ fep->stats.tx_errors++; + if (status & BD_ENET_TX_HB) /* No heartbeat */ +- dev->stats.tx_heartbeat_errors++; ++ fep->stats.tx_heartbeat_errors++; + if (status & BD_ENET_TX_LC) /* Late collision */ +- dev->stats.tx_window_errors++; ++ fep->stats.tx_window_errors++; + if (status & BD_ENET_TX_RL) /* Retrans limit */ +- dev->stats.tx_aborted_errors++; ++ fep->stats.tx_aborted_errors++; + if (status & BD_ENET_TX_UN) /* Underrun */ +- dev->stats.tx_fifo_errors++; ++ fep->stats.tx_fifo_errors++; + if (status & BD_ENET_TX_CSL) /* Carrier lost */ +- dev->stats.tx_carrier_errors++; ++ fep->stats.tx_carrier_errors++; + } else { +- dev->stats.tx_packets++; ++ fep->stats.tx_packets++; + } + +-#ifndef final_version ++#ifdef DEBUG + 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) + * 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); +- fep->tx_skbuff[fep->skb_dirty] = NULL; ++ fec_free_skb(fep, bdp, &fep->tx_skbuff[fep->skb_dirty]); + 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) + */ + if (fep->tx_full) { + fep->tx_full = 0; +- if (netif_queue_stopped(dev)) ++ if (netif_queue_stopped(dev)) { ++ DBG(0, "%s: Waking up netif queue\n", __FUNCTION__); + netif_wake_queue(dev); ++ } + } + } +- fep->dirty_tx = (cbd_t *)bdp; +- spin_unlock_irq(&fep->hw_lock); ++ fec_enet_cbd_put(fep); ++ fep->dirty_tx = bdp; ++ spin_unlock(&fep->lock); + } + + +@@ -555,22 +834,22 @@ fec_enet_tx(struct net_device *dev) + static void + fec_enet_rx(struct net_device *dev) + { +- struct fec_enet_private *fep; +- volatile fec_t *fecp; +- volatile cbd_t *bdp; ++ struct fec_enet_private *fep = netdev_priv(dev); ++ cbd_t *bdp; + unsigned short status; +- struct sk_buff *skb; +- ushort pkt_len; +- __u8 *data; ++ struct sk_buff *skb; ++ ushort pkt_len; ++ int rx_index; + + #ifdef CONFIG_M532x ++ /* This is probably nonsense ++ Proper use of dma-mapping functions should make this obsolete ++ */ + flush_cache_all(); + #endif +- +- fep = netdev_priv(dev); +- fecp = (volatile fec_t*)dev->base_addr; +- +- spin_lock_irq(&fep->hw_lock); ++ /* reserve the dual port memory area for our use */ ++ //WARN_ON(fec_reg_read(fep, FEC_RDAR) & RDAR_BUSY); ++ fec_enet_cbd_get(fep); + + /* 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) + bdp = fep->cur_rx; + + while (!((status = bdp->cbd_sc) & BD_ENET_RX_EMPTY)) { +- +-#ifndef final_version ++ rx_index = bdp - fep->rx_bd_base; ++#ifdef DEBUG + /* Since we have allocated space to hold a complete frame, + * the last indicator should be set. + */ +- if ((status & BD_ENET_RX_LAST) == 0) +- printk("FEC ENET: rcv is not +last\n"); ++ WARN_ON(!(status & BD_ENET_RX_LAST)); + #endif + +- if (!fep->opened) ++ if (WARN_ON(!fep->opened)) { ++ DBG(0, "%s: Driver not opened; ignoring packet\n", __FUNCTION__); ++#if 0 + goto rx_processing_done; +- ++#endif ++ } + /* Check for errors. */ + if (status & (BD_ENET_RX_LG | BD_ENET_RX_SH | BD_ENET_RX_NO | + BD_ENET_RX_CR | BD_ENET_RX_OV)) { +- dev->stats.rx_errors++; ++ fep->stats.rx_errors++; + if (status & (BD_ENET_RX_LG | BD_ENET_RX_SH)) { + /* Frame too long or too short. */ +- dev->stats.rx_length_errors++; ++ fep->stats.rx_length_errors++; + } + if (status & BD_ENET_RX_NO) /* Frame alignment */ +- dev->stats.rx_frame_errors++; ++ fep->stats.rx_frame_errors++; + if (status & BD_ENET_RX_CR) /* CRC Error */ +- dev->stats.rx_crc_errors++; ++ fep->stats.rx_crc_errors++; + if (status & BD_ENET_RX_OV) /* FIFO overrun */ +- dev->stats.rx_fifo_errors++; ++ fep->stats.rx_fifo_errors++; + } + + /* Report late collisions as a frame error. +@@ -611,39 +892,91 @@ 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) { +- dev->stats.rx_errors++; +- dev->stats.rx_frame_errors++; ++ 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 + /* Process the incoming frame. + */ +- dev->stats.rx_packets++; ++ fep->stats.rx_packets++; + pkt_len = bdp->cbd_datlen; +- dev->stats.rx_bytes += pkt_len; +- data = (__u8*)__va(bdp->cbd_bufaddr); +- +- dma_sync_single(NULL, (unsigned long)__pa(data), +- pkt_len - 4, DMA_FROM_DEVICE); ++ fep->stats.rx_bytes += pkt_len; + + /* This does 16 byte alignment, exactly what we need. + * The packet length includes FCS, but we don't want to + * include that when passing upstream as it messes up + * bridging applications. + */ +- skb = dev_alloc_skb(pkt_len-4); ++ if ((pkt_len - 4) < fec_copy_threshold) { ++ skb = dev_alloc_skb(pkt_len); ++ } else { ++ skb = dev_alloc_skb(FEC_ENET_RX_FRSIZE); ++ } + + if (skb == NULL) { + printk("%s: Memory squeeze, dropping packet.\n", dev->name); +- dev->stats.rx_dropped++; ++ fep->stats.rx_dropped++; + } else { +- skb_put(skb,pkt_len-4); /* Make room */ +- skb_copy_to_linear_data(skb, data, pkt_len-4); +- skb->protocol=eth_type_trans(skb,dev); ++ if ((pkt_len - 4) < fec_copy_threshold) { ++ /* skip 2 bytes, so IP header is on a 4 bytes boundary */ ++ skb_reserve(skb, 2); ++ skb_put(skb, pkt_len - 4); /* Make room */ ++ fec_enet_rxbuf_get(fep, bdp, pkt_len - 4); ++ skb_copy_to_linear_data(skb, ++ fep->rx_skbuff[rx_index]->data, ++ pkt_len - 4); ++ fec_enet_rxbuf_put(fep, bdp, pkt_len - 4); ++ } else { ++ struct sk_buff *pskb = fep->rx_skbuff[rx_index]; ++ ++ /* unmap the skb we are going to hand down to the network layer */ ++ fec_enet_rxbuf_unmap(fep, bdp, FEC_ENET_RX_FRSIZE); ++ ++ /* init the newly allocated skb */ ++ fep->rx_skbuff[rx_index] = skb; ++ skb->data = FEC_ADDR_ALIGNMENT(skb->data); ++ /* map the newly allocated skb's data buffer for DMA */ ++ fec_enet_rxbuf_map(fep, bdp, skb->data, FEC_ENET_RX_FRSIZE); ++ ++ skb_put(pskb, pkt_len - 4); /* Make room */ ++ skb = pskb; ++ } ++ skb->dev = dev; ++ skb->protocol = eth_type_trans(skb, dev); + netif_rx(skb); + } + 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 + status |= BD_ENET_RX_EMPTY; + bdp->cbd_sc = status; + ++ /* release the dual port memory area for use by the FEC hardware */ ++ fec_enet_cbd_put(fep); ++ + /* Update BD pointer to next entry. + */ + if (status & BD_ENET_RX_WRAP) +@@ -665,10 +1001,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. + */ +- fecp->fec_r_des_active = 0; ++ fec_reg_write(fep, FEC_RDAR, DONT_CARE); + #endif + } /* while (!((status = bdp->cbd_sc) & BD_ENET_RX_EMPTY)) */ +- fep->cur_rx = (cbd_t *)bdp; ++ fep->cur_rx = bdp; + + #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 + * our way back to the interrupt return only to come right back + * here. + */ +- fecp->fec_r_des_active = 0; ++ fec_reg_write(fep, FEC_RDAR, DONT_CARE); + #endif +- +- spin_unlock_irq(&fep->hw_lock); + } + +- ++#ifdef CONFIG_PHYLIB + /* called from interrupt context */ ++static void fec_enet_mii(struct net_device *dev) ++{ ++ struct fec_enet_private *fep = netdev_priv(dev); ++ fep->mii_complete = 1; ++} ++#else + static void + fec_enet_mii(struct net_device *dev) + { +- struct fec_enet_private *fep; +- volatile fec_t *ep; ++ struct fec_enet_private *fep = netdev_priv(dev); + mii_list_t *mip; + uint mii_reg; + +- fep = netdev_priv(dev); +- spin_lock_irq(&fep->mii_lock); ++ mii_reg = fec_reg_read(fep, FEC_MMFR); + +- ep = fep->hwp; +- mii_reg = ep->fec_mii_data; ++ spin_lock(&fep->lock); + + if ((mip = mii_head) == NULL) { + printk("MII and no head!\n"); +@@ -713,27 +1050,27 @@ fec_enet_mii(struct net_device *dev) + mii_free = mip; + + if ((mip = mii_head) != NULL) +- ep->fec_mii_data = mip->mii_regval; ++ fec_reg_write(fep, FEC_MMFR, mip->mii_regval); + + unlock: +- spin_unlock_irq(&fep->mii_lock); ++ spin_unlock(&fep->lock); + } + + static int + mii_queue(struct net_device *dev, int regval, void (*func)(uint, struct net_device *)) + { +- struct fec_enet_private *fep; ++ struct fec_enet_private *fep = netdev_priv(dev); + unsigned long flags; + mii_list_t *mip; + int retval; + ++ retval = 0; ++ ++ spin_lock_irqsave(&fep->lock,flags); ++ + /* Add PHY address to register command. + */ +- fep = netdev_priv(dev); +- spin_lock_irqsave(&fep->mii_lock, flags); +- + regval |= fep->phy_addr << 23; +- retval = 0; + + if ((mip = mii_free) != NULL) { + mii_free = mip->mii_next; +@@ -745,32 +1082,32 @@ mii_queue(struct net_device *dev, int re + mii_tail = mip; + } else { + mii_head = mii_tail = mip; +- fep->hwp->fec_mii_data = regval; ++ fec_reg_write(fep, FEC_MMFR, regval); + } + } else { + retval = 1; + } + +- spin_unlock_irqrestore(&fep->mii_lock, flags); +- return retval; ++ spin_unlock_irqrestore(&fep->lock,flags); ++ ++ return(retval); + } + + static void mii_do_cmd(struct net_device *dev, const phy_cmd_t *c) + { +- if(!c) +- return; ++ int k; + +- for (; c->mii_data != mk_mii_end; c++) +- mii_queue(dev, c->mii_data, c->funct); ++ for (k = 0; c != NULL && c[k].mii_data != mk_mii_end; k++) { ++ mii_queue(dev, c[k].mii_data, c[k].funct); ++ } + } + + static void mii_parse_sr(uint mii_reg, struct net_device *dev) + { + struct fec_enet_private *fep = netdev_priv(dev); +- volatile uint *s = &(fep->phy_status); + uint status; + +- status = *s & ~(PHY_STAT_LINK | PHY_STAT_FAULT | PHY_STAT_ANC); ++ status = fep->phy_status & ~(PHY_STAT_LINK | PHY_STAT_FAULT | PHY_STAT_ANC); + + if (mii_reg & 0x0004) + status |= PHY_STAT_LINK; +@@ -778,31 +1115,30 @@ static void mii_parse_sr(uint mii_reg, s + status |= PHY_STAT_FAULT; + if (mii_reg & 0x0020) + status |= PHY_STAT_ANC; +- *s = status; ++ ++ fep->phy_status = status; + } + + static void mii_parse_cr(uint mii_reg, struct net_device *dev) + { + struct fec_enet_private *fep = netdev_priv(dev); +- volatile uint *s = &(fep->phy_status); + uint status; + +- status = *s & ~(PHY_CONF_ANE | PHY_CONF_LOOP); ++ status = fep->phy_status & ~(PHY_CONF_ANE | PHY_CONF_LOOP); + + if (mii_reg & 0x1000) + status |= PHY_CONF_ANE; + if (mii_reg & 0x4000) + status |= PHY_CONF_LOOP; +- *s = status; ++ fep->phy_status = status; + } + + static void mii_parse_anar(uint mii_reg, struct net_device *dev) + { + struct fec_enet_private *fep = netdev_priv(dev); +- volatile uint *s = &(fep->phy_status); + uint status; + +- status = *s & ~(PHY_CONF_SPMASK); ++ status = fep->phy_status & ~(PHY_CONF_SPMASK); + + if (mii_reg & 0x0020) + status |= PHY_CONF_10HDX; +@@ -812,7 +1148,7 @@ static void mii_parse_anar(uint mii_reg, + status |= PHY_CONF_100HDX; + if (mii_reg & 0x00100) + status |= PHY_CONF_100FDX; +- *s = status; ++ fep->phy_status = status; + } + + /* ------------------------------------------------------------------------- */ +@@ -827,10 +1163,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); +- volatile uint *s = &(fep->phy_status); + uint status; + +- status = *s & ~(PHY_STAT_SPMASK); ++ status = fep->phy_status & ~(PHY_STAT_SPMASK); + if (mii_reg & 0x0800) { + if (mii_reg & 0x1000) + status |= PHY_STAT_100FDX; +@@ -842,7 +1177,7 @@ static void mii_parse_lxt970_csr(uint mi + else + status |= PHY_STAT_10HDX; + } +- *s = status; ++ fep->phy_status = status; + } + + static phy_cmd_t const phy_cmd_lxt970_config[] = { +@@ -898,16 +1233,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); +- volatile uint *s = &(fep->phy_status); + uint status; + +- status = *s & ~(PHY_STAT_SPMASK | PHY_STAT_LINK | PHY_STAT_ANC); ++ status = fep->phy_status & ~(PHY_STAT_SPMASK | PHY_STAT_LINK | PHY_STAT_ANC); + + if (mii_reg & 0x0400) { +- fep->link = 1; ++ fep->linkstatus = 1; + status |= PHY_STAT_LINK; + } else { +- fep->link = 0; ++ fep->linkstatus = 0; + } + if (mii_reg & 0x0080) + status |= PHY_STAT_ANC; +@@ -925,7 +1259,7 @@ static void mii_parse_lxt971_sr2(uint mi + if (mii_reg & 0x0008) + status |= PHY_STAT_FAULT; + +- *s = status; ++ fep->phy_status = status; + } + + static phy_cmd_t const phy_cmd_lxt971_config[] = { +@@ -982,10 +1316,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); +- volatile uint *s = &(fep->phy_status); + uint status; + +- status = *s & ~(PHY_STAT_SPMASK); ++ status = fep->phy_status & ~(PHY_STAT_SPMASK); + + switch((mii_reg >> 2) & 7) { + case 1: status |= PHY_STAT_10HDX; break; +@@ -994,7 +1327,7 @@ static void mii_parse_qs6612_pcr(uint mi + case 6: status |= PHY_STAT_100FDX; break; + } + +- *s = status; ++ fep->phy_status = status; + } + + static phy_cmd_t const phy_cmd_qs6612_config[] = { +@@ -1052,10 +1385,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); +- volatile uint *s = &(fep->phy_status); + uint status; + +- status = *s & ~(PHY_STAT_SPMASK | PHY_STAT_ANC); ++ status = fep->phy_status & ~(PHY_STAT_SPMASK | PHY_STAT_ANC); + + if (mii_reg & 0x0080) + status |= PHY_STAT_ANC; +@@ -1064,7 +1396,7 @@ static void mii_parse_am79c874_dr(uint m + else + status |= ((mii_reg & 0x0800) ? PHY_STAT_10FDX : PHY_STAT_10HDX); + +- *s = status; ++ fep->phy_status = status; + } + + static phy_cmd_t const phy_cmd_am79c874_config[] = { +@@ -1107,7 +1439,7 @@ static phy_info_t const phy_info_am79c87 + /* register definitions for the 8721 */ + + #define MII_KS8721BL_RXERCR 21 +-#define MII_KS8721BL_ICSR 27 ++#define MII_KS8721BL_ICSR 22 + #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 + static void mii_parse_dp8384x_sr2(uint mii_reg, struct net_device *dev) + { + struct fec_enet_private *fep = netdev_priv(dev); +- volatile uint *s = &(fep->phy_status); + +- *s &= ~(PHY_STAT_SPMASK | PHY_STAT_LINK | PHY_STAT_ANC); ++ fep->phy_status &= ~(PHY_STAT_SPMASK | PHY_STAT_LINK | PHY_STAT_ANC); + + /* Link up */ + if (mii_reg & 0x0001) { +- fep->link = 1; +- *s |= PHY_STAT_LINK; ++ fep->linkstatus = 1; ++ fep->phy_status |= PHY_STAT_LINK; + } else +- fep->link = 0; ++ fep->linkstatus = 0; + /* Status of link */ + if (mii_reg & 0x0010) /* Autonegotioation complete */ +- *s |= PHY_STAT_ANC; ++ fep->phy_status |= PHY_STAT_ANC; + if (mii_reg & 0x0002) { /* 10MBps? */ + if (mii_reg & 0x0004) /* Full Duplex? */ +- *s |= PHY_STAT_10FDX; ++ fep->phy_status |= PHY_STAT_10FDX; + else +- *s |= PHY_STAT_10HDX; ++ fep->phy_status |= PHY_STAT_10HDX; + } else { /* 100 Mbps? */ + if (mii_reg & 0x0004) /* Full Duplex? */ +- *s |= PHY_STAT_100FDX; ++ fep->phy_status |= PHY_STAT_100FDX; + else +- *s |= PHY_STAT_100HDX; ++ fep->phy_status |= PHY_STAT_100HDX; + } + if (mii_reg & 0x0008) +- *s |= PHY_STAT_FAULT; ++ fep->phy_status |= PHY_STAT_FAULT; + } + + static phy_info_t phy_info_dp83848= { +@@ -1211,92 +1542,362 @@ static phy_info_t const * const phy_info + &phy_info_dp83848, + NULL + }; +- +-/* ------------------------------------------------------------------------- */ +-#ifdef HAVE_mii_link_interrupt +-static irqreturn_t +-mii_link_interrupt(int irq, void * dev_id); ++#endif + + /* +- * This is specific to the MII interrupt setup of the M5272EVB. ++ * do some initializtion based architecture of this chip ++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; +-} +-#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) ++ 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__, ++ fep->linkstatus, phydev->link, fep->full_duplex ? "full" : "half", ++ phydev->duplex ? "full" : "half"); ++ if (phydev->link) { ++ fec_restart(dev, phydev->duplex); ++ } else { ++ fec_stop(dev); ++ } ++ if (fep->linkstatus != phydev->link && netif_msg_link(fep)) { ++ phy_print_status(phydev); ++ } ++ fep->linkstatus = phydev->link; ++#if 0 ++ int i; ++ for (i = 0; i < 32; i++) { ++ DBG(0, "%s: PHY reg[%02x]=%04x\n", __FUNCTION__, i, ++ fec_mii_read(fep->mii, fep->phy_addr, i)); ++ } ++#endif ++ } ++} ++#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; ++ 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; ++ } ++ fec_restart(dev, duplex); ++ 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]; ++ 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 fec_phy_timer(unsigned long data) + { ++ struct net_device *dev = (struct net_device *)data; + struct fec_enet_private *fep = netdev_priv(dev); +- volatile uint *s = &(fep->phy_status); ++ 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 ++ ++/* ++ * 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); ++ ++ fep->etn_irq = platform_get_irq(pdev, 0); ++ fep->mii_irq = platform_get_irq(pdev, 1); ++ ++ /* Setup interrupt handlers. */ ++ ret = request_irq(fep->etn_irq, fec_enet_interrupt, 0, "fec", dev); ++ if (ret != 0) { ++ printk(KERN_ERR "FEC: Could not allocate FEC IRQ(%d)!\n", fep->etn_irq); ++ return ret; ++ } ++#ifndef CONFIG_PHYLIB ++ if (fep->mii_irq >= 0) { ++ /* TODO: disable now due to CPLD issue */ ++ ret = request_irq(fep->mii_irq, mii_link_interrupt, 0, "fec(MII)", dev); ++ if (ret != 0) { ++ printk(KERN_ERR "FEC: Could not allocate FEC(MII) IRQ(%d)!\n", ++ fep->mii_irq); ++ free_irq(fep->etn_irq, dev); ++ return ret; ++ } ++ /* ++ * 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. ++ */ ++ fep->phy_int_enabled = 1; ++ } else { ++ fep->phy_timer = kzalloc(sizeof(struct timer_list), GFP_KERNEL); ++ if (fep->phy_timer == NULL) { ++ free_irq(fep->etn_irq, dev); ++ return -ENOMEM; ++ } ++ init_timer(fep->phy_timer); ++ fep->phy_timer->function = fec_phy_timer; ++ fep->phy_timer->data = (unsigned long)dev; ++ fec_link_change(dev); ++ } ++#endif ++ ++ return 0; ++} ++ ++static void fec_release_intrs(struct net_device *dev) ++{ ++ struct fec_enet_private *fep = netdev_priv(dev); ++ ++ free_irq(fep->etn_irq, dev); ++#ifndef CONFIG_PHYLIB ++ if (fep->mii_irq >= 0) { ++ free_irq(fep->mii_irq, dev); ++ } ++#endif ++} ++ ++#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 ++ ++#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) ++ ++#ifndef DEBUG ++static inline unsigned long fec_reg_read16(struct fec_enet_private *fep, unsigned int reg) ++{ ++ return readw(fep->reg_base + reg); ++} ++ ++static inline void fec_reg_write(struct fec_enet_private *fep, unsigned int reg, unsigned long val) ++{ ++ writew(val, fep->reg_base + reg); ++} ++#else ++#define fec_reg_read16(fep, reg) __fec_reg_read16(fep, reg, __FUNCTION__, #reg) ++#define fec_reg_write16(fep, reg, val) __fec_reg_write16(fep, reg, val, __FUNCTION__, #reg) ++ ++static inline u16 __fec_reg_read16(struct fec_enet_private *fep, unsigned int reg, ++ const char *func, const char *reg_name) ++{ ++ u16 val = readw(fep->reg_base + reg); ++ DBG(0, "%s: Read %04x from %s(%03x)\n", func, val, reg_name, reg); ++ return val; ++} ++ ++static inline void __fec_reg_write16(struct fec_enet_private *fep, unsigned int reg, ++ u16 val, const char *func, const char *reg_name) ++{ ++ DBG(0, "%s: Writing %04x to %s(%03x)\n", func, val, reg_name, reg); ++ writew(val, fep->reg_base + reg); ++} ++#endif ++ ++static void fec_localhw_setup(struct net_device *dev) ++{ ++ struct fec_enet_private *fep = netdev_priv(dev); ++ int loops; ++ const int max_loops = 10000; ++ ++ /* ++ * Set up the MII gasket for RMII mode ++ */ ++ dev_dbg(&dev->dev, "enable RMII gasket\n"); ++ ++ /* disable the gasket and wait */ ++ fec_reg_write16(fep, FEC_MIIGSK_ENR, 0); ++ DBG(0, "%s: Waiting for RMII gasket idle\n", __FUNCTION__); ++ while (fec_reg_read16(fep, FEC_MIIGSK_ENR) & FEC_MIIGSK_ENR_READY) ++ udelay(1); ++ DBG(0, "%s: RMII gasket idle\n", __FUNCTION__); ++ ++ /* 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); ++ ++#if 1 ++ DBG(0, "%s: Waiting for RMII gasket ready\n", __FUNCTION__); ++ for (loops = 0; loops < max_loops; loops++) { ++ if (readw(fep->reg_base + FEC_MIIGSK_ENR) & FEC_MIIGSK_ENR_READY) ++ break; ++ udelay(1); ++ } ++ if (fec_reg_read16(fep, FEC_MIIGSK_ENR) & FEC_MIIGSK_ENR_READY) { ++ DBG(0, "%s: RMII gasket ready after %u loops\n", __FUNCTION__, loops); ++ } else { ++ DBG(0, "%s: RMII gasket NOT ready after %u loops\n", __FUNCTION__, loops); ++ } ++#endif ++} ++#else ++static inline void fec_localhw_setup(struct net_device *dev) ++{ ++} ++#endif ++ ++static int fec_set_mii(struct net_device *dev, struct fec_enet_private *fep) ++{ ++ unsigned long rate; ++ struct clk *clk; ++ ++ DBG(0, "%s: \n", __FUNCTION__); ++ ++ fec_reg_write(fep, FEC_RCR, OPT_FRAME_SIZE | RCR_MII_MODE); ++ fec_reg_write(fep, FEC_TCR, 0x00); ++ ++ /* ++ * Set MII speed to 2.5 MHz ++ */ ++ clk = clk_get(fep->dma_dev, NULL); ++ if (!IS_ERR(clk)) { ++ rate = clk_get_rate(clk); ++ clk_put(clk); ++ } else { ++ printk(KERN_ERR "Failed to get fec clock: %ld\n", PTR_ERR(clk)); ++ return PTR_ERR(clk); ++ } ++ fep->phy_speed = ((((rate + 4999999) / 2500000) / 2) & 0x3F) << 1; ++ fec_reg_write(fep, FEC_MSCR, fep->phy_speed); ++ DBG(0, "%s: clkdiv set to %u for MII clock %u at base clock %lu\n", ++ __FUNCTION__, fep->phy_speed >> 1, 2500000, rate); ++ DBG(0, "%s: actual MII clock is: %lu\n", __FUNCTION__, rate / (fep->phy_speed)); ++ ++ return 0; ++} ++ ++static const unsigned char default_mac[ETH_ALEN] = { ++ 0x00, 0x04, 0x9f, 0x00, 0x74, 0x4a, ++}; ++ ++#define FEC_IIM_BASE IO_ADDRESS(IIM_BASE_ADDR) ++static void fec_get_mac(struct net_device *dev) ++{ ++#if 1 ++ // keep bootloader assigned MAC address ++ struct fec_enet_private *fep = netdev_priv(dev); ++ unsigned long eth_addr = fec_reg_read(fep, FEC_PALR); ++ dev->dev_addr[0] = eth_addr >> 24; ++ dev->dev_addr[1] = eth_addr >> 16; ++ dev->dev_addr[2] = eth_addr >> 8; ++ dev->dev_addr[3] = eth_addr >> 0; ++ eth_addr = fec_reg_read(fep, FEC_PAUR); ++ dev->dev_addr[5] = eth_addr >> 16; ++ dev->dev_addr[4] = eth_addr >> 24; ++#else ++ int i; ++ unsigned long fec_mac_base = FEC_IIM_BASE + MXC_IIMKEY0; ++ ++ if (cpu_is_mx27_rev(CHIP_REV_2_0) > 0) { ++ fec_mac_base = FEC_IIM_BASE + MXC_IIMMAC; ++ } ++ ++ DBG(0, "%s: Reading MAC address from %08lx\n", __FUNCTION__, fec_mac_base); ++ for (i = 0; i < ETH_ALEN; i++) { ++ dev->dev_addr[ETH_ALEN - 1 - i] = __raw_readb(fec_mac_base + i * 4); ++ } ++ //memcpy(dev->dev_addr, default_mac, ETH_ALEN); ++#endif ++} ++ ++#ifdef CONFIG_PHYLIB ++static inline void fec_enable_phy_intr(struct fec_enet_private *fep) ++{ ++} ++static inline void fec_disable_phy_intr(struct fec_enet_private *fep) ++{ ++} ++static inline void fec_phy_ack_intr(struct fec_enet_private *fep) ++{ ++} ++#else ++static inline void fec_enable_phy_intr(struct fec_enet_private *fep) ++{ ++ if (!fep->phy_int_enabled) { ++ fep->phy_int_enabled = 1; ++ enable_irq(fep->mii_irq); ++ } ++} ++ ++static inline void fec_disable_phy_intr(struct fec_enet_private *fep) ++{ ++ if (fep->phy_int_enabled) { ++ disable_irq(fep->mii_irq); ++ fep->phy_int_enabled = 0; ++ } ++} ++ ++static inline void fec_phy_ack_intr(struct fec_enet_private *fep) ++{ ++ if (fep->phy_int_enabled) { ++ disable_irq(fep->mii_irq); ++ fep->phy_int_enabled = 0; ++ } ++} ++#endif ++ ++/* ------------------------------------------------------------------------- */ ++ ++#ifndef CONFIG_PHYLIB ++static void mii_display_status(struct net_device *dev) ++{ ++ struct fec_enet_private *fep = netdev_priv(dev); ++ ++ if (!fep->linkstatus && !fep->old_linkstatus) { ++ /* Link is still down - don't print anything */ + return; + } + + printk("%s: status: ", dev->name); + +- if (!fep->link) { ++ if (!fep->linkstatus) { + printk("link down"); + } else { + printk("link up"); + +- switch(*s & PHY_STAT_SPMASK) { ++ 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) ++ if (fep->phy_status & PHY_STAT_ANC) + printk(", auto-negotiation complete"); + } + +- if (*s & PHY_STAT_FAULT) ++ if (fep->phy_status & PHY_STAT_FAULT) + printk(", remote fault"); + + printk(".\n"); + } + +-static void mii_display_config(struct work_struct *work) ++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; + + /* +@@ -1326,7 +1926,7 @@ static void mii_display_config(struct wo + ** the workqueue. It is thus safe to allow to reuse it. + */ + fep->mii_phy_task_queued = 0; +- printk("%s: config: auto-negotiation ", dev->name); ++ //printk("%s: config: auto-negotiation ", dev->name); + + if (status & PHY_CONF_ANE) + printk("on"); +@@ -1351,11 +1951,21 @@ static void mii_display_config(struct wo + + fep->sequence_done = 1; + } ++#endif + +-static void mii_relink(struct work_struct *work) ++#ifndef CONFIG_PHYLIB ++static inline void *priv_netdev(struct fec_enet_private *fep) + { +- struct fec_enet_private *fep = container_of(work, struct fec_enet_private, phy_task); +- struct net_device *dev = fep->netdev; ++ /* ugly hack, stolen from include linux/netdevice.h */ ++ return (char *)fep - ((sizeof(struct net_device) ++ + NETDEV_ALIGN_CONST) ++ & ~NETDEV_ALIGN_CONST); ++} ++ ++static void mii_relink(struct work_struct *w) ++{ ++ struct fec_enet_private *fep = container_of(w, struct fec_enet_private, phy_task); ++ struct net_device *dev = priv_netdev(fep); + int duplex; + + /* +@@ -1363,23 +1973,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; +- fep->link = (fep->phy_status & PHY_STAT_LINK) ? 1 : 0; ++ fep->linkstatus = (fep->phy_status & PHY_STAT_LINK) ? 1 : 0; + mii_display_status(dev); +- fep->old_link = fep->link; ++ fep->old_linkstatus = fep->linkstatus; + +- if (fep->link) { ++ if (fep->linkstatus) { + duplex = 0; +- if (fep->phy_status +- & (PHY_STAT_100FDX | PHY_STAT_10FDX)) ++ if (fep->phy_status & (PHY_STAT_100FDX | PHY_STAT_10FDX)) { + duplex = 1; ++ } + fec_restart(dev, duplex); +- } else ++ } else { + fec_stop(dev); +- +-#if 0 +- enable_irq(fep->mii_irq); +-#endif +- ++ } + } + + /* mii_queue_relink is called in interrupt context from mii_link_interrupt */ +@@ -1429,15 +2035,14 @@ phy_cmd_t const phy_cmd_config[] = { + static void + mii_discover_phy3(uint mii_reg, struct net_device *dev) + { +- struct fec_enet_private *fep; ++ struct fec_enet_private *fep = netdev_priv(dev); + int i; + +- fep = netdev_priv(dev); + fep->phy_id |= (mii_reg & 0xffff); + printk("fec: PHY @ 0x%x, ID 0x%08x", fep->phy_addr, fep->phy_id); + +- for(i = 0; phy_info[i]; i++) { +- if(phy_info[i]->id == (fep->phy_id >> 4)) ++ for (i = 0; phy_info[i]; i++) { ++ if (phy_info[i]->id == (fep->phy_id >> 4)) + break; + } + +@@ -1456,13 +2061,9 @@ mii_discover_phy3(uint mii_reg, struct n + static void + mii_discover_phy(uint mii_reg, struct net_device *dev) + { +- struct fec_enet_private *fep; +- volatile fec_t *fecp; ++ struct fec_enet_private *fep = netdev_priv(dev); + uint phytype; + +- fep = netdev_priv(dev); +- fecp = fep->hwp; +- + 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 + */ + fep->phy_id = phytype << 16; + mii_queue(dev, mk_mii_read(MII_REG_PHYIR2), +- mii_discover_phy3); ++ mii_discover_phy3); + } else { + fep->phy_addr++; + mii_queue(dev, mk_mii_read(MII_REG_PHYIR1), +- mii_discover_phy); ++ mii_discover_phy); + } + } else { + printk("FEC: No PHY device found.\n"); + /* Disable external MII interface */ +- fecp->fec_mii_speed = fep->phy_speed = 0; +-#ifdef HAVE_mii_link_interrupt +- fec_disable_phy_intr(); +-#endif ++ fec_disable_phy_intr(fep); ++ fec_reg_write(fep, FEC_MSCR, 0); + } + } ++#endif + +-/* This interrupt occurs when the PHY detects a link change. +-*/ +-#ifdef HAVE_mii_link_interrupt ++#ifndef CONFIG_PHYLIB + static irqreturn_t +-mii_link_interrupt(int irq, void * dev_id) ++mii_link_interrupt(int irq, void *dev_id) + { +- struct net_device *dev = dev_id; ++ struct net_device *dev = dev_id; + struct fec_enet_private *fep = netdev_priv(dev); + +- fec_phy_ack_intr(); ++ DBG(0, "%s: \n", __FUNCTION__); + +-#if 0 +- disable_irq(fep->mii_irq); /* disable now, enable later */ +-#endif ++ fec_phy_ack_intr(fep); + +- mii_do_cmd(dev, fep->phy->ack_int); +- mii_do_cmd(dev, phy_cmd_relink); /* restart and display status */ ++ /* ++ * Some board will trigger phy interrupt before phy enable. ++ * And at that moment , fep->phy is not initialized. ++ */ ++ if (fep->phy) { ++ mii_do_cmd(dev, fep->phy->ack_int); ++ mii_do_cmd(dev, phy_cmd_relink); /* restart and display status */ ++ } + + return IRQ_HANDLED; + } +@@ -1511,16 +2113,31 @@ mii_link_interrupt(int irq, void * dev_i + static int + fec_enet_open(struct net_device *dev) + { ++ int ret = 0; + struct fec_enet_private *fep = netdev_priv(dev); + + /* I should reset the ring buffers here, but I don't yet know + * a simple way to do that. + */ +- fec_set_mac_address(dev); ++ DBG(0, "%s: \n", __FUNCTION__); ++ _fec_set_mac_address(dev); + +- fep->sequence_done = 0; +- fep->link = 0; ++#ifdef CONFIG_PHYLIB ++ fec_restart(dev, 0); + ++ ret = fec_connect_phy(dev, fep); ++ if (ret != 0) { ++ DBG(0, "%s: Failed to connect to PHY: %d\n", __FUNCTION__, ret); ++ return ret; ++ } ++ phy_start(fep->phy); ++ ++ fep->linkstatus = fep->phy->link; ++ //fec_restart(dev, 0); ++ DBG(0, "%s: Link status is: %d\n", __FUNCTION__, fep->linkstatus); ++#else ++ fep->linkstatus = 0; ++ fep->sequence_done = 0; + 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) + * based on this device does not implement a PHY interrupt, + * so we are never notified of link change. + */ +- fep->link = 1; ++ fep->linkstatus = 1; + } else { +- fep->link = 1; /* lets just try it and see */ ++ fep->linkstatus = 1; /* lets just try it and see */ + /* no phy, go full duplex, it's most likely a hub chip */ + fec_restart(dev, 1); + } +- +- netif_start_queue(dev); ++ fep->old_linkstatus = fep->linkstatus; ++#endif + fep->opened = 1; +- return 0; /* Success */ ++#if 1 ++ /* enable receiver */ ++ fec_reg_write(fep, FEC_RDAR, DONT_CARE); ++#endif ++ return ret; + } + + static int +@@ -1559,15 +2180,46 @@ fec_enet_close(struct net_device *dev) + { + struct fec_enet_private *fep = netdev_priv(dev); + +- /* Don't know what to do yet. +- */ ++ DBG(0, "%s: \n", __FUNCTION__); ++ + fep->opened = 0; +- netif_stop_queue(dev); +- fec_stop(dev); ++ if (fep->linkstatus) { ++ fec_stop(dev); ++ } ++#ifdef CONFIG_PHYLIB ++ if (fep->phy) { ++ DBG(0, "%s: Stopping PHY %p\n", __FUNCTION__, fep->phy); ++ phy_stop(fep->phy); + ++ DBG(0, "%s: Disconnecting PHY %p\n", __FUNCTION__, fep->phy); ++ phy_disconnect(fep->phy); ++ fep->phy = NULL; ++ } ++#endif ++#if 1 ++ /* Whack a reset. We should wait for this. ++ */ ++ fec_reg_write(fep, FEC_ECR, FEC_ECR_RESET); ++ udelay(10); ++ ++ /* Mask and clear outstanding MII command interrupts. ++ */ ++ fec_reg_write(fep, FEC_EIMR, 0); ++ fec_reg_write(fep, FEC_EIR, FEC_ENET_MII); ++ fec_disable_phy_intr(fep); ++ /* Switch off MII */ ++ fec_reg_write(fep, FEC_MSCR, 0); ++#endif + return 0; + } + ++static struct net_device_stats *fec_enet_get_stats(struct net_device *dev) ++{ ++ struct fec_enet_private *fep = netdev_priv(dev); ++ ++ return &fep->stats; ++} ++ + /* 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) + + static void set_multicast_list(struct net_device *dev) + { +- struct fec_enet_private *fep; +- volatile fec_t *ep; ++ struct fec_enet_private *fep = netdev_priv(dev); + struct dev_mc_list *dmi; + unsigned int i, j, bit, data, crc; + unsigned char hash; + +- fep = netdev_priv(dev); +- ep = fep->hwp; +- +- if (dev->flags&IFF_PROMISC) { +- ep->fec_r_cntrl |= 0x0008; ++ if (dev->flags & IFF_PROMISC) { ++ fec_reg_write(fep, FEC_RCR, fec_reg_read(fep, FEC_RCR) | RCR_PROM); + } else { + +- ep->fec_r_cntrl &= ~0x0008; ++ fec_reg_write(fep, FEC_RCR, fec_reg_read(fep, FEC_RCR) & ~RCR_PROM); + + if (dev->flags & IFF_ALLMULTI) { + /* Catch all multicast addresses, so set the + * filter to all 1's. + */ +- ep->fec_grp_hash_table_high = 0xffffffff; +- ep->fec_grp_hash_table_low = 0xffffffff; ++ fec_reg_write(fep, FEC_IAUR, ~0); ++ fec_reg_write(fep, FEC_IALR, ~0); + } else { + /* Clear filter and add the addresses in hash register. + */ +- ep->fec_grp_hash_table_high = 0; +- ep->fec_grp_hash_table_low = 0; ++ fec_reg_write(fep, FEC_IAUR, 0); ++ fec_reg_write(fep, FEC_IALR, 0); + + dmi = dev->mc_list; + +- for (j = 0; j < dev->mc_count; j++, dmi = dmi->next) +- { ++ for (j = 0; j < dev->mc_count; j++, dmi = dmi->next) { + /* Only support group multicast for now. + */ + if (!(dmi->dmi_addr[0] & 1)) +@@ -1621,13 +2268,11 @@ static void set_multicast_list(struct ne + + /* calculate crc32 value of mac address + */ +- crc = 0xffffffff; ++ crc = ~0; + +- for (i = 0; i < dmi->dmi_addrlen; i++) +- { ++ for (i = 0; i < dmi->dmi_addrlen; i++) { + data = dmi->dmi_addr[i]; +- for (bit = 0; bit < 8; bit++, data >>= 1) +- { ++ for (bit = 0; bit < 8; bit++, data >>= 1) { + crc = (crc >> 1) ^ + (((crc ^ data) & 1) ? CRC32_POLY : 0); + } +@@ -1639,9 +2284,13 @@ static void set_multicast_list(struct ne + hash = (crc >> (32 - HASH_BITS)) & 0x3f; + + if (hash > 31) +- ep->fec_grp_hash_table_high |= 1 << (hash - 32); ++ fec_reg_write(fep, FEC_IAUR, ++ fec_reg_read(fep, FEC_IAUR) | ++ (1 << (hash - 32))); + else +- ep->fec_grp_hash_table_low |= 1 << hash; ++ fec_reg_write(fep, FEC_IALR, ++ fec_reg_read(fep, FEC_IALR) | ++ (1 << hash)); + } + } + } +@@ -1650,106 +2299,272 @@ static void set_multicast_list(struct ne + /* Set a MAC change in hardware. + */ + static void +-fec_set_mac_address(struct net_device *dev) ++_fec_set_mac_address(struct net_device *dev) + { +- volatile fec_t *fecp; +- +- fecp = ((struct fec_enet_private *)netdev_priv(dev))->hwp; ++ struct fec_enet_private *fep = netdev_priv(dev); + + /* Set station address. */ +- fecp->fec_addr_low = dev->dev_addr[3] | (dev->dev_addr[2] << 8) | +- (dev->dev_addr[1] << 16) | (dev->dev_addr[0] << 24); +- fecp->fec_addr_high = (dev->dev_addr[5] << 16) | +- (dev->dev_addr[4] << 24); ++ fec_reg_write(fep, FEC_PALR, dev->dev_addr[3] | (dev->dev_addr[2] << 8) | ++ (dev->dev_addr[1] << 16) | (dev->dev_addr[0] << 24)); ++ 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) ++{ ++ struct sockaddr *addr = _addr; ++ ++ if (!is_valid_ether_addr((const char *)&addr->sa_data)) { ++ printk(KERN_WARNING "Bad ethernet address: %02x:%02x:%02x:%02x:%02x:%02x\n", ++ addr->sa_data[0], addr->sa_data[1], addr->sa_data[2], addr->sa_data[3], ++ addr->sa_data[4], addr->sa_data[5]); ++ return -EINVAL; ++ } ++ printk(KERN_DEBUG "Setting MAC address to %02x:%02x:%02x:%02x:%02x:%02x\n", ++ addr->sa_data[0], addr->sa_data[1], addr->sa_data[2], addr->sa_data[3], ++ addr->sa_data[4], addr->sa_data[5]); ++ ++ memcpy(&dev->dev_addr, &addr->sa_data, ETH_ALEN); + ++ _fec_set_mac_address(dev); ++ ++ return 0; + } + +- /* +- * XXX: We need to clean up on failure exits here. +- * +- * index is only used in legacy code +- */ +-int __init fec_enet_init(struct net_device *dev, int index) ++static void fec_enet_free_buffers(struct fec_enet_private *fep) ++{ ++ cbd_t *bdp = fep->rx_bd_base; ++ int i; ++ ++ DBG(0, "%s: Freeing TX bounce buffers %p\n", __FUNCTION__, fep->tx_bounce[0]); ++ kfree(fep->tx_bounce[0]); ++ memset(fep->tx_bounce, 0, TX_RING_SIZE * sizeof(void*)); ++ for (i = 0; i < RX_RING_SIZE; i++, bdp++) { ++ if (fep->rx_skbuff[i] != NULL) { ++ DBG(0, "%s: Freeing RX skb %p\n", __FUNCTION__, fep->rx_skbuff[i]); ++ fec_enet_rxbuf_unmap(fep, bdp, FEC_ENET_RX_FRSIZE); ++ kfree_skb(fep->rx_skbuff[i]); ++ fep->rx_skbuff[i] = NULL; ++ } ++ } ++} ++ ++#ifdef CONFIG_PHYLIB ++/* called by the generic PHY layer in interrupt context */ ++static int phy_regs[32] = { [0 ... ARRAY_SIZE(phy_regs) - 1] = -1}; ++static int fec_mii_read(struct mii_bus *bus, int phy_id, int regnum) + { ++ int ret; ++ struct net_device *dev = bus->priv; + struct fec_enet_private *fep = netdev_priv(dev); +- unsigned long mem_addr; +- volatile cbd_t *bdp; +- cbd_t *cbd_base; +- volatile fec_t *fecp; +- int i, j; ++ unsigned long regval = mk_mii_read(regnum) | phy_id << 23; ++ unsigned long flags; ++ int loops = 0; + +- /* Allocate memory for buffer descriptors. +- */ +- mem_addr = (unsigned long)dma_alloc_coherent(NULL, PAGE_SIZE, +- &fep->bd_dma, GFP_KERNEL); +- if (mem_addr == 0) { +- printk("FEC: allocate descriptor memory failed?\n"); ++ DBG(1, "%s: \n", __FUNCTION__); ++#if 0 ++ DBG(0, "%s: ECR: %08lx\n", __FUNCTION__, fec_reg_read(fep, FEC_ECR)); ++ DBG(0, "%s: EIR: %08lx\n", __FUNCTION__, fec_reg_read(fep, FEC_EIR)); ++ DBG(0, "%s: EIMR: %08lx\n", __FUNCTION__, fec_reg_read(fep, FEC_EIMR)); ++ DBG(0, "%s: RCR: %08lx\n", __FUNCTION__, fec_reg_read(fep, FEC_RCR)); ++ DBG(0, "%s: TCR: %08lx\n", __FUNCTION__, fec_reg_read(fep, FEC_TCR)); ++#endif ++ spin_lock_irqsave(&fep->lock, flags); ++ fep->mii_complete = 0; ++ fec_reg_write(fep, FEC_MMFR, regval); ++ spin_unlock_irqrestore(&fep->lock, flags); ++ ++ while (!fep->mii_complete) { ++ if (loops++ == 1000) { ++ DBG(1, "%s: Waiting for MII completion\n", __FUNCTION__); ++ } ++ cpu_relax(); ++ } ++ if (loops >= 1000) { ++ DBG(1, "%s: MII transaction completed\n", __FUNCTION__); ++ } ++ ret = fec_reg_read(fep, FEC_MMFR); ++ if (ret < 0) { ++ DBG(0, "%s: Failed to read PHY[%02x] reg %02x: %d\n", __FUNCTION__, ++ phy_id, regnum, ret); ++ return ret; ++ } ++ ret &= 0xffff; ++ if (phy_regs[regnum] != ret) { ++ DBG(1, "%s: Read %04x from PHY[%02x] reg %02x\n", __FUNCTION__, ++ ret, phy_id, regnum); ++ phy_regs[regnum] = ret; ++ } ++ return ret; ++} ++ ++static int fec_mii_write(struct mii_bus *bus, int phy_id, int regnum, u16 val) ++{ ++ struct net_device *dev = bus->priv; ++ struct fec_enet_private *fep = netdev_priv(dev); ++ unsigned long regval = mk_mii_write(regnum, val) | phy_id << 23; ++ unsigned long flags; ++ ++ DBG(0, "%s: \n", __FUNCTION__); ++ ++ spin_lock_irqsave(&fep->lock, flags); ++ fep->mii_complete = 0; ++ fec_reg_write(fep, FEC_MMFR, regval); ++ spin_unlock_irqrestore(&fep->lock, flags); ++ ++ while (!fep->mii_complete) { ++ cpu_relax(); ++ } ++ DBG(1, "%s: Wrote %04x to PHY[%02x] reg %02x\n", __FUNCTION__, val, phy_id, regnum); ++ return 0; ++} ++ ++static int fec_mii_reset(struct mii_bus *bus) ++{ ++ DBG(0, "%s: \n", __FUNCTION__); ++ memset(phy_regs, -1, sizeof(phy_regs)); ++ return 0; ++} ++ ++static int fec_init_phy(struct net_device *dev, struct fec_enet_private *fep) ++{ ++ int ret; ++ int i; ++ struct mii_bus *mii; ++ ++ mii = mdiobus_alloc(); ++ if (mii == NULL) { + return -ENOMEM; + } ++ mii->name = "fec mii"; ++ mii->read = fec_mii_read; ++ mii->write = fec_mii_write; ++ mii->reset = fec_mii_reset; ++ mii->priv = dev; ++ snprintf(mii->id, MII_BUS_ID_SIZE, "%x", 0); ++ mii->irq = kmalloc(sizeof(int) * PHY_MAX_ADDR, GFP_KERNEL); ++ for (i = 0; i < PHY_MAX_ADDR; i++) { ++ mii->irq[i] = fep->mii_irq >= 0 ? fep->mii_irq : PHY_POLL; ++ } ++ ++ ret = mdiobus_register(mii); ++ if (ret != 0) { ++ DBG(0, "%s: Failed to register MII bus: %d\n", __FUNCTION__, ret); ++ kfree(mii->irq); ++ mdiobus_free(mii); ++ return ret; ++ } ++ fep->phy_addr = -1; ++ DBG(0, "%s: MII bus registered\n", __FUNCTION__); ++ for (i = 0; i < PHY_MAX_ADDR; i++) { ++ if (mii->phy_map[i] != NULL) { ++ fep->phy_addr = i; ++ break; ++ } ++ } ++ if (fep->phy_addr == -1) { ++ DBG(0, "%s: No PHY found\n", __FUNCTION__); ++ return -ENODEV; ++ } ++ DBG(0, "%s: Using PHY at addr %02x\n", __FUNCTION__, fep->phy_addr); ++ fep->mii = mii; + +- spin_lock_init(&fep->hw_lock); +- spin_lock_init(&fep->mii_lock); ++ return 0; ++} + +- /* Create an Ethernet device instance. +- */ +- fecp = (volatile fec_t *)dev->base_addr; ++static int fec_connect_phy(struct net_device *dev, struct fec_enet_private *fep) ++{ ++ struct mii_bus *mii = fep->mii; + +- fep->index = index; +- fep->hwp = fecp; +- fep->netdev = dev; ++ DBG(0, "%s: Connecting PHY at addr %02x\n", __FUNCTION__, ++ fep->phy_addr); + +- /* Whack a reset. We should wait for this. +- */ +- fecp->fec_ecntrl = 1; +- udelay(10); ++ fep->phy = phy_connect(dev, dev_name(&mii->phy_map[fep->phy_addr]->dev), ++ fec_link_change, 0, mii->phy_map[fep->phy_addr]->interface); ++ if (IS_ERR(fep->phy)) { ++ int ret = PTR_ERR(fep->phy); ++ printk(KERN_ERR "%s: Could not attach to PHY\n", dev->name); ++ fep->phy = NULL; ++ return ret; ++ } ++ DBG(0, "%s: Registered PHY %s[%02x] IRQ %d with %s\n", __FUNCTION__, ++ dev_name(&fep->phy->dev), fep->phy_addr, fep->phy->irq, dev->name); + +- /* Set the Ethernet address */ +-#ifdef CONFIG_M5272 +- fec_get_mac(dev); ++ return 0; ++} + #else +- { +- unsigned long l; +- l = fecp->fec_addr_low; +- dev->dev_addr[0] = (unsigned char)((l & 0xFF000000) >> 24); +- dev->dev_addr[1] = (unsigned char)((l & 0x00FF0000) >> 16); +- dev->dev_addr[2] = (unsigned char)((l & 0x0000FF00) >> 8); +- dev->dev_addr[3] = (unsigned char)((l & 0x000000FF) >> 0); +- l = fecp->fec_addr_high; +- dev->dev_addr[4] = (unsigned char)((l & 0xFF000000) >> 24); +- dev->dev_addr[5] = (unsigned char)((l & 0x00FF0000) >> 16); +- } ++static int fec_init_phy(struct net_device *dev, struct fec_enet_private *fep) ++{ ++ /* Queue up command to detect the PHY and initialize the ++ * remainder of the interface. ++ */ ++ fep->phy_id_done = 0; ++ fep->phy_addr = 0; ++ mii_queue(dev, mk_mii_read(MII_REG_PHYIR1), mii_discover_phy); ++ ++ return 0; ++} + #endif + +- cbd_base = (cbd_t *)mem_addr; ++/* Initialize the FEC Ethernet on 860T (or ColdFire 5272). ++ */ ++ /* ++ * 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; ++ struct fec_enet_private *fep = netdev_priv(dev); ++ cbd_t *bdp; ++ struct sk_buff *pskb; ++ int i; ++ void *mem; ++ ++ spin_lock_init(&fep->lock); ++ ++ /* Whack a reset. We should wait for this. + */ +- fep->rx_bd_base = cbd_base; +- fep->tx_bd_base = cbd_base + RX_RING_SIZE; ++ fec_reg_write(fep, FEC_ECR, FEC_ECR_RESET); ++ udelay(10); ++ ++ /* Set the Ethernet address. If using multiple Enets on the 8xx, ++ * this needs some work to get unique addresses. ++ * ++ * This is our default MAC address unless the user changes ++ * it via eth_mac_addr (our dev->set_mac_addr handler). ++ */ ++ fec_get_mac(dev); + + fep->dirty_tx = fep->cur_tx = fep->tx_bd_base; + fep->cur_rx = fep->rx_bd_base; + + fep->skb_cur = fep->skb_dirty = 0; + +- /* Initialize the receive buffer descriptors. ++ /* allocate memory for TX bounce buffers */ ++ mem = kzalloc(TX_RING_SIZE * FEC_ENET_TX_FRSIZE, GFP_KERNEL); ++ if (mem == NULL) { ++ return -ENOMEM; ++ } ++ ++ fec_enet_cbd_get(fep); ++ ++ /* Initialize the transmit buffer descriptors. + */ +- bdp = fep->rx_bd_base; +- for (i=0; itx_bd_base; + +- /* Allocate a page. +- */ +- mem_addr = __get_free_page(GFP_KERNEL); +- /* XXX: missing check for allocation failure */ ++ DBG(0, "%s: Allocated %d byte of TX buffer memory @ %p\n", __FUNCTION__, ++ TX_RING_SIZE * FEC_ENET_TX_FRSIZE, mem); ++ for (i = 0; i < TX_RING_SIZE; i++) { ++ fep->tx_bounce[i] = mem; ++ DBG(0, "%s: TX bounce buffer[%d]=%p\n", __FUNCTION__, i, fep->tx_bounce[i]); ++ mem = (void *)((unsigned long)(mem + FEC_ENET_TX_FRSIZE)); + + /* Initialize the BD for every fragment in the page. + */ +- for (j=0; jcbd_sc = BD_ENET_RX_EMPTY; +- bdp->cbd_bufaddr = __pa(mem_addr); +- mem_addr += FEC_ENET_RX_FRSIZE; +- bdp++; +- } ++ bdp->cbd_bufaddr = ~0; ++ bdp++; + } + + /* Set the last buffer to wrap. +@@ -1757,87 +2572,88 @@ int __init fec_enet_init(struct net_devi + bdp--; + bdp->cbd_sc |= BD_SC_WRAP; + +- /* ...and the same for transmmit. ++ /* ...and the same for receive. + */ +- bdp = fep->tx_bd_base; +- for (i=0, j=FEC_ENET_TX_FRPPG; i= FEC_ENET_TX_FRPPG) { +- mem_addr = __get_free_page(GFP_KERNEL); +- j = 1; +- } else { +- mem_addr += FEC_ENET_TX_FRSIZE; +- j++; ++ bdp = fep->rx_bd_base; ++ for (i = 0; i < RX_RING_SIZE; i++, bdp++) { ++ pskb = __dev_alloc_skb(FEC_ENET_RX_FRSIZE, GFP_KERNEL); ++ if (pskb == NULL) { ++ DBG(0, "%s: Failed to allocate RX skb; cleaning up\n", __FUNCTION__); ++ ret = -ENOMEM; ++ goto cleanup; + } +- fep->tx_bounce[i] = (unsigned char *) mem_addr; +- +- /* Initialize the BD for every fragment in the page. +- */ +- bdp->cbd_sc = 0; +- bdp->cbd_bufaddr = 0; +- bdp++; ++ DBG(0, "%s: RX skb allocated @ %p\n", __FUNCTION__, pskb); ++ fep->rx_skbuff[i] = pskb; ++ pskb->data = FEC_ADDR_ALIGNMENT(pskb->data); ++ bdp->cbd_sc = BD_ENET_RX_EMPTY; ++ bdp->cbd_bufaddr = ~0; ++ fec_enet_rxbuf_map(fep, bdp, pskb->data, FEC_ENET_RX_FRSIZE); + } +- + /* Set the last buffer to wrap. + */ + bdp--; + bdp->cbd_sc |= BD_SC_WRAP; ++ fec_enet_cbd_put(fep); + + /* Set receive and transmit descriptor base. + */ +- fecp->fec_r_des_start = fep->bd_dma; +- fecp->fec_x_des_start = (unsigned long)fep->bd_dma + sizeof(cbd_t) +- * RX_RING_SIZE; +- +-#ifdef HAVE_mii_link_interrupt +- fec_request_mii_intr(dev); +-#endif +- +- fecp->fec_grp_hash_table_high = 0; +- fecp->fec_grp_hash_table_low = 0; +- fecp->fec_r_buff_size = PKT_MAXBLR_SIZE; +- fecp->fec_ecntrl = 2; +- fecp->fec_r_des_active = 0; +-#ifndef CONFIG_M5272 +- fecp->fec_hash_table_high = 0; +- fecp->fec_hash_table_low = 0; +-#endif ++ fec_reg_write(fep, FEC_ERDSR, fep->cbd_phys_base); ++ fec_reg_write(fep, FEC_ETDSR, fep->cbd_phys_base + RX_RING_SIZE * sizeof(cbd_t)); + ++ /* Install our interrupt handlers. This varies depending on ++ * the architecture. ++ */ ++ ret = fec_request_intrs(pdev, dev); ++ if (ret != 0) { ++ goto cleanup; ++ } ++ /* Clear and enable interrupts */ ++ fec_reg_write(fep, FEC_EIR, fec_reg_read(fep, FEC_EIR)); ++ fec_reg_write(fep, FEC_EIMR, FEC_ENET_TXF | FEC_ENET_TXB | ++ FEC_ENET_RXF | FEC_ENET_RXB | FEC_ENET_MII); ++ ++ fec_reg_write(fep, FEC_IAUR, 0); ++ fec_reg_write(fep, FEC_IALR, 0); ++ fec_reg_write(fep, FEC_EMRBR, PKT_MAXBLR_SIZE); ++ fec_reg_write(fep, FEC_ECR, FEC_ECR_ETHER_EN); ++ fec_localhw_setup(dev); ++#if 0 ++ /* do this in enet_open()! */ ++ fec_reg_write(fep, FEC_RDAR, DONT_CARE); ++#endif + /* The FEC Ethernet specific entries in the device structure. */ + dev->open = fec_enet_open; + dev->hard_start_xmit = fec_enet_start_xmit; + dev->tx_timeout = fec_timeout; + dev->watchdog_timeo = TX_TIMEOUT; + dev->stop = fec_enet_close; ++ dev->get_stats = fec_enet_get_stats; + dev->set_multicast_list = set_multicast_list; ++ dev->set_mac_address = fec_set_mac_address; + +- for (i=0; ifec_r_cntrl = OPT_FRAME_SIZE | 0x04; +- fecp->fec_x_cntrl = 0x00; +- +- /* +- * Set MII speed to 2.5 MHz +- */ +- fep->phy_speed = ((((clk_get_rate(fep->clk) / 2 + 4999999) +- / 2500000) / 2) & 0x3F) << 1; +- fecp->fec_mii_speed = fep->phy_speed; +- fec_restart(dev, 0); +- +- /* Clear and enable interrupts */ +- fecp->fec_ievent = 0xffc00000; +- fecp->fec_imask = (FEC_ENET_TXF | FEC_ENET_RXF | FEC_ENET_MII); +- +- /* Queue up command to detect the PHY and initialize the +- * remainder of the interface. +- */ +- fep->phy_id_done = 0; +- fep->phy_addr = 0; +- mii_queue(dev, mk_mii_read(MII_REG_PHYIR1), mii_discover_phy); ++ ret = fec_set_mii(dev, fep); ++ if (ret) { ++ DBG(0, "%s: Failed to initialize MII interface: %d\n", __FUNCTION__, ret); ++ goto cleanup; ++ } + ++ ret = fec_init_phy(dev, fep); ++ if (ret) { ++ DBG(0, "%s: Failed to initialize PHY: %d\n", __FUNCTION__, ret); ++ goto cleanup; ++ } + return 0; ++ cleanup: ++ fec_enet_free_buffers(fep); ++ fec_enet_cbd_put(fep); ++ return ret; + } + + /* 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 + static void + fec_restart(struct net_device *dev, int duplex) + { +- struct fec_enet_private *fep; +- volatile cbd_t *bdp; +- volatile fec_t *fecp; ++ struct fec_enet_private *fep = netdev_priv(dev); ++ cbd_t *bdp; + int i; ++ u32 rcr = OPT_FRAME_SIZE | RCR_MII_MODE; /* MII enable */ ++ u32 tcr = TCR_HBC; + +- fep = netdev_priv(dev); +- fecp = fep->hwp; +- ++ DBG(0, "%s: Restarting FEC in %s-duplex mode\n", __FUNCTION__, ++ duplex ? "full" : "half"); + /* Whack a reset. We should wait for this. +- */ +- fecp->fec_ecntrl = 1; ++ */ ++ fec_reg_write(fep, FEC_ECR, FEC_ECR_RESET); + udelay(10); + ++ /* Enable interrupts we wish to service. ++ */ ++ fec_reg_write(fep, FEC_EIMR, FEC_ENET_TXF | FEC_ENET_TXB | ++ FEC_ENET_RXF | FEC_ENET_RXB | FEC_ENET_MII); ++ + /* Clear any outstanding interrupt. +- */ +- fecp->fec_ievent = 0xffc00000; ++ * ++ */ ++ fec_reg_write(fep, FEC_EIR, FEC_ENET_MASK); ++ ++ fec_enable_phy_intr(fep); + + /* Set station address. +- */ +- fec_set_mac_address(dev); ++ */ ++ _fec_set_mac_address(dev); + + /* Reset all multicast. +- */ +- fecp->fec_grp_hash_table_high = 0; +- fecp->fec_grp_hash_table_low = 0; ++ */ ++ fec_reg_write(fep, FEC_IAUR, 0); ++ fec_reg_write(fep, FEC_IALR, 0); + + /* Set maximum receive buffer size. +- */ +- fecp->fec_r_buff_size = PKT_MAXBLR_SIZE; ++ */ ++ fec_reg_write(fep, FEC_EMRBR, PKT_MAXBLR_SIZE); + + /* Set receive and transmit descriptor base. +- */ +- fecp->fec_r_des_start = fep->bd_dma; +- fecp->fec_x_des_start = (unsigned long)fep->bd_dma + sizeof(cbd_t) +- * RX_RING_SIZE; ++ */ ++ fec_reg_write(fep, FEC_ERDSR, fep->cbd_phys_base); ++ fec_reg_write(fep, FEC_ETDSR, fep->cbd_phys_base + RX_RING_SIZE * sizeof(cbd_t)); + + fep->dirty_tx = fep->cur_tx = fep->tx_bd_base; + fep->cur_rx = fep->rx_bd_base; + + /* Reset SKB transmit buffers. +- */ ++ */ + fep->skb_cur = fep->skb_dirty = 0; +- for (i=0; i<=TX_RING_MOD_MASK; i++) { ++ bdp = fep->tx_bd_base; ++ for (i = 0; i <= TX_RING_MOD_MASK; i++) { + if (fep->tx_skbuff[i] != NULL) { +- dev_kfree_skb_any(fep->tx_skbuff[i]); +- fep->tx_skbuff[i] = NULL; ++ fec_free_skb(fep, bdp, &fep->tx_skbuff[i]); ++ bdp++; + } + } + + /* Initialize the receive buffer descriptors. +- */ ++ */ + bdp = fep->rx_bd_base; +- for (i=0; icbd_sc = BD_ENET_RX_EMPTY; +@@ -1908,246 +2731,366 @@ fec_restart(struct net_device *dev, int + } + + /* Set the last buffer to wrap. +- */ ++ */ + bdp--; + bdp->cbd_sc |= BD_SC_WRAP; + + /* ...and the same for transmmit. +- */ ++ */ + bdp = fep->tx_bd_base; +- for (i=0; icbd_sc = 0; +- bdp->cbd_bufaddr = 0; ++ bdp->cbd_bufaddr = ~0; + bdp++; + } + + /* Set the last buffer to wrap. +- */ ++ */ + bdp--; + bdp->cbd_sc |= BD_SC_WRAP; + + /* Enable MII mode. +- */ ++ */ + if (duplex) { +- fecp->fec_r_cntrl = OPT_FRAME_SIZE | 0x04;/* MII enable */ +- fecp->fec_x_cntrl = 0x04; /* FD enable */ ++ tcr |= TCR_FDEN; /* FD enable */ + } else { +- /* MII enable|No Rcv on Xmit */ +- fecp->fec_r_cntrl = OPT_FRAME_SIZE | 0x06; +- fecp->fec_x_cntrl = 0x00; ++ rcr |= RCR_DRT; /* No Rcv on Xmit */ + } ++ fec_reg_write(fep, FEC_RCR, rcr); ++ fec_reg_write(fep, FEC_TCR, tcr); + fep->full_duplex = duplex; + + /* Set MII speed. +- */ +- fecp->fec_mii_speed = fep->phy_speed; ++ */ ++ fec_reg_write(fep, FEC_MSCR, fep->phy_speed); + + /* And last, enable the transmit and receive processing. +- */ +- fecp->fec_ecntrl = 2; +- fecp->fec_r_des_active = 0; ++ */ ++ fec_reg_write(fep, FEC_ECR, FEC_ECR_ETHER_EN); ++ fec_localhw_setup(dev); ++ fec_reg_write(fep, FEC_RDAR, DONT_CARE); + +- /* Enable interrupts we wish to service. +- */ +- fecp->fec_imask = (FEC_ENET_TXF | FEC_ENET_RXF | FEC_ENET_MII); ++ DBG(0, "%s: Starting netif queue\n", __FUNCTION__); ++ netif_start_queue(dev); + } + + static void + fec_stop(struct net_device *dev) + { +- volatile fec_t *fecp; +- struct fec_enet_private *fep; ++ struct fec_enet_private *fep = netdev_priv(dev); + +- fep = netdev_priv(dev); +- fecp = fep->hwp; ++ DBG(0, "%s: Stopping netif queue\n", __FUNCTION__); ++ netif_stop_queue(dev); + + /* +- ** We cannot expect a graceful transmit stop without link !!! +- */ +- if (fep->link) +- { +- fecp->fec_x_cntrl = 0x01; /* Graceful transmit stop */ ++ * We cannot expect a graceful transmit stop without link! ++ */ ++ if (fep->linkstatus) { ++ fec_reg_write(fep, FEC_TCR, 0x01); /* Graceful transmit stop */ + udelay(10); +- if (!(fecp->fec_ievent & FEC_ENET_GRA)) +- printk("fec_stop : Graceful transmit stop did not complete !\n"); +- } +- ++ if (!(fec_reg_read(fep, FEC_EIR) & FEC_ENET_GRA)) ++ dev_warn(&dev->dev, "Graceful transmit stop did not complete!\n"); ++ } ++#if 0 + /* Whack a reset. We should wait for this. +- */ +- fecp->fec_ecntrl = 1; ++ */ ++ fec_reg_write(fep, FEC_ECR, FEC_ECR_RESET); + udelay(10); +- +- /* Clear outstanding MII command interrupts. +- */ +- fecp->fec_ievent = FEC_ENET_MII; +- +- fecp->fec_imask = FEC_ENET_MII; +- fecp->fec_mii_speed = fep->phy_speed; ++ /* Mask and clear outstanding MII command interrupts. ++ */ ++ fec_reg_write(fep, FEC_EIMR, 0); ++ fec_reg_write(fep, FEC_EIR, FEC_ENET_MII); ++ fec_enable_phy_intr(fep); ++ fec_reg_write(fep, FEC_MSCR, fep->phy_speed); ++#endif + } + +-static int __devinit +-fec_probe(struct platform_device *pdev) ++static int __devinit fec_enet_probe(struct platform_device *pdev) + { ++ int ret; + struct fec_enet_private *fep; +- struct net_device *ndev; +- int i, irq, ret = 0; +- struct resource *r; +- +- r = platform_get_resource(pdev, IORESOURCE_MEM, 0); +- if (!r) +- return -ENXIO; ++ struct net_device *dev; ++ struct fec_enet_platform_data *pdata = pdev->dev.platform_data; ++ struct resource *res_mem1; ++ struct resource *res_mem2; ++ ++ res_mem1 = platform_get_resource(pdev, IORESOURCE_MEM, 0); ++ if (res_mem1 == NULL) { ++ return -ENODEV; ++ } + +- r = request_mem_region(r->start, resource_size(r), pdev->name); +- if (!r) ++ res_mem1 = request_mem_region(res_mem1->start, ++ resource_size(res_mem1), ++ DRV_NAME); ++ if (res_mem1 == NULL) { + return -EBUSY; ++ } ++ res_mem2 = platform_get_resource(pdev, IORESOURCE_MEM, 1); ++ if (res_mem2 != NULL) { ++ res_mem2 = request_mem_region(res_mem2->start, ++ resource_size(res_mem2), ++ DRV_NAME); ++ if (res_mem2 == NULL) { ++ ret = -EBUSY; ++ goto release1; ++ } ++ } + +- /* Init network device */ +- ndev = alloc_etherdev(sizeof(struct fec_enet_private)); +- if (!ndev) +- return -ENOMEM; +- +- SET_NETDEV_DEV(ndev, &pdev->dev); +- +- /* setup board info structure */ +- fep = netdev_priv(ndev); +- memset(fep, 0, sizeof(*fep)); ++ dev = alloc_etherdev(sizeof(struct fec_enet_private)); ++ if (dev == NULL) { ++ ret = -ENOMEM; ++ goto release2; ++ } ++ platform_set_drvdata(pdev, dev); ++ fep = netdev_priv(dev); ++ fep->res_mem1 = res_mem1; ++ fep->res_mem2 = res_mem2; ++ fep->dma_dev = &pdev->dev; ++ ++ fep->reg_base = ioremap(res_mem1->start, resource_size(res_mem1)); ++ if (fep->reg_base == NULL) { ++ printk("FEC: Mapping FEC registers failed\n"); ++ ret = -ENOMEM; ++ goto free_netdev; ++ } ++ DBG(0, "%s: FEC registers @ %08lx mapped to %p\n", __FUNCTION__, ++ (unsigned long)res_mem1->start, fep->reg_base); + +- ndev->base_addr = (unsigned long)ioremap(r->start, resource_size(r)); ++ fep->mib_base = ioremap(res_mem2->start, resource_size(res_mem2)); ++ if (fep->mib_base == NULL) { ++ printk("FEC: Mapping FEC registers failed\n"); ++ ret = -ENOMEM; ++ goto unmap1; ++ } ++ DBG(0, "%s: FEC registers @ %08lx mapped to %p\n", __FUNCTION__, ++ (unsigned long)res_mem2->start, fep->mib_base); + +- if (!ndev->base_addr) { ++ /* Allocate memory for buffer descriptors. */ ++ fep->cbd_mem_base = dma_alloc_coherent(&pdev->dev, CBD_BUF_SIZE, ++ &fep->cbd_phys_base, ++ GFP_KERNEL); ++ if (fep->cbd_mem_base == NULL) { ++ printk("FEC: allocate descriptor memory failed\n"); + ret = -ENOMEM; +- goto failed_ioremap; ++ goto unmap2; + } ++ DBG(0, "%s: Allocated %lu [(%u + %lu) * %d] byte for CBD buffer @ %p[%08lx]\n", ++ __FUNCTION__, CBD_BUF_SIZE, TX_RING_SIZE, RX_RING_SIZE, ++ sizeof(cbd_t), fep->cbd_mem_base, ++ (unsigned long)fep->cbd_phys_base); + +- platform_set_drvdata(pdev, ndev); ++ /* Set receive and transmit descriptor base. ++ */ ++ fep->rx_bd_base = fep->cbd_mem_base; ++ fep->tx_bd_base = fep->rx_bd_base + RX_RING_SIZE; + +- /* This device has up to three irqs on some platforms */ +- for (i = 0; i < 3; i++) { +- irq = platform_get_irq(pdev, i); +- if (i && irq < 0) +- break; +- ret = request_irq(irq, fec_enet_interrupt, IRQF_DISABLED, pdev->name, ndev); +- if (ret) { +- while (i >= 0) { +- irq = platform_get_irq(pdev, i); +- free_irq(irq, ndev); +- i--; +- } +- goto failed_irq; +- } ++ printk("FEC ENET Driver\n"); ++ ret = platform_func(pdata->arch_init, pdev); ++ if (ret != 0) { ++ dev_err(&pdev->dev, "platform init failed: %d\n", ret); ++ goto free_dma; + } + +- fep->clk = clk_get(&pdev->dev, "fec_clk"); +- if (IS_ERR(fep->clk)) { +- ret = PTR_ERR(fep->clk); +- goto failed_clk; ++ ret = fec_enet_init(pdev, dev); ++ if (ret != 0) { ++ goto fec_disable; + } +- clk_enable(fep->clk); + +- ret = fec_enet_init(ndev, 0); +- if (ret) +- goto failed_init; ++ /* Enable most messages by default */ ++ fep->msg_enable = (NETIF_MSG_IFUP << 1) - 1; ++ ret = register_netdev(dev); ++ if (ret != 0) { ++ /* XXX: missing cleanup here */ ++ goto free_buffers; ++ } + +- ret = register_netdev(ndev); +- if (ret) +- goto failed_register; ++ printk(KERN_INFO "%s: ethernet %02x:%02x:%02x:%02x:%02x:%02x\n", dev->name, ++ dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2], ++ dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5]); + + return 0; + +-failed_register: +-failed_init: +- clk_disable(fep->clk); +- clk_put(fep->clk); +-failed_clk: +- for (i = 0; i < 3; i++) { +- irq = platform_get_irq(pdev, i); +- if (irq > 0) +- free_irq(irq, ndev); +- } +-failed_irq: +- iounmap((void __iomem *)ndev->base_addr); +-failed_ioremap: +- free_netdev(ndev); ++ free_buffers: ++ fec_enet_free_buffers(fep); ++ ++ fec_disable: ++ platform_func(pdata->arch_exit, pdev); ++ ++ free_dma: ++ dma_free_coherent(&pdev->dev, CBD_BUF_SIZE, fep->cbd_mem_base, fep->cbd_phys_base); ++ ++ unmap2: ++ if (fep->mib_base) ++ iounmap(fep->mib_base); ++ ++ unmap1: ++ iounmap(fep->reg_base); ++ ++ free_netdev: ++ free_netdev(dev); ++ ++ release2: ++ if (res_mem2 != NULL) { ++ release_resource(res_mem2); ++ } ++ ++ release1: ++ release_resource(res_mem1); + + return ret; + } + +-static int __devexit +-fec_drv_remove(struct platform_device *pdev) ++static int __devexit fec_enet_remove(struct platform_device *pdev) + { +- struct net_device *ndev = platform_get_drvdata(pdev); +- struct fec_enet_private *fep = netdev_priv(ndev); ++ struct net_device *dev = platform_get_drvdata(pdev); ++ 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); ++ mdiobus_unregister(fep->mii); ++ } ++ mdiobus_free(fep->mii); ++#endif ++ fec_release_intrs(dev); ++ ++ DBG(0, "%s: Unmapping FEC registers %p\n", __FUNCTION__, fep->reg_base); ++ iounmap(fep->reg_base); ++ if (fep->mib_base) ++ iounmap(fep->mib_base); ++ ++ fec_enet_free_buffers(fep); + +- platform_set_drvdata(pdev, NULL); ++ DBG(0, "%s: Freeing CBD buffer area %p[%08lx]\n", __FUNCTION__, ++ fep->cbd_mem_base, (unsigned long)fep->cbd_phys_base); ++ dma_free_coherent(&pdev->dev, CBD_BUF_SIZE, fep->cbd_mem_base, fep->cbd_phys_base); + +- fec_stop(ndev); +- clk_disable(fep->clk); +- clk_put(fep->clk); +- iounmap((void __iomem *)ndev->base_addr); +- unregister_netdev(ndev); +- free_netdev(ndev); ++ release_resource(fep->res_mem1); ++ if (fep->res_mem2 != NULL) { ++ release_resource(fep->res_mem2); ++ } + return 0; + } + +-static int +-fec_suspend(struct platform_device *dev, pm_message_t state) ++static void fec_enet_shutdown(struct platform_device *pdev) + { +- struct net_device *ndev = platform_get_drvdata(dev); +- struct fec_enet_private *fep; ++ struct fec_enet_platform_data *pdata = pdev->dev.platform_data; ++ ++ DBG(0, "%s: Shutting down FEC Hardware\n", __FUNCTION__); ++ platform_func(pdata->arch_exit, pdev); ++} ++ ++#ifdef CONFIG_PM ++static int fec_enet_suspend(struct platform_device *pdev, pm_message_t state) ++{ ++ int ret; ++ struct fec_enet_platform_data *pdata = pdev->dev.platform_data; ++ struct net_device *ndev = platform_get_drvdata(pdev); ++ struct fec_enet_private *fep = netdev_priv(ndev); + +- if (ndev) { +- fep = netdev_priv(ndev); +- if (netif_running(ndev)) { +- netif_device_detach(ndev); +- fec_stop(ndev); ++ if (netif_running(ndev)) { ++ DBG(0, "%s: Detaching netif\n", __FUNCTION__); ++ netif_device_detach(ndev); ++#ifdef CONFIG_PHYLIB ++ DBG(0, "%s: Disconnecting PHY %p\n", __FUNCTION__, fep->phy); ++ phy_disconnect(fep->phy); ++ fep->phy = NULL; ++#endif ++ } ++#ifndef CONFIG_PHYLIB ++ if (fep->phy_timer) { ++ ret = del_timer_sync(fep->phy_timer); ++ if (ret != 0) { ++ DBG(0, "%s: Failed to delete PHY timer: %d\n", __FUNCTION__, ret); ++ return ret; + } + } +- return 0; ++#endif ++ DBG(0, "%s: Shutting down FEC Hardware %d\n", __FUNCTION__, ++ netif_running(ndev)); ++ ret = platform_func(pdata->suspend, pdev); ++ if (ret != 0 && netif_running(ndev)) { ++ DBG(0, "%s: Failed to suspend: %d\n", __FUNCTION__, ret); ++ /* Undo suspend */ ++#ifdef CONFIG_PHYLIB ++ DBG(0, "%s: Reconnecting PHY\n", __FUNCTION__); ++ if (fec_connect_phy(ndev, fep) != 0) { ++ DBG(0, "%s: Failed to connect to PHY\n", __FUNCTION__); ++ return ret; ++ } ++ phy_start(fep->phy); ++#endif ++ fec_link_change(ndev); ++ netif_device_attach(ndev); ++ } ++ return ret; + } + +-static int +-fec_resume(struct platform_device *dev) ++static int fec_enet_resume(struct platform_device *pdev) + { +- struct net_device *ndev = platform_get_drvdata(dev); ++ int ret; ++ struct fec_enet_platform_data *pdata = pdev->dev.platform_data; ++ struct net_device *ndev = platform_get_drvdata(pdev); + +- if (ndev) { +- if (netif_running(ndev)) { +- fec_enet_init(ndev, 0); +- netif_device_attach(ndev); ++ DBG(0, "%s: Powering up FEC Hardware %d\n", __FUNCTION__, ++ netif_running(ndev)); ++ ret = platform_func(pdata->resume, pdev); ++ if (ret != 0) { ++ DBG(0, "%s: Failed to resume: %d\n", __FUNCTION__, ret); ++ return ret; ++ } ++ if (netif_running(ndev)) { ++#ifdef CONFIG_PHYLIB ++ struct fec_enet_private *fep = netdev_priv(ndev); ++ ++ DBG(0, "%s: Reconnecting PHY\n", __FUNCTION__); ++ ret = fec_connect_phy(ndev, fep); ++ if (ret != 0) { ++ DBG(0, "%s: Failed to connect to PHY: %d\n", __FUNCTION__, ret); ++ return ret; + } ++ phy_start(fep->phy); ++#endif ++ fec_link_change(ndev); ++ netif_device_attach(ndev); + } + return 0; + } ++#else ++#define fec_enet_suspend NULL ++#define fec_enet_resume NULL ++#endif + +-static struct platform_driver fec_driver = { +- .driver = { +- .name = "fec", +- .owner = THIS_MODULE, ++static struct platform_driver fec_enet_driver = { ++ .driver = { ++ .name = DRV_NAME, + }, +- .probe = fec_probe, +- .remove = __devexit_p(fec_drv_remove), +- .suspend = fec_suspend, +- .resume = fec_resume, ++ .probe = fec_enet_probe, ++ .remove = __devexit_p(fec_enet_remove), ++ .shutdown = fec_enet_shutdown, ++ .suspend = fec_enet_suspend, ++ .resume = fec_enet_resume, + }; + +-static int __init +-fec_enet_module_init(void) ++static int __init fec_enet_module_init(void) + { +- printk(KERN_INFO "FEC Ethernet Driver\n"); ++ int ret; ++ ++ ret = platform_driver_register(&fec_enet_driver); + +- return platform_driver_register(&fec_driver); ++ return ret; + } ++module_init(fec_enet_module_init); + +-static void __exit +-fec_enet_cleanup(void) ++static void __exit fec_enet_module_cleanup(void) + { +- platform_driver_unregister(&fec_driver); ++ platform_driver_unregister(&fec_enet_driver); + } +- +-module_exit(fec_enet_cleanup); +-module_init(fec_enet_module_init); ++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 18:43:03.000000000 +0200 +@@ -13,6 +13,15 @@ + #define FEC_H + /****************************************************************************/ + ++/* ++ * dummy value to write into RDAR,TDAR. FEC hardware will scan the TX/RX ++ * descriptors in memory upon any write access to those registers. ++ * The actual value written to those registers does not matter. ++*/ ++#define DONT_CARE 0 ++#define RDAR_BUSY (1 << 24) ++#define TDAR_BUSY (1 << 24) ++ + #if defined(CONFIG_M523x) || defined(CONFIG_M527x) || defined(CONFIG_M528x) || \ + defined(CONFIG_M520x) || defined(CONFIG_M532x) || defined(CONFIG_ARCH_MXC) + /* +@@ -20,6 +29,36 @@ + * registers in the same peripheral device on different models + * of the ColdFire! + */ ++// relying on structure alignment for hardware register is just evil ++#ifndef GARBAGE ++#define FEC_EIR 0x004 ++#define FEC_EIMR 0x008 ++#define FEC_RDAR 0x010 ++#define FEC_TDAR 0x014 ++#define FEC_ECR 0x024 ++#define FEC_MMFR 0x040 ++#define FEC_MSCR 0x044 ++#define FEC_MIBC 0x064 ++#define FEC_RCR 0x084 ++#define FEC_TCR 0x0c4 ++#define FEC_PALR 0x0e4 ++#define FEC_PAUR 0x0e8 ++#define FEC_OPD 0x0ec ++#define FEC_IAUR 0x118 ++#define FEC_IALR 0x11c ++#define FEC_GAUR 0x120 ++#define FEC_GALR 0x124 ++#define FEC_TFWR 0x144 ++#define FEC_FRBR 0x14c ++#define FEC_FRSR 0x150 ++#define FEC_ERDSR 0x180 ++#define FEC_ETDSR 0x184 ++#define FEC_EMRBR 0x188 ++ ++#define FEC_ECR_RESET (1 << 0) ++#define FEC_ECR_ETHER_EN (1 << 1) ++#else ++ + typedef struct fec { + unsigned long fec_reserved0; + unsigned long fec_ievent; /* Interrupt event reg */ +@@ -57,6 +96,7 @@ typedef struct fec { + unsigned long fec_x_des_start; /* Transmit descriptor ring */ + unsigned long fec_r_buff_size; /* Maximum receive buff size */ + } fec_t; ++#endif + + #else + +@@ -88,8 +128,8 @@ typedef struct fec { + unsigned long fec_reserved7[158]; + unsigned long fec_addr_low; /* Low 32bits MAC address */ + unsigned long fec_addr_high; /* High 16bits MAC address */ +- unsigned long fec_grp_hash_table_high;/* High 32bits hash table */ +- unsigned long fec_grp_hash_table_low; /* Low 32bits hash table */ ++ unsigned long fec_hash_table_high; /* High 32bits hash table */ ++ unsigned long fec_hash_table_low; /* Low 32bits hash table */ + unsigned long fec_r_des_start; /* Receive descriptor ring */ + unsigned long fec_x_des_start; /* Transmit descriptor ring */ + unsigned long fec_r_buff_size; /* Maximum receive buff size */ +@@ -103,17 +143,20 @@ typedef struct fec { + /* + * Define the buffer descriptor structure. + */ +-#ifdef CONFIG_ARCH_MXC ++/* Please see "Receive Buffer Descriptor Field Definitions" in Specification. ++ * It's LE. ++ */ ++#if defined(CONFIG_ARCH_MXC) + typedef struct bufdesc { +- unsigned short cbd_datlen; /* Data length */ +- unsigned short cbd_sc; /* Control and status info */ +- unsigned long cbd_bufaddr; /* Buffer address */ ++ unsigned short cbd_datlen; /* Data length */ ++ unsigned short cbd_sc; /* Control and status info */ ++ dma_addr_t cbd_bufaddr; /* Buffer address as seen by FEC Hardware */ + } cbd_t; + #else + typedef struct bufdesc { + unsigned short cbd_sc; /* Control and status info */ + unsigned short cbd_datlen; /* Data length */ +- unsigned long cbd_bufaddr; /* Buffer address */ ++ dma_addr_t cbd_bufaddr; /* Buffer address */ + } cbd_t; + #endif + +@@ -121,7 +164,7 @@ typedef struct bufdesc { + * The following definitions courtesy of commproc.h, which where + * Copyright (c) 1997 Dan Malek (dmalek@jlc.net). + */ +-#define BD_SC_EMPTY ((ushort)0x8000) /* Recieve is empty */ ++#define BD_SC_EMPTY ((ushort)0x8000) /* Receive is empty */ + #define BD_SC_READY ((ushort)0x8000) /* Transmit is ready */ + #define BD_SC_WRAP ((ushort)0x2000) /* Last buffer descriptor */ + #define BD_SC_INTRPT ((ushort)0x1000) /* Interrupt on change */ +@@ -168,5 +211,22 @@ typedef struct bufdesc { + #define BD_ENET_TX_STATS ((ushort)0x03ff) /* All status bits */ + + ++#define RCR_LOOP (1 << 0) ++#define RCR_DRT (1 << 1) ++#define RCR_MII_MODE (1 << 2) ++#define RCR_PROM (1 << 3) ++#define RCR_BC_REJ (1 << 4) ++#define RCR_FCE (1 << 5) ++#define RCR_MAX_FL_SHIFT 16 ++#define RCR_MAX_FL_MASK (0x7ff << (RCR_MAX_FL_SHIFT)) ++#define RCR_MAX_FL_set(n) (((n) << (RCR_MAX_FL_SHIFT)) & (RCR_MAX_FL_MASK)) ++#define RCR_MAX_FL_get(n) (((n) & (RCR_MAX_FL_MASK)) >> (RCR_MAX_FL_SHIFT)) ++ ++#define TCR_GTS (1 << 0) ++#define TCR_HBC (1 << 1) ++#define TCR_FDEN (1 << 2) ++#define TCR_TFCPAUSE (1 << 3) ++#define TCR_RFCPAUSE (1 << 4) ++ + /****************************************************************************/ + #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 18:58:52.000000000 +0200 +@@ -570,7 +570,7 @@ static int imxfb_resume(struct platform_ + #define imxfb_resume NULL + #endif + +-static int __init imxfb_init_fbinfo(struct platform_device *pdev) ++static int __devinit imxfb_init_fbinfo(struct platform_device *pdev) + { + struct imx_fb_platform_data *pdata = pdev->dev.platform_data; + struct fb_info *info = dev_get_drvdata(&pdev->dev); +@@ -636,7 +636,7 @@ static int __init imxfb_init_fbinfo(stru + return 0; + } + +-static int __init imxfb_probe(struct platform_device *pdev) ++static int __devinit imxfb_probe(struct platform_device *pdev) + { + struct imxfb_info *fbi; + struct fb_info *info; +@@ -754,7 +754,7 @@ failed_map: + failed_getclock: + iounmap(fbi->regs); + failed_ioremap: +- release_mem_region(res->start, res->end - res->start); ++ release_mem_region(res->start, resource_size(res)); + failed_req: + kfree(info->pseudo_palette); + failed_init: +@@ -763,7 +763,7 @@ failed_init: + return ret; + } + +-static int __devexit imxfb_remove(struct platform_device *pdev) ++static int imxfb_remove(struct platform_device *pdev) + { + struct imx_fb_platform_data *pdata; + struct fb_info *info = platform_get_drvdata(pdev); +@@ -785,7 +785,7 @@ static int __devexit imxfb_remove(struct + framebuffer_release(info); + + iounmap(fbi->regs); +- release_mem_region(res->start, res->end - res->start + 1); ++ release_mem_region(res->start, resource_size(res)); + clk_disable(fbi->clk); + clk_put(fbi->clk); + +@@ -794,7 +794,7 @@ static int __devexit imxfb_remove(struct + return 0; + } + +-void imxfb_shutdown(struct platform_device * dev) ++void imxfb_shutdown(struct platform_device *dev) + { + struct fb_info *info = platform_get_drvdata(dev); + struct imxfb_info *fbi = info->par; +@@ -804,7 +804,8 @@ void imxfb_shutdown(struct platform_dev + static struct platform_driver imxfb_driver = { + .suspend = imxfb_suspend, + .resume = imxfb_resume, +- .remove = __devexit_p(imxfb_remove), ++// .remove = __devexit_p(imxfb_remove), ++ .remove = imxfb_remove, + .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-03-16 12:49:03.000000000 +0100 +@@ -0,0 +1,26 @@ ++/* ++ * Copyright (C) 2007 Lothar Wassmann ++ * ++ * platform_data definitions for fec_enet device ++ * ++ * 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 ++ */ ++ ++struct fec_enet_platform_data { ++ /* callback for platform specific initialization */ ++ int (*arch_init)(struct platform_device *dev); ++ void (*arch_exit)(struct platform_device *dev); ++ 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 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"; + static int recursion_bug; +-static int new_text_line = 1; ++ static int new_text_line = 1; + static char printk_buf[1024]; + ++#ifdef CONFIG_DEBUG_LL ++extern void asmlinkage printascii(const char *); ++#endif + asmlinkage int vprintk(const char *fmt, va_list args) + { + int printed_len = 0; +@@ -687,6 +690,9 @@ asmlinkage int vprintk(const char *fmt, + sizeof(printk_buf) - printed_len, fmt, args); + + ++#ifdef CONFIG_DEBUG_LL ++ printascii(printk_buf); ++#endif + /* + * Copy the output into log_buf. If the caller didn't provide + * appropriate log level tags, we insert them here diff --git a/recipes/linux/linux_2.6.30-rc4.bb b/recipes/linux/linux_2.6.30-rc4.bb new file mode 100644 index 0000000000..05af05c72d --- /dev/null +++ b/recipes/linux/linux_2.6.30-rc4.bb @@ -0,0 +1,15 @@ +require linux.inc + +PR = "r0" + +S = "${WORKDIR}/linux-${PV}" + +# Mark archs/machines that this kernel supports +DEFAULT_PREFERENCE = "-1" +DEFAULT_PREFERENCE_tx25 = "1" + +SRC_URI = "${KERNELORG_MIRROR}/pub/linux/kernel/v2.6/testing/linux-${PV}.tar.bz2 \ + file://defconfig" + +SRC_URI_append_tx25 = " linux-2.6.30-rc4-git.patch;patch=1 \ + file://linux-2.6.30-rc4-karo.diff;patch=1" -- cgit v1.2.3 From 778523aa7e71f71b3e2902748fa060bf604ad098 Mon Sep 17 00:00:00 2001 From: Koen Kooi Date: Wed, 1 Jul 2009 08:52:25 +0200 Subject: linux 2.6.30-rc4: stop violation the versioning policy. * it's now 2.6.29+2.6.30-rc4 as it should be * remember: 2.6.30-rc4 > 2.6.30 --- .../linux-2.6.30-rc4/tx25/defconfig | 1211 + .../tx25/linux-2.6.30-rc4-git.patch | 55110 +++++++++++++++++++ .../tx25/linux-2.6.30-rc4-karo.diff | 15337 ++++++ recipes/linux/linux-2.6.30-rc4/tx25/defconfig | 1211 - .../tx25/linux-2.6.30-rc4-git.patch | 55110 ------------------- .../tx25/linux-2.6.30-rc4-karo.diff | 15337 ------ recipes/linux/linux_2.6.30-rc4.bb | 4 +- 7 files changed, 71660 insertions(+), 71660 deletions(-) create mode 100644 recipes/linux/linux-2.6.29+2.6.30-rc4/linux-2.6.30-rc4/tx25/defconfig create mode 100644 recipes/linux/linux-2.6.29+2.6.30-rc4/linux-2.6.30-rc4/tx25/linux-2.6.30-rc4-git.patch create mode 100644 recipes/linux/linux-2.6.29+2.6.30-rc4/linux-2.6.30-rc4/tx25/linux-2.6.30-rc4-karo.diff delete mode 100644 recipes/linux/linux-2.6.30-rc4/tx25/defconfig delete mode 100644 recipes/linux/linux-2.6.30-rc4/tx25/linux-2.6.30-rc4-git.patch delete mode 100644 recipes/linux/linux-2.6.30-rc4/tx25/linux-2.6.30-rc4-karo.diff diff --git a/recipes/linux/linux-2.6.29+2.6.30-rc4/linux-2.6.30-rc4/tx25/defconfig b/recipes/linux/linux-2.6.29+2.6.30-rc4/linux-2.6.30-rc4/tx25/defconfig new file mode 100644 index 0000000000..290f8df24c --- /dev/null +++ b/recipes/linux/linux-2.6.29+2.6.30-rc4/linux-2.6.30-rc4/tx25/defconfig @@ -0,0 +1,1211 @@ +# +# Automatically generated make config: don't edit +# Linux kernel version: 2.6.30-rc4 +# Tue Jun 30 22:46:56 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 is not set +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=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 + +# +# 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_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 + +# +# 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=y +CONFIG_NETCONSOLE_DYNAMIC=y +CONFIG_NETPOLL=y +# CONFIG_NETPOLL_TRAP is not set +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 +# 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 is not set +# CONFIG_LOGO_LINUX_VGA16 is not set +CONFIG_LOGO_LINUX_CLUT224=y +# CONFIG_SOUND 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_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=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 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 --git a/recipes/linux/linux-2.6.29+2.6.30-rc4/linux-2.6.30-rc4/tx25/linux-2.6.30-rc4-git.patch b/recipes/linux/linux-2.6.29+2.6.30-rc4/linux-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/linux-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 ++#ifdef __KERNEL__ + +-#endif ++#include ++#include ++#include ++#include ++ ++#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 ++#include + #include + ++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. ++ * ++ * 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 ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#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 */ ++ .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. +- * +- * 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 +-#include +-#include +-#include +-#include +-#include +-#include +- +-#include +-#include +-#include +- +-#include +-#include +-#include +-#include +- +-#include +-#include +- +-#include +-#include +-#include +- +-#include +-#include +-#include +- +-/* 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 */ +- .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 + #include + #include ++#include + #include + #include + #include +@@ -21,98 +23,50 @@ + #include + + #include ++#include + #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 = ""; ++ ++ /* name */ ++ 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 ++#include ++ ++#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 + #include + #include ++#include ++#include ++ ++#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 ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#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 ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++ ++/* 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 + #include + ++#include + #include + #include + #include +@@ -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 + #include + +-#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 ++ ++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 ++#include ++ ++#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 + #include +-#include ++ + #include + ++#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. ++ * 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 .h, ++ * and the chip/board init code should then explicitly include ++ * .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. + * ++ * 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 + +-#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 + + #include ++#include + #include + + #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. + * ++ * 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 ++#include + #include + + #include +- + #include + +-/* 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. ++ * ++ * 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 ++ ++#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 + #include + ++#include + #include + #include + #include + ++#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 + #include + #include ++#include ++#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 + #include + #include ++#include ++#include ++#include + + #include + #include +@@ -24,8 +27,11 @@ + #include + #include + #include ++#include ++#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 + #include + ++#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 , 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 +-#include +-#include +-#include +-#include +-#include +- +-#include +- +-/* +- * 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 +- * Copyright (C) 2006 Inky Lung +- * Copyright (C) 2006 Pavel Pisa, PiKRON +- * +- * 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 +-#include +-#include +-#include +-#include +-#include +-#include +- +-#include +- +-#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 +- * initial version heavily inspired by +- * linux/arch/arm/mach-pxa/dma.c +- * +- * 2005-04-17 Pavel Pisa +- * Changed to support scatter gather DMA +- * by taking Russell's code from RiscPC +- * +- * 2006-05-31 Pavel Pisa +- * Corrected error handling code. +- * +- */ +- +-#undef DEBUG +- +-#include +-#include +-#include +-#include +-#include +- +-#include +-#include +-#include +-#include +-#include +-#include +- +-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 +-#include +-#include +-#include +-#include +- +-#include +-#include +-#include +- +-#include +-#include +-#include +- +-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<> 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 +- * 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 +- +- .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 +-#include +-#include +- +-#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 /* 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 +-#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 +- +-#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 +- +-/* +- * 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 +- +-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 +- * +- * 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 +- * Copied from the motorola bsp package and added gpio demux +- * interrupt handler +- */ +- +-#include +-#include +-#include +-#include +- +-#include +-#include +- +-#include +- +-/* +- * +- * 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 +- * +- * +- * 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 +-#include +- +-#include +-#include +- +-#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 +- * +- * 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 +- * +- * 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 +-#include +-#include +-#include +-#include +-#include +-#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 +- * +- * 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 +-#include +-#include +-#include +-#include +-#include +-#include +-#include +- +-#include +-#include +- +-#include +-#include +-#include +-#include +-#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 +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +- +-#include +-#include +-#include +-#include +- +-/* 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 + ++#include + #include + + 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 ++#include ++#include + #include ++#include + #include + #include +-#include +-#include + + #include + #include + #include + +-#include +-#include + #include +-#include +-#include ++#include + #include ++#include + #include ++#include ++ + #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 ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#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 + #include + #include ++#include ++#include + #include + #include + #include +@@ -33,9 +35,117 @@ + #include + #include + #include ++#include ++#include ++#include ++#include + + #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 ++ * ++ * 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 ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#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 +-#include +-#include +-#include + #include + #include ++#include ++#include ++#include ++#include + +-#include + #include ++#include ++#include ++ ++#include + #include + #include +-#include +-#ifdef CONFIG_I2C_IMX + #include +-#endif +-#include ++#include + #include +-#include + #include + + #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 + #include + #include ++#include + + #include + +-#include + #include +-#include +-#include + #include ++#include ++#include ++#include + + #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 + #include + #include + #include + #include ++#include + #include + #include ++#include + #include ++#include + + #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 + #include + #include +-#include + #include + #include + #include +@@ -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 + #include + #include ++#include ++#include ++#include + + #include + #include +@@ -32,11 +35,58 @@ + #include + #include + #include ++#include ++#include ++#include ++#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 ++#include + #include +- +-#include ++#include ++#include + #include + #include +-#include ++#include ++#include + +-#include + #include + #include + #include + #include ++#include + #include ++#include + #include + #include +-#include ++#include ++#include + + #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 ++#include ++#include + #include +- ++#include + #include ++#include + +-#include + #include + #include + #include ++#include ++#include + + #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 ++#include ++#include + #include +- ++#include + #include ++#include + +-#include + #include ++#include + #include + #include ++#include + + #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 + #include + #include ++#include ++#include ++#include ++#include + + #include + #include +@@ -37,7 +41,9 @@ + #include + #include + #include ++#include + #include ++#include + #include + #include + #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 ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#if defined CONFIG_I2C_IMX || defined CONFIG_I2C_IMX_MODULE ++#include ++#endif ++#include ++#include ++#include ++ ++#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 + #include + +-#include + #include + #include + #include + #include +-#include + #include + #include + #include +@@ -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 + #include +-#include + #include + #include +-#include + #include + #include + #include +@@ -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 + #include + #include ++#include + + #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 + #include + #include +-#include + #include + + #include +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 + #include + #include +-#include + #include + + #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. + * Copyright (C) 2007 MontaVista Software, Inc. +@@ -36,8 +38,13 @@ + #include + #include + ++/* 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 + #include + #include ++#include + + #include + #include +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 + #endif ++#ifdef CONFIG_MACH_MX21ADS ++#include ++#endif + #ifdef CONFIG_MACH_PCM038 + #include + #endif +@@ -34,6 +37,12 @@ + #ifdef CONFIG_MACH_QONG + #include + #endif ++#ifdef CONFIG_MACH_PCM043 ++#include ++#endif ++#ifdef CONFIG_MACH_MX27_3DS ++#include ++#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 ++ * ++ * 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 ++ ++/* ++ * The naming convention for the pad modes is MX35_PAD___ ++ * If or refers to a GPIO, it is named ++ * GPIO__ 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, ++ * ++ * ++ * 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___ ++ * If or refers to a GPIO, it is named ++ * GPIO__ ++ * ++ */ ++ ++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 +-#include +- +-#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 ++ * Copyright (C) 2009 by Jan Weitzel Phytec Messtechnik 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., 51 Franklin Street, Fifth Floor, Boston, ++ * MA 02110-1301, USA. ++ */ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++ ++#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 + #include + +-#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 + #include + #include ++#include ++ ++ ++/* 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 "); +- +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 + #include + #include +-#include ++ ++/* 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 +- * +- * 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 +-#include +-#include +- +-#include +- +-/* 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 ++ ++#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 , 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, ®_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 , 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 , 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] \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 \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 \n"); +- fprintf(stderr, "\t-O \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 \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 \n"); +- fprintf(stderr, "\t\tMake space for reserve map entries (relevant for \n\t\tdtb and asm output only)\n"); +- fprintf(stderr, "\t-S \n"); +- fprintf(stderr, "\t\tMake the blob at least long (extra space)\n"); +- fprintf(stderr, "\t-p \n"); +- fprintf(stderr, "\t\tAdd padding to the blob of long (extra space)\n"); +- fprintf(stderr, "\t-b \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 , 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 +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +- +-#include +-#include +- +-#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 , 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("\n"); \ +- BEGIN(INITIAL); \ +- } else { \ +- DPRINT("\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); +- } +- +-<*><> { +- 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; +- } +- +-[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; +- } +- +-[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; +- } +- +-[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; +- } +- +-"&/"{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; +- } +- +-[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; +- } +- +-"]" { +- yylloc.file = srcpos_file; +- yylloc.first_line = yylineno; +- DPRINT("/BYTESTRING\n"); +- BEGIN_DEFAULT(); +- return ']'; +- } +- +-{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("\n"); +- BEGIN(BYTESTRING); +- } +- if ((yytext[0] == '{') +- || (yytext[0] == ';')) { +- DPRINT("\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 +-#include +-#include +-#include +- +-/* end standard C headers. */ +- +-/* flex integer type definitions */ +- +-#ifndef FLEXINT_H +-#define FLEXINT_H +- +-/* C99 systems have . 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 +-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 , 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("\n"); \ +- BEGIN(INITIAL); \ +- } else { \ +- DPRINT("\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 +-#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("\n"); +- BEGIN(BYTESTRING); +- } +- if ((yytext[0] == '{') +- || (yytext[0] == ';')) { +- DPRINT("\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 +- +-#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 /* 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 /* 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 /* INFRINGES ON USER NAME SPACE */ +-# elif defined _AIX +-# define YYSTACK_ALLOC __alloca +-# elif defined _MSC_VER +-# include /* 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 /* 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 /* 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 /* 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 : ""; +- 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 , 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 +- +-#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 DT_PROPNODENAME +-%token DT_LITERAL +-%token DT_LEGACYLITERAL +-%token DT_BASE +-%token DT_BYTE +-%token DT_STRING +-%token DT_LABEL +-%token DT_REF +-%token DT_INCBIN +- +-%type propdata +-%type propdataprefix +-%type memreserve +-%type memreserves +-%type v0_memreserve +-%type v0_memreserves +-%type addr +-%type celllist +-%type cellbase +-%type cellval +-%type bytestring +-%type propdef +-%type proplist +- +-%type devicetree +-%type nodedef +-%type subnode +-%type subnodes +-%type 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 : ""; +- 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 , 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 , 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 +-#include +- +-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 +-#include +-#include +- +-#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 , 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 +- +-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 , 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 +-#include +- +-#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 +-#include +- +-#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 +-#include +- +-#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 +-#include +- +-#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 ""; +- else if (errval == 0) +- return ""; +- else if (errval > -FDT_ERRTABSIZE) { +- const char *s = fdt_errtable[-errval].str; +- +- if (s) +- return s; +- } +- +- return ""; +-} +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 +-#include +- +-#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 +-#include +- +-#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 +-#include +- +-#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 +- +-#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 + + 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 '

Linux Kernel HTML Documentation

' >> $(main_idx) && \ + echo '

Kernel Version: $(KERNELVERSION)

' >> $(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 ++ ++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 ++ ++ ++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 ++ */ ++ ++/* ++ * 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 ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++/* 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 ++ * Copyright (C) 2007-2009 Arjan Opmeer + * + * 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 ++ * Copyright (C) 2007-2009 Arjan Opmeer + * + * 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 + * Copyright (c) 2001 Frederic Lepied + * Copyright (c) 2004 Panagiotis Issaris +- * Copyright (c) 2002-2008 Ping Cheng ++ * Copyright (c) 2002-2009 Ping Cheng + * + * 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 " + #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 */ + 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 handler: unexpected completion 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 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 " + #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 + #include + #include ++#include + + #include + #include +@@ -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 + #include + #include +-#include + #include + #include + #include ++#include ++#include ++#include ++#include ++#include + +-#include + #include + #include + #include +-#include + + #include + +@@ -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 ++#include + + #include + + 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 + + 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 , 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, ®_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 , 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 , 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] \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 \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 \n"); ++ fprintf(stderr, "\t-O \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 \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 \n"); ++ fprintf(stderr, "\t\tMake space for reserve map entries (relevant for \n\t\tdtb and asm output only)\n"); ++ fprintf(stderr, "\t-S \n"); ++ fprintf(stderr, "\t\tMake the blob at least long (extra space)\n"); ++ fprintf(stderr, "\t-p \n"); ++ fprintf(stderr, "\t\tAdd padding to the blob of long (extra space)\n"); ++ fprintf(stderr, "\t-b \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 , 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 ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++#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 , 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("\n"); \ ++ BEGIN(INITIAL); \ ++ } else { \ ++ DPRINT("\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); ++ } ++ ++<*><> { ++ 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; ++ } ++ ++[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; ++ } ++ ++[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; ++ } ++ ++[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; ++ } ++ ++"&/"{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; ++ } ++ ++[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; ++ } ++ ++"]" { ++ yylloc.file = srcpos_file; ++ yylloc.first_line = yylineno; ++ DPRINT("/BYTESTRING\n"); ++ BEGIN_DEFAULT(); ++ return ']'; ++ } ++ ++{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("\n"); ++ BEGIN(BYTESTRING); ++ } ++ if ((yytext[0] == '{') ++ || (yytext[0] == ';')) { ++ DPRINT("\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 ++#include ++#include ++#include ++ ++/* end standard C headers. */ ++ ++/* flex integer type definitions */ ++ ++#ifndef FLEXINT_H ++#define FLEXINT_H ++ ++/* C99 systems have . 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 ++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 , 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("\n"); \ ++ BEGIN(INITIAL); \ ++ } else { \ ++ DPRINT("\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 ++#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("\n"); ++ BEGIN(BYTESTRING); ++ } ++ if ((yytext[0] == '{') ++ || (yytext[0] == ';')) { ++ DPRINT("\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 ++ ++#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 /* 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 /* 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 /* INFRINGES ON USER NAME SPACE */ ++# elif defined _AIX ++# define YYSTACK_ALLOC __alloca ++# elif defined _MSC_VER ++# include /* 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 /* 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 /* 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 /* 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 : ""; ++ 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 , 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 ++ ++#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 DT_PROPNODENAME ++%token DT_LITERAL ++%token DT_LEGACYLITERAL ++%token DT_BASE ++%token DT_BYTE ++%token DT_STRING ++%token DT_LABEL ++%token DT_REF ++%token DT_INCBIN ++ ++%type propdata ++%type propdataprefix ++%type memreserve ++%type memreserves ++%type v0_memreserve ++%type v0_memreserves ++%type addr ++%type celllist ++%type cellbase ++%type cellval ++%type bytestring ++%type propdef ++%type proplist ++ ++%type devicetree ++%type nodedef ++%type subnode ++%type subnodes ++%type 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 : ""; ++ 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 , 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 , 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 ++#include ++ ++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 ++#include ++ ++#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 ++#include ++ ++#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 ++#include ++ ++#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 ++#include ++ ++#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 ""; ++ else if (errval == 0) ++ return ""; ++ else if (errval > -FDT_ERRTABSIZE) { ++ const char *s = fdt_errtable[-errval].str; ++ ++ if (s) ++ return s; ++ } ++ ++ return ""; ++} +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 ++#include ++ ++#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 ++#include ++ ++#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 ++#include ++#include ++ ++#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 ++#include ++ ++#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 ++ ++#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 , 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 ++ ++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 , 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 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 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.29+2.6.30-rc4/linux-2.6.30-rc4/tx25/linux-2.6.30-rc4-karo.diff b/recipes/linux/linux-2.6.29+2.6.30-rc4/linux-2.6.30-rc4/tx25/linux-2.6.30-rc4-karo.diff new file mode 100644 index 0000000000..17765b46f6 --- /dev/null +++ b/recipes/linux/linux-2.6.29+2.6.30-rc4/linux-2.6.30-rc4/tx25/linux-2.6.30-rc4-karo.diff @@ -0,0 +1,15337 @@ +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-08 13:11:18.000000000 +0200 +@@ -0,0 +1,1203 @@ ++# ++# Automatically generated make config: don't edit ++# Linux kernel version: 2.6.30-rc4 ++# Fri Jun 5 21:17: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_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 is not set ++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=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 ++ ++# ++# 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_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 ++ ++# ++# 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=y ++CONFIG_NETCONSOLE_DYNAMIC=y ++CONFIG_NETPOLL=y ++# CONFIG_NETPOLL_TRAP is not set ++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 ++# 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-08 13:11:18.000000000 +0200 +@@ -0,0 +1,1203 @@ ++# ++# Automatically generated make config: don't edit ++# Linux kernel version: 2.6.30-rc4 ++# Fri Jun 5 21:17: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_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 is not set ++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=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 ++ ++# ++# 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_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 ++ ++# ++# 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=y ++CONFIG_NETCONSOLE_DYNAMIC=y ++CONFIG_NETPOLL=y ++# CONFIG_NETPOLL_TRAP is not set ++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 ++# 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/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-08 12:45:22.000000000 +0200 +@@ -6,14 +6,26 @@ choice + + config MACH_MX21 + bool "i.MX21 support" ++ select ARCH_MXC_IOMUX_V2 ++ select ARCH_MXC_HAS_NFC_V1 + help + This enables support for Freescale's MX2 based i.MX21 processor. + + config MACH_MX27 + bool "i.MX27 support" ++ select ARCH_MXC_IOMUX_V2 ++ select ARCH_MXC_HAS_NFC_V1 + 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_V1_1 ++ select PHYLIB if FEC ++ help ++ This enables support for Freescale's MX2 based i.MX25 processor. ++ + endchoice + + comment "MX2 platforms:" +@@ -39,6 +51,26 @@ config MACH_PCM038 + Include support for phyCORE-i.MX27 (aka pcm038) platform. This + includes specific configurations for the module and its peripherals. + ++config MACH_TX25 ++ bool "Support Ka-Ro electronics TX25 module" ++ depends on MACH_MX25 ++ help ++ Include support for Ka-Ro TX25 processor module ++ ++config KARO_DEBUG ++ bool "Enable Ka-Ro specific debug messages" ++ depends on MACH_TX25 || MACH_TX27 ++ help ++ Compile the architecture specific files with -DDEBUG to enable ++ additional debug messages ++ ++config MACH_STK5_BASEBOARD ++ bool "Ka-Ro Starterkit-5 (STK5) development board" ++ depends on MACH_TX27 || MACH_TX25 ++ help ++ This adds board specific devices that can be found on Ka-Ro's ++ STK5 evaluation board. ++ + choice + prompt "Baseboard" + depends on MACH_PCM038 +@@ -60,3 +92,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:59:14.000000000 +0200 +@@ -2,17 +2,31 @@ + # Makefile for the linux kernel. + # + ++ifeq ($(CONFIG_KARO_DEBUG),y) ++ EXTRA_CFLAGS += -DDEBUG ++endif ++ + # Object file lists. + +-obj-y := generic.o devices.o serial.o ++obj-y := generic.o serial.o ++obj-$(CONFIG_MACH_MX25) += devices_mx25.o ++ifeq ($(CONFIG_MACH_MX25),) ++obj-y += devices.o ++endif ++ ++obj-$(CONFIG_MACH_MX21) += clock_imx21.o + +-obj-$(CONFIG_MACH_MX21) += clock_imx21.o ++obj-$(CONFIG_MACH_MX25) += clock_imx25.o ++obj-$(CONFIG_MACH_MX25) += cpu_imx25.o + +-obj-$(CONFIG_MACH_MX27) += cpu_imx27.o +-obj-$(CONFIG_MACH_MX27) += clock_imx27.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 ++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 ++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: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 + initrd_phys-$(CONFIG_MACH_MX27) := 0xA0800000 ++ ++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:59:15.000000000 +0200 +@@ -890,7 +890,7 @@ static struct clk clko_clk = { + .con_id = n, \ + .clk = &c, \ + }, +-static struct clk_lookup lookups[] __initdata = { ++static struct clk_lookup lookups[] = { + /* 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-08 12:46:51.000000000 +0200 +@@ -0,0 +1,1848 @@ ++/* ++ * Copyright 2008 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 ++ */ ++ ++/* based on mach-mx27/clock.c */ ++ ++#include ++#include ++#include ++//#include ++ ++#include ++//#include ++ ++#include ++#include ++#include ++ ++/* Register offsets */ ++#define MXC_CCM_MPCTL (IO_ADDRESS(CCM_BASE_ADDR) + 0x00) ++#define MXC_CCM_UPCTL (IO_ADDRESS(CCM_BASE_ADDR) + 0x04) ++#define MXC_CCM_CCTL (IO_ADDRESS(CCM_BASE_ADDR) + 0x08) ++#define MXC_CCM_CGCR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x0C) ++#define MXC_CCM_CGCR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x10) ++#define MXC_CCM_CGCR2 (IO_ADDRESS(CCM_BASE_ADDR) + 0x14) ++#define MXC_CCM_PCDR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x18) ++#define MXC_CCM_PCDR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x1C) ++#define MXC_CCM_PCDR2 (IO_ADDRESS(CCM_BASE_ADDR) + 0x20) ++#define MXC_CCM_PCDR3 (IO_ADDRESS(CCM_BASE_ADDR) + 0x24) ++#define MXC_CCM_RCSR (IO_ADDRESS(CCM_BASE_ADDR) + 0x28) ++#define MXC_CCM_CRDR (IO_ADDRESS(CCM_BASE_ADDR) + 0x2C) ++#define MXC_CCM_DCVR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x30) ++#define MXC_CCM_DCVR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x34) ++#define MXC_CCM_DCVR2 (IO_ADDRESS(CCM_BASE_ADDR) + 0x38) ++#define MXC_CCM_DCVR3 (IO_ADDRESS(CCM_BASE_ADDR) + 0x3C) ++#define MXC_CCM_LTR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x40) ++#define MXC_CCM_LTR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x44) ++#define MXC_CCM_LTR2 (IO_ADDRESS(CCM_BASE_ADDR) + 0x48) ++#define MXC_CCM_LTR3 (IO_ADDRESS(CCM_BASE_ADDR) + 0x4C) ++#define MXC_CCM_LTBR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x50) ++#define MXC_CCM_LTBR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x54) ++#define MXC_CCM_PMCR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x58) ++#define MXC_CCM_PMCR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x5C) ++#define MXC_CCM_PMCR2 (IO_ADDRESS(CCM_BASE_ADDR) + 0x60) ++#define MXC_CCM_MCR (IO_ADDRESS(CCM_BASE_ADDR) + 0x64) ++ ++#define MXC_CCM_MPCTL_BRMO (1 << 31) ++#define MXC_CCM_MPCTL_PD_OFFSET 26 ++#define MXC_CCM_MPCTL_PD_MASK (0xf << 26) ++#define MXC_CCM_MPCTL_MFD_OFFSET 16 ++#define MXC_CCM_MPCTL_MFD_MASK (0x3ff << 16) ++#define MXC_CCM_MPCTL_MFI_OFFSET 10 ++#define MXC_CCM_MPCTL_MFI_MASK (0xf << 10) ++#define MXC_CCM_MPCTL_MFN_OFFSET 0 ++#define MXC_CCM_MPCTL_MFN_MASK 0x3ff ++#define MXC_CCM_MPCTL_LF (1 << 15) ++ ++#define MXC_CCM_UPCTL_BRMO (1 << 31) ++#define MXC_CCM_UPCTL_PD_OFFSET 26 ++#define MXC_CCM_UPCTL_PD_MASK (0xf << 26) ++#define MXC_CCM_UPCTL_MFD_OFFSET 16 ++#define MXC_CCM_UPCTL_MFD_MASK (0x3ff << 16) ++#define MXC_CCM_UPCTL_MFI_OFFSET 10 ++#define MXC_CCM_UPCTL_MFI_MASK (0xf << 10) ++#define MXC_CCM_UPCTL_MFN_OFFSET 0 ++#define MXC_CCM_UPCTL_MFN_MASK 0x3ff ++#define MXC_CCM_UPCTL_LF (1 << 15) ++ ++#define MXC_CCM_CCTL_ARM_OFFSET 30 ++#define MXC_CCM_CCTL_ARM_MASK (0x3 << 30) ++#define MXC_CCM_CCTL_AHB_OFFSET 28 ++#define MXC_CCM_CCTL_AHB_MASK (0x3 << 28) ++#define MXC_CCM_CCTL_MPLL_RST (1 << 27) ++#define MXC_CCM_CCTL_UPLL_RST (1 << 26) ++#define MXC_CCM_CCTL_LP_CTL_OFFSET 24 ++#define MXC_CCM_CCTL_LP_CTL_MASK (0x3 << 24) ++#define MXC_CCM_CCTL_LP_MODE_RUN (0x0 << 24) ++#define MXC_CCM_CCTL_LP_MODE_WAIT (0x1 << 24) ++#define MXC_CCM_CCTL_LP_MODE_DOZE (0x2 << 24) ++#define MXC_CCM_CCTL_LP_MODE_STOP (0x3 << 24) ++#define MXC_CCM_CCTL_UPLL_DISABLE (1 << 23) ++#define MXC_CCM_CCTL_MPLL_BYPASS (1 << 22) ++#define MXC_CCM_CCTL_USB_DIV_OFFSET 16 ++#define MXC_CCM_CCTL_USB_DIV_MASK (0x3 << 16) ++#define MXC_CCM_CCTL_CG_CTRL (1 << 15) ++#define MXC_CCM_CCTL_ARM_SRC (1 << 14) ++ ++#define MXC_CCM_CGCR0_HCLK_ATA_OFFSET (16 + 0) ++#define MXC_CCM_CGCR0_HCLK_BROM_OFFSET (16 + 1) ++#define MXC_CCM_CGCR0_HCLK_CSI_OFFSET (16 + 2) ++#define MXC_CCM_CGCR0_HCLK_EMI_OFFSET (16 + 3) ++#define MXC_CCM_CGCR0_HCLK_ESAI_OFFSET (16 + 4) ++#define MXC_CCM_CGCR0_HCLK_ESDHC1_OFFSET (16 + 5) ++#define MXC_CCM_CGCR0_HCLK_ESDHC2_OFFSET (16 + 6) ++#define MXC_CCM_CGCR0_HCLK_FEC_OFFSET (16 + 7) ++#define MXC_CCM_CGCR0_HCLK_LCDC_OFFSET (16 + 8) ++#define MXC_CCM_CGCR0_HCLK_RTIC_OFFSET (16 + 9) ++#define MXC_CCM_CGCR0_HCLK_SDMA_OFFSET (16 + 10) ++#define MXC_CCM_CGCR0_HCLK_SLCDC_OFFSET (16 + 11) ++#define MXC_CCM_CGCR0_HCLK_USBOTG_OFFSET (16 + 12) ++ ++#define MXC_CCM_CGCR0_PER_CSI_OFFSET 0 ++#define MXC_CCM_CGCR0_PER_EPIT_OFFSET 1 ++#define MXC_CCM_CGCR0_PER_ESAI_OFFSET 2 ++#define MXC_CCM_CGCR0_PER_ESDHC1_OFFSET 3 ++#define MXC_CCM_CGCR0_PER_ESDHC2_OFFSET 4 ++#define MXC_CCM_CGCR0_PER_GPT_OFFSET 5 ++#define MXC_CCM_CGCR0_PER_I2C_OFFSET 6 ++#define MXC_CCM_CGCR0_PER_LCDC_OFFSET 7 ++#define MXC_CCM_CGCR0_PER_NFC_OFFSET 8 ++#define MXC_CCM_CGCR0_PER_OWIRE_OFFSET 9 ++#define MXC_CCM_CGCR0_PER_PWM_OFFSET 10 ++#define MXC_CCM_CGCR0_PER_SIM1_OFFSET 11 ++#define MXC_CCM_CGCR0_PER_SIM2_OFFSET 12 ++#define MXC_CCM_CGCR0_PER_SSI1_OFFSET 13 ++#define MXC_CCM_CGCR0_PER_SSI2_OFFSET 14 ++#define MXC_CCM_CGCR0_PER_UART_OFFSET 15 ++ ++#define MXC_CCM_CGCR1_AUDMUX_OFFSET 0 ++#define MXC_CCM_CGCR1_ATA_OFFSET 1 ++#define MXC_CCM_CGCR1_CAN1_OFFSET 2 ++#define MXC_CCM_CGCR1_CAN2_OFFSET 3 ++#define MXC_CCM_CGCR1_CSI_OFFSET 4 ++#define MXC_CCM_CGCR1_CSPI1_OFFSET 5 ++#define MXC_CCM_CGCR1_CSPI2_OFFSET 6 ++#define MXC_CCM_CGCR1_CSPI3_OFFSET 7 ++#define MXC_CCM_CGCR1_DRYICE_OFFSET 8 ++#define MXC_CCM_CGCR1_ECT_OFFSET 9 ++#define MXC_CCM_CGCR1_EPIT1_OFFSET 10 ++#define MXC_CCM_CGCR1_EPIT2_OFFSET 11 ++#define MXC_CCM_CGCR1_ESAI_OFFSET 12 ++#define MXC_CCM_CGCR1_ESDHC1_OFFSET 13 ++#define MXC_CCM_CGCR1_ESDHC2_OFFSET 14 ++#define MXC_CCM_CGCR1_FEC_OFFSET 15 ++#define MXC_CCM_CGCR1_GPIO1_OFFSET 16 ++#define MXC_CCM_CGCR1_GPIO2_OFFSET 17 ++#define MXC_CCM_CGCR1_GPIO3_OFFSET 18 ++#define MXC_CCM_CGCR1_GPT1_OFFSET 19 ++#define MXC_CCM_CGCR1_GPT2_OFFSET 20 ++#define MXC_CCM_CGCR1_GPT3_OFFSET 21 ++#define MXC_CCM_CGCR1_GPT4_OFFSET 22 ++#define MXC_CCM_CGCR1_I2C1_OFFSET 23 ++#define MXC_CCM_CGCR1_I2C2_OFFSET 24 ++#define MXC_CCM_CGCR1_I2C3_OFFSET 25 ++#define MXC_CCM_CGCR1_IIM_OFFSET 26 ++#define MXC_CCM_CGCR1_IOMUXC_OFFSET 27 ++#define MXC_CCM_CGCR1_KPP_OFFSET 28 ++#define MXC_CCM_CGCR1_LCDC_OFFSET 29 ++#define MXC_CCM_CGCR1_OWIRE_OFFSET 30 ++#define MXC_CCM_CGCR1_PWM1_OFFSET 31 ++ ++#define MXC_CCM_CGCR2_PWM2_OFFSET (32 - 32) ++#define MXC_CCM_CGCR2_PWM3_OFFSET (33 - 32) ++#define MXC_CCM_CGCR2_PWM4_OFFSET (34 - 32) ++#define MXC_CCM_CGCR2_RNGB_OFFSET (35 - 32) ++#define MXC_CCM_CGCR2_RTIC_OFFSET (36 - 32) ++#define MXC_CCM_CGCR2_SCC_OFFSET (37 - 32) ++#define MXC_CCM_CGCR2_SDMA_OFFSET (38 - 32) ++#define MXC_CCM_CGCR2_SIM1_OFFSET (39 - 32) ++#define MXC_CCM_CGCR2_SIM2_OFFSET (40 - 32) ++#define MXC_CCM_CGCR2_SLCDC_OFFSET (41 - 32) ++#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_UART1_OFFSET (46 - 32) ++#define MXC_CCM_CGCR2_UART2_OFFSET (47 - 32) ++#define MXC_CCM_CGCR2_UART3_OFFSET (48 - 32) ++#define MXC_CCM_CGCR2_UART4_OFFSET (49 - 32) ++#define MXC_CCM_CGCR2_UART5_OFFSET (50 - 32) ++#define MXC_CCM_CGCR2_WDOG_OFFSET (51 - 32) ++ ++#define MXC_CCM_PCDR1_PERDIV1_MASK 0x3f ++ ++#define MXC_CCM_MCR_USB_XTAL_MUX_OFFSET 31 ++#define MXC_CCM_MCR_CLKO_EN_OFFSET 30 ++#define MXC_CCM_MCR_CLKO_DIV_OFFSET 24 ++#define MXC_CCM_MCR_CLKO_DIV_MASK (0x3F << 24) ++#define MXC_CCM_MCR_CLKO_SEL_OFFSET 20 ++#define MXC_CCM_MCR_CLKO_SEL_MASK (0xF << 20) ++#define MXC_CCM_MCR_ESAI_CLK_MUX_OFFSET 19 ++#define MXC_CCM_MCR_SSI2_CLK_MUX_OFFSET 18 ++#define MXC_CCM_MCR_SSI1_CLK_MUX_OFFSET 17 ++#define MXC_CCM_MCR_USB_CLK_MUX_OFFSET 16 ++ ++#define MXC_CCM_MCR_PER_CLK_MUX_MASK (0xFFFF << 0) ++ ++#define OSC24M_CLK_FREQ 24000000 /* 24MHz reference clk */ ++#define OSC32K_CLK_FREQ 32768 /* 32.768kHz oscillator in */ ++ ++static struct clk mpll_clk; ++static struct clk upll_clk; ++static struct clk ahb_clk; ++static struct clk upll_24610k_clk; ++ ++static int _clk_enable(struct clk *clk) ++{ ++ unsigned long reg; ++ ++ if (!clk->enable_reg) ++ return 0; ++ ++ reg = __raw_readl(clk->enable_reg); ++ reg |= 1 << clk->enable_shift; ++ __raw_writel(reg, clk->enable_reg); ++ ++ return 0; ++} ++ ++static void _clk_disable(struct clk *clk) ++{ ++ unsigned long reg; ++ ++ if (!clk->enable_reg) ++ return; ++ ++ reg = __raw_readl(clk->enable_reg); ++ reg &= ~(1 << clk->enable_shift); ++ __raw_writel(reg, clk->enable_reg); ++} ++ ++static int _clk_upll_enable(struct clk *clk) ++{ ++ unsigned long reg; ++ ++ reg = __raw_readl(MXC_CCM_CCTL); ++ reg &= ~MXC_CCM_CCTL_UPLL_DISABLE; ++ __raw_writel(reg, MXC_CCM_CCTL); ++ ++ while (!(__raw_readl(MXC_CCM_UPCTL) & MXC_CCM_UPCTL_LF)) ++ cpu_relax(); ++ ++ return 0; ++} ++ ++static void _clk_upll_disable(struct clk *clk) ++{ ++ unsigned long reg; ++ ++ reg = __raw_readl(MXC_CCM_CCTL); ++ reg |= MXC_CCM_CCTL_UPLL_DISABLE; ++ __raw_writel(reg, MXC_CCM_CCTL); ++} ++ ++static int _perclk_enable(struct clk *clk) ++{ ++ unsigned long reg; ++ ++ reg = __raw_readl(MXC_CCM_CGCR0); ++ reg |= 1 << clk->id; ++ __raw_writel(reg, MXC_CCM_CGCR0); ++ ++ return 0; ++} ++ ++static void _perclk_disable(struct clk *clk) ++{ ++ unsigned long reg; ++ ++ reg = __raw_readl(MXC_CCM_CGCR0); ++ reg &= ~(1 << clk->id); ++ __raw_writel(reg, MXC_CCM_CGCR0); ++} ++ ++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) */ ++ signed long mfn; /* Multiplication Factor (Integer part) */ ++ signed long mfd; /* Multiplication Factor (Denominator Part) */ ++ signed long tmp; ++ unsigned long ref_freq = clk_get_rate(clk->parent); ++ ++ 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; ++ 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); ++ ++ mfn = (mfn + ((mfn < 0) ? 1024 : 0)) & 0x3ff; ++ pd--; ++ mfd--; ++ ++ /* Change the Pll value */ ++ reg = (mfi << MXC_CCM_MPCTL_MFI_OFFSET) | ++ (mfn << MXC_CCM_MPCTL_MFN_OFFSET) | ++ (mfd << MXC_CCM_MPCTL_MFD_OFFSET) | ++ (pd << MXC_CCM_MPCTL_PD_OFFSET); ++ ++ if (clk == &mpll_clk) { ++ printk(KERN_DEBUG "Changing MPCTL from %08x to %08lx\n", ++ __raw_readl(MXC_CCM_MPCTL), reg); ++ } else if (clk == &upll_clk) { ++ printk(KERN_DEBUG "Changing UPCTL from %08x to %08lx\n", ++ __raw_readl(MXC_CCM_UPCTL), reg); ++ } ++ if (clk == &mpll_clk) ++ __raw_writel(reg, MXC_CCM_MPCTL); ++ else if (clk == &upll_clk) ++ __raw_writel(reg, MXC_CCM_UPCTL); ++ return 0; ++} ++ ++static unsigned long _clk_pll_getrate(struct clk *clk) ++{ ++ unsigned long rate; ++ signed long mfi, mfn, mfd, pdf; ++ unsigned long ref_clk; ++ unsigned long reg; ++ ++ ref_clk = clk_get_rate(clk->parent); ++ ++ if (clk == &mpll_clk) { ++ reg = __raw_readl(MXC_CCM_MPCTL); ++ pdf = (reg & MXC_CCM_MPCTL_PD_MASK) >> MXC_CCM_MPCTL_PD_OFFSET; ++ mfd = (reg & MXC_CCM_MPCTL_MFD_MASK) >> MXC_CCM_MPCTL_MFD_OFFSET; ++ mfi = (reg & MXC_CCM_MPCTL_MFI_MASK) >> MXC_CCM_MPCTL_MFI_OFFSET; ++ mfn = (reg & MXC_CCM_MPCTL_MFN_MASK) >> MXC_CCM_MPCTL_MFN_OFFSET; ++ } else if (clk == &upll_clk) { ++ reg = __raw_readl(MXC_CCM_UPCTL); ++ pdf = (reg & MXC_CCM_UPCTL_PD_MASK) >> MXC_CCM_UPCTL_PD_OFFSET; ++ mfd = (reg & MXC_CCM_UPCTL_MFD_MASK) >> MXC_CCM_UPCTL_MFD_OFFSET; ++ mfi = (reg & MXC_CCM_UPCTL_MFI_MASK) >> MXC_CCM_UPCTL_MFI_OFFSET; ++ mfn = (reg & MXC_CCM_UPCTL_MFN_MASK) >> MXC_CCM_UPCTL_MFN_OFFSET; ++ } else { ++ BUG(); /* oops */ ++ } ++ ++ mfi = (mfi < 5) ? 5 : mfi; ++ rate = 2LL * ref_clk * mfn; ++ do_div(rate, mfd + 1); ++ rate = 2LL * ref_clk * mfi + rate; ++ do_div(rate, pdf + 1); ++ ++ return rate; ++} ++ ++static unsigned long _clk_cpu_round_rate(struct clk *clk, unsigned long rate) ++{ ++ int div = clk_get_rate(clk->parent) / rate; ++ ++ if (clk_get_rate(clk->parent) % rate) ++ div++; ++ ++ if (div > 4) ++ div = 4; ++ ++ return clk_get_rate(clk->parent) / div; ++} ++ ++static int _clk_cpu_set_rate(struct clk *clk, unsigned long rate) ++{ ++ int div, reg; ++ unsigned long cctl = __raw_readl(MXC_CCM_CCTL); ++ ++ div = clk_get_rate(clk->parent) / rate; ++ ++ if (div > 4 || div < 1 || ((clk_get_rate(clk->parent) / div) != rate)) ++ return -EINVAL; ++ div--; ++ ++ reg = (cctl & ~MXC_CCM_CCTL_ARM_MASK) | ++ (div << MXC_CCM_CCTL_ARM_OFFSET); ++ __raw_writel(reg, MXC_CCM_CCTL); ++ ++ return 0; ++} ++ ++static unsigned long _clk_cpu_getrate(struct clk *clk) ++{ ++ unsigned long div; ++ unsigned long cctl = __raw_readl(MXC_CCM_CCTL); ++ unsigned long rate; ++ ++ div = (cctl & MXC_CCM_CCTL_ARM_MASK) >> MXC_CCM_CCTL_ARM_OFFSET; ++ ++ rate = clk_get_rate(clk->parent) / (div + 1); ++ ++ if (cctl & MXC_CCM_CCTL_ARM_SRC) { ++ rate *= 3; ++ rate /= 4; ++ } ++ return rate; ++} ++ ++static unsigned long _clk_ahb_getrate(struct clk *clk) ++{ ++ unsigned long div; ++ unsigned long cctl = __raw_readl(MXC_CCM_CCTL); ++ ++ div = (cctl & MXC_CCM_CCTL_AHB_MASK) >> MXC_CCM_CCTL_AHB_OFFSET; ++ ++ return clk_get_rate(clk->parent) / (div + 1); ++} ++ ++static void __iomem *pcdr_a[4] = { ++ MXC_CCM_PCDR0, MXC_CCM_PCDR1, MXC_CCM_PCDR2, MXC_CCM_PCDR3 ++}; ++ ++static unsigned long _clk_perclkx_getrate(struct clk *clk) ++{ ++ unsigned long perclk_pdf; ++ unsigned long pcdr; ++ ++ if (clk->id < 0 || clk->id > 15) ++ return 0; ++ ++ pcdr = __raw_readl(pcdr_a[clk->id >> 2]); ++ ++ perclk_pdf = ++ (pcdr >> ((clk->id & 3) << 3)) & MXC_CCM_PCDR1_PERDIV1_MASK; ++ ++ return clk_get_rate(clk->parent) / (perclk_pdf + 1); ++} ++ ++static unsigned long _clk_perclkx_round_rate(struct clk *clk, ++ unsigned long rate) ++{ ++ unsigned long div; ++ ++ div = clk_get_rate(clk->parent) / rate; ++ if (clk_get_rate(clk->parent) % rate) ++ div++; ++ ++ if (div > 64) ++ div = 64; ++ ++ return clk_get_rate(clk->parent) / div; ++} ++ ++static int _clk_perclkx_set_rate(struct clk *clk, unsigned long rate) ++{ ++ unsigned long reg; ++ unsigned long div; ++ ++ if (clk->id < 0 || clk->id > 15) ++ 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--; ++ ++ reg = ++ __raw_readl(pcdr_a[clk->id >> 2]) & ~(MXC_CCM_PCDR1_PERDIV1_MASK << ++ ((clk->id & 3) << 3)); ++ reg |= div << ((clk->id & 3) << 3); ++ __raw_writel(reg, pcdr_a[clk->id >> 2]); ++ ++ return 0; ++} ++ ++static int _clk_perclkx_set_parent(struct clk *clk, struct clk *parent) ++{ ++ unsigned long mcr; ++ ++ if (clk->parent == parent) ++ return 0; ++ if (parent != &upll_clk && parent != &ahb_clk) ++ return -EINVAL; ++ ++ clk->parent = parent; ++ mcr = __raw_readl(MXC_CCM_MCR); ++ if (parent == &upll_clk) ++ mcr |= (1 << clk->id); ++ else ++ mcr &= ~(1 << clk->id); ++ ++ __raw_writel(mcr, MXC_CCM_MCR); ++ ++ return 0; ++} ++ ++static int _clk_perclkx_set_parent3(struct clk *clk, struct clk *parent) ++{ ++ unsigned long mcr = __raw_readl(MXC_CCM_MCR); ++ int bit; ++ ++ if (clk->parent == parent) ++ return 0; ++ if (parent != &upll_clk && parent != &ahb_clk && ++ parent != &upll_24610k_clk) ++ return -EINVAL; ++ ++ switch (clk->id) { ++ case 2: ++ bit = MXC_CCM_MCR_ESAI_CLK_MUX_OFFSET; ++ break; ++ case 13: ++ bit = MXC_CCM_MCR_SSI1_CLK_MUX_OFFSET; ++ break; ++ case 14: ++ bit = MXC_CCM_MCR_SSI2_CLK_MUX_OFFSET; ++ break; ++ default: ++ return -EINVAL; ++ } ++ ++ if (parent == &upll_24610k_clk) { ++ mcr |= bit; ++ __raw_writel(mcr, MXC_CCM_MCR); ++ clk->parent = parent; ++ } else { ++ mcr &= ~bit; ++ __raw_writel(mcr, MXC_CCM_MCR); ++ return _clk_perclkx_set_parent(clk, parent); ++ } ++ ++ return 0; ++} ++ ++static unsigned long _clk_ipg_getrate(struct clk *clk) ++{ ++ return clk_get_rate(clk->parent) / 2; /* Always AHB / 2 */ ++} ++ ++/* Top-level clocks */ ++static unsigned long ckih_rate = OSC24M_CLK_FREQ; ++ ++static unsigned long clk_ckih_get_rate(struct clk *clk) ++{ ++ return ckih_rate; ++} ++ ++static unsigned long clk_ckil_get_rate(struct clk *clk) ++{ ++ return OSC32K_CLK_FREQ; ++} ++ ++static struct clk osc24m_clk = { ++ .get_rate = clk_ckih_get_rate, ++}; ++ ++static struct clk osc32k_clk = { ++ .get_rate = clk_ckil_get_rate, ++}; ++ ++static struct clk mpll_clk = { ++ .parent = &osc24m_clk, ++ .get_rate = _clk_pll_getrate, ++ .set_rate = _clk_pll_set_rate, ++}; ++ ++static struct clk upll_clk = { ++ .parent = &osc24m_clk, ++ .get_rate = _clk_pll_getrate, ++ .set_rate = _clk_pll_set_rate, ++ .enable = _clk_upll_enable, ++ .disable = _clk_upll_disable, ++}; ++ ++static unsigned long _clk_24610k_getrate(struct clk *clk) ++{ ++ long long rate = clk_get_rate(clk->parent) * 2461LL; ++ ++ do_div(rate, 24000); ++ ++ return rate; /* Always (UPLL * 24.61 / 240) */ ++} ++ ++static struct clk upll_24610k_clk = { ++ .parent = &upll_clk, ++ .get_rate = _clk_24610k_getrate, ++}; ++ ++/* Mid-level clocks */ ++ ++static struct clk cpu_clk = { /* ARM clock */ ++ .parent = &mpll_clk, ++ .set_rate = _clk_cpu_set_rate, ++ .get_rate = _clk_cpu_getrate, ++ .round_rate = _clk_cpu_round_rate, ++}; ++ ++static struct clk ahb_clk = { /* a.k.a. HCLK */ ++ .parent = &cpu_clk, ++ .get_rate = _clk_ahb_getrate, ++}; ++ ++static struct clk ipg_clk = { ++ .parent = &ahb_clk, ++ .get_rate = _clk_ipg_getrate, ++}; ++ ++/* Bottom-level clocks */ ++ ++struct clk usbotg_clk = { ++ .id = 0, ++ .parent = &ahb_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR0, ++ .enable_shift = MXC_CCM_CGCR0_HCLK_USBOTG_OFFSET, ++ .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, ++}; ++ ++struct clk emi_clk = { ++ .id = 0, ++ .parent = &ahb_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR0, ++ .enable_shift = MXC_CCM_CGCR0_HCLK_EMI_OFFSET, ++ .disable = _clk_disable, ++}; ++ ++struct clk brom_clk = { ++ .id = 0, ++ .parent = &ahb_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR0, ++ .enable_shift = MXC_CCM_CGCR0_HCLK_BROM_OFFSET, ++ .disable = _clk_disable, ++}; ++ ++static struct clk per_clk[] = { ++ { ++ .id = 0, ++ .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, ++ .get_rate = _clk_perclkx_getrate, ++ .enable = _perclk_enable, ++ .disable = _perclk_disable, ++ }, ++ { ++ .id = 1, ++ .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, ++ .get_rate = _clk_perclkx_getrate, ++ .enable = _perclk_enable, ++ .disable = _perclk_disable, ++ }, ++ { ++ .id = 2, ++ .parent = &ahb_clk, /* can be AHB or UPLL or 24.61MHz */ ++ .round_rate = _clk_perclkx_round_rate, ++ .set_rate = _clk_perclkx_set_rate, ++ .set_parent = _clk_perclkx_set_parent3, ++ .get_rate = _clk_perclkx_getrate, ++ .enable = _perclk_enable, ++ .disable = _perclk_disable, ++ }, ++ { ++ .id = 3, ++ .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, ++ .get_rate = _clk_perclkx_getrate, ++ .enable = _perclk_enable, ++ }, ++ { ++ .id = 4, ++ .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, ++ .get_rate = _clk_perclkx_getrate, ++ .enable = _perclk_enable, ++ .disable = _perclk_disable, ++ }, ++ { ++ .id = 5, ++ .parent = &upll_clk, /* can be AHB or UPLL */ ++ .round_rate = _clk_perclkx_round_rate, ++ .set_rate = _clk_perclkx_set_rate, ++ .set_parent = _clk_perclkx_set_parent, ++ .get_rate = _clk_perclkx_getrate, ++ .enable = _perclk_enable, ++ .disable = _perclk_disable, ++ }, ++ { ++ .id = 6, ++ .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, ++ .get_rate = _clk_perclkx_getrate, ++ .enable = _perclk_enable, ++ .disable = _perclk_disable, ++ }, ++ { ++ .id = 7, ++ .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, ++ .get_rate = _clk_perclkx_getrate, ++ .enable = _perclk_enable, ++ .disable = _perclk_disable, ++ }, ++ { ++ .id = 8, ++ .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, ++ .get_rate = _clk_perclkx_getrate, ++ .enable = _perclk_enable, ++ .disable = _perclk_disable, ++ }, ++ { ++ .id = 9, ++ .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, ++ .get_rate = _clk_perclkx_getrate, ++ .enable = _perclk_enable, ++ .disable = _perclk_disable, ++ }, ++ { ++ .id = 10, ++ .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, ++ .get_rate = _clk_perclkx_getrate, ++ .enable = _perclk_enable, ++ .disable = _perclk_disable, ++ }, ++ { ++ .id = 11, ++ .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, ++ .get_rate = _clk_perclkx_getrate, ++ .enable = _perclk_enable, ++ .disable = _perclk_disable, ++ }, ++ { ++ .id = 12, ++ .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, ++ .get_rate = _clk_perclkx_getrate, ++ .enable = _perclk_enable, ++ .disable = _perclk_disable, ++ }, ++ { ++ .id = 13, ++ .parent = &ahb_clk, /* can be AHB or UPLL or 24.61MHz */ ++ .round_rate = _clk_perclkx_round_rate, ++ .set_rate = _clk_perclkx_set_rate, ++ .set_parent = _clk_perclkx_set_parent3, ++ .get_rate = _clk_perclkx_getrate, ++ .enable = _perclk_enable, ++ .disable = _perclk_disable, ++ }, ++ { ++ .id = 14, ++ .parent = &ahb_clk, /* can be AHB or UPLL or 24.61MHz */ ++ .round_rate = _clk_perclkx_round_rate, ++ .set_rate = _clk_perclkx_set_rate, ++ .set_parent = _clk_perclkx_set_parent3, ++ .get_rate = _clk_perclkx_getrate, ++ .enable = _perclk_enable, ++ .disable = _perclk_disable, ++ }, ++ { ++ .id = 15, ++ .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, ++ .get_rate = _clk_perclkx_getrate, ++ .enable = _perclk_enable, ++ .disable = _perclk_disable, ++ }, ++}; ++ ++struct clk nfc_clk = { ++ .id = 0, ++ .parent = &per_clk[8], ++}; ++ ++struct clk audmux_clk = { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_AUDMUX_OFFSET, ++ .disable = _clk_disable, ++}; ++ ++struct clk ata_clk[] = { ++ { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_ATA_OFFSET, ++ .disable = _clk_disable, ++ .secondary = &ata_clk[1], ++ }, ++ { ++ .id = 0, ++ .parent = &ahb_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR0, ++ .enable_shift = MXC_CCM_CGCR0_HCLK_ATA_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk can_clk[] = { ++ { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_CAN1_OFFSET, ++ .disable = _clk_disable, ++ }, ++ { ++ .id = 1, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_CAN2_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk csi_clk[] = { ++ { ++ .id = 0, ++ .parent = &per_clk[0], ++ .secondary = &csi_clk[1], ++ }, ++ { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_CSI_OFFSET, ++ .disable = _clk_disable, ++ .secondary = &csi_clk[2], ++ }, ++ { ++ .id = 0, ++ .parent = &ahb_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR0, ++ .enable_shift = MXC_CCM_CGCR0_HCLK_CSI_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk cspi_clk[] = { ++ { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_CSPI1_OFFSET, ++ .disable = _clk_disable, ++ }, ++ { ++ .id = 1, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_CSPI2_OFFSET, ++ .disable = _clk_disable, ++ }, ++ { ++ .id = 2, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_CSPI3_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk dryice_clk = { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_DRYICE_OFFSET, ++ .disable = _clk_disable, ++}; ++ ++struct clk ect_clk = { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_ECT_OFFSET, ++ .disable = _clk_disable, ++}; ++ ++struct clk epit1_clk[] = { ++ { ++ .id = 0, ++ .parent = &per_clk[1], ++ .secondary = &epit1_clk[1], ++ }, ++ { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_EPIT1_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk epit2_clk[] = { ++ { ++ .id = 1, ++ .parent = &per_clk[1], ++ .secondary = &epit2_clk[1], ++ }, ++ { ++ .id = 1, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_EPIT2_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk esai_clk[] = { ++ { ++ .id = 0, ++ .parent = &per_clk[2], ++ .secondary = &esai_clk[1], ++ }, ++ { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_ESAI_OFFSET, ++ .disable = _clk_disable, ++ .secondary = &esai_clk[2], ++ }, ++ { ++ .id = 0, ++ .parent = &ahb_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR0, ++ .enable_shift = MXC_CCM_CGCR0_HCLK_ESAI_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk esdhc1_clk[] = { ++ { ++ .id = 0, ++ .parent = &per_clk[3], ++ .secondary = &esdhc1_clk[1], ++ }, ++ { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_ESDHC1_OFFSET, ++ .disable = _clk_disable, ++ .secondary = &esdhc1_clk[2], ++ }, ++ { ++ .id = 0, ++ .parent = &ahb_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR0, ++ .enable_shift = MXC_CCM_CGCR0_HCLK_ESDHC1_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk esdhc2_clk[] = { ++ { ++ .id = 1, ++ .parent = &per_clk[4], ++ .secondary = &esdhc2_clk[1], ++ }, ++ { ++ .id = 1, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_ESDHC2_OFFSET, ++ .disable = _clk_disable, ++ .secondary = &esdhc2_clk[2], ++ }, ++ { ++ .id = 1, ++ .parent = &ahb_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR0, ++ .enable_shift = MXC_CCM_CGCR0_HCLK_ESDHC2_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk fec_clk[] = { ++ { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_FEC_OFFSET, ++ .disable = _clk_disable, ++ .secondary = &fec_clk[1], ++ }, ++ { ++ .id = 0, ++ .parent = &ahb_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR0, ++ .enable_shift = MXC_CCM_CGCR0_HCLK_FEC_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk gpio_clk[] = { ++ { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_GPIO1_OFFSET, ++ .disable = _clk_disable, ++ }, ++ { ++ .id = 1, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_GPIO2_OFFSET, ++ .disable = _clk_disable, ++ }, ++ { ++ .id = 2, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_GPIO3_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++static struct clk gpt1_clk[] = { ++ { ++ .id = 0, ++ .parent = &per_clk[5], ++ .secondary = &gpt1_clk[1], ++ }, ++ { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_GPT1_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++static struct clk gpt2_clk[] = { ++ { ++ .id = 1, ++ .parent = &per_clk[5], ++ .secondary = &gpt1_clk[1], ++ }, ++ { ++ .id = 1, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_GPT2_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++static struct clk gpt3_clk[] = { ++ { ++ .id = 2, ++ .parent = &per_clk[5], ++ .secondary = &gpt1_clk[1], ++ }, ++ { ++ .id = 2, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_GPT3_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++static struct clk gpt4_clk[] = { ++ { ++ .id = 3, ++ .parent = &per_clk[5], ++ .secondary = &gpt1_clk[1], ++ }, ++ { ++ .id = 3, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_GPT4_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk i2c_clk[] = { ++ { ++ .id = 0, ++ .parent = &per_clk[6], ++ }, ++ { ++ .id = 1, ++ .parent = &per_clk[6], ++ }, ++ { ++ .id = 2, ++ .parent = &per_clk[6], ++ }, ++}; ++ ++struct clk iim_clk = { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_IIM_OFFSET, ++ .disable = _clk_disable, ++}; ++ ++struct clk iomuxc_clk = { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_IOMUXC_OFFSET, ++ .disable = _clk_disable, ++}; ++ ++struct clk kpp_clk = { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_KPP_OFFSET, ++ .disable = _clk_disable, ++}; ++ ++struct clk lcdc_clk[] = { ++ { ++ .id = 0, ++ .parent = &per_clk[7], ++ .secondary = &lcdc_clk[1], ++ }, ++ { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_LCDC_OFFSET, ++ .disable = _clk_disable, ++ .secondary = &lcdc_clk[2], ++ }, ++ { ++ .id = 0, ++ .parent = &ahb_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR0, ++ .enable_shift = MXC_CCM_CGCR0_HCLK_LCDC_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk owire_clk[] = { ++ { ++ .id = 0, ++ .parent = &per_clk[9], ++ .secondary = &owire_clk[1], ++ }, ++ { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_OWIRE_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk pwm1_clk[] = { ++ { ++ .id = 0, ++ .parent = &per_clk[10], ++ .secondary = &pwm1_clk[1], ++ }, ++ { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_PWM1_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk pwm2_clk[] = { ++ { ++ .id = 1, ++ .parent = &per_clk[10], ++ .secondary = &pwm2_clk[1], ++ }, ++ { ++ .id = 1, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR2, ++ .enable_shift = MXC_CCM_CGCR2_PWM2_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk pwm3_clk[] = { ++ { ++ .id = 2, ++ .parent = &per_clk[10], ++ .secondary = &pwm3_clk[1], ++ }, ++ { ++ .id = 2, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR2, ++ .enable_shift = MXC_CCM_CGCR2_PWM3_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk pwm4_clk[] = { ++ { ++ .id = 3, ++ .parent = &per_clk[10], ++ .secondary = &pwm4_clk[1], ++ }, ++ { ++ .id = 3, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR2, ++ .enable_shift = MXC_CCM_CGCR2_PWM3_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk rngb_clk = { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR2, ++ .enable_shift = MXC_CCM_CGCR2_RNGB_OFFSET, ++ .disable = _clk_disable, ++}; ++ ++struct clk scc_clk = { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR2, ++ .enable_shift = MXC_CCM_CGCR2_SCC_OFFSET, ++ .disable = _clk_disable, ++}; ++ ++struct clk sdma_clk[] = { ++ { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR2, ++ .enable_shift = MXC_CCM_CGCR2_SDMA_OFFSET, ++ .disable = _clk_disable, ++ .secondary = &sdma_clk[1], ++ }, ++ { ++ .id = 0, ++ .parent = &ahb_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR0, ++ .enable_shift = MXC_CCM_CGCR0_HCLK_SDMA_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk sim1_clk[] = { ++ { ++ .id = 0, ++ .parent = &per_clk[11], ++ .secondary = &sim1_clk[1], ++ }, ++ { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR2, ++ .enable_shift = MXC_CCM_CGCR2_SIM1_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk sim2_clk[] = { ++ { ++ .id = 1, ++ .parent = &per_clk[12], ++ .secondary = &sim2_clk[1], ++ }, ++ { ++ .id = 1, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR2, ++ .enable_shift = MXC_CCM_CGCR2_SIM2_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk slcdc_clk[] = { ++ { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR2, ++ .enable_shift = MXC_CCM_CGCR2_SLCDC_OFFSET, ++ .disable = _clk_disable, ++ .secondary = &slcdc_clk[1], ++ }, ++ { ++ .id = 0, ++ .parent = &ahb_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR0, ++ .enable_shift = MXC_CCM_CGCR0_HCLK_SLCDC_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk spba_clk = { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR2, ++ .enable_shift = MXC_CCM_CGCR2_SPBA_OFFSET, ++ .disable = _clk_disable, ++}; ++ ++struct clk ssi1_clk[] = { ++ { ++ .id = 0, ++ .parent = &per_clk[13], ++ .secondary = &ssi1_clk[1], ++ }, ++ { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR2, ++ .enable_shift = MXC_CCM_CGCR2_SSI1_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk ssi2_clk[] = { ++ { ++ .id = 1, ++ .parent = &per_clk[14], ++ .secondary = &ssi2_clk[1], ++ }, ++ { ++ .id = 1, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR2, ++ .enable_shift = MXC_CCM_CGCR2_SSI2_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk tchscrn_clk = { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR2, ++ .enable_shift = MXC_CCM_CGCR2_TCHSCRN_OFFSET, ++ .disable = _clk_disable, ++}; ++ ++struct clk uart1_clk[] = { ++ { ++ .id = 0, ++ .parent = &per_clk[15], ++ .secondary = &uart1_clk[1], ++ }, ++ { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR2, ++ .enable_shift = MXC_CCM_CGCR2_UART1_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk uart2_clk[] = { ++ { ++ .id = 1, ++ .parent = &per_clk[15], ++ .secondary = &uart2_clk[1], ++ }, ++ { ++ .id = 1, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR2, ++ .enable_shift = MXC_CCM_CGCR2_UART2_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk uart3_clk[] = { ++ { ++ .id = 2, ++ .parent = &per_clk[15], ++ .secondary = &uart3_clk[1], ++ }, ++ { ++ .id = 2, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR2, ++ .enable_shift = MXC_CCM_CGCR2_UART3_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk uart4_clk[] = { ++ { ++ .id = 3, ++ .parent = &per_clk[15], ++ .secondary = &uart4_clk[1], ++ }, ++ { ++ .id = 3, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR2, ++ .enable_shift = MXC_CCM_CGCR2_UART4_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk uart5_clk[] = { ++ { ++ .id = 4, ++ .parent = &per_clk[15], ++ .secondary = &uart5_clk[1], ++ }, ++ { ++ .id = 4, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR2, ++ .enable_shift = MXC_CCM_CGCR2_UART5_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk wdog_clk = { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR2, ++ .enable_shift = MXC_CCM_CGCR2_WDOG_OFFSET, ++ .disable = _clk_disable, ++}; ++ ++static unsigned long _clk_usb_round_rate(struct clk *clk, unsigned long rate) ++{ ++ unsigned long div; ++ ++ div = clk_get_rate(clk->parent) / rate; ++ if (clk_get_rate(clk->parent) % rate) ++ div++; ++ ++ if (div > 64) ++ return -EINVAL; ++ ++ return clk_get_rate(clk->parent) / div; ++} ++ ++static int _clk_usb_set_rate(struct clk *clk, unsigned long rate) ++{ ++ unsigned long reg; ++ unsigned long div; ++ ++ div = clk_get_rate(clk->parent) / rate; ++ ++ if (clk_get_rate(clk->parent) / div != rate) ++ return -EINVAL; ++ if (div > 64) ++ return -EINVAL; ++ ++ reg = __raw_readl(MXC_CCM_CCTL) & ~MXC_CCM_CCTL_USB_DIV_MASK; ++ reg |= (div - 1) << MXC_CCM_CCTL_USB_DIV_OFFSET; ++ __raw_writel(reg, MXC_CCM_MCR); ++ ++ return 0; ++} ++ ++static unsigned long _clk_usb_getrate(struct clk *clk) ++{ ++ unsigned long 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); ++} ++ ++static int _clk_usb_set_parent(struct clk *clk, struct clk *parent) ++{ ++ unsigned long mcr; ++ ++ if (clk->parent == parent) ++ return 0; ++ if (parent != &upll_clk && parent != &ahb_clk) ++ return -EINVAL; ++ ++ clk->parent = parent; ++ mcr = __raw_readl(MXC_CCM_MCR); ++ if (parent == &ahb_clk) ++ mcr |= (1 << MXC_CCM_MCR_USB_CLK_MUX_OFFSET); ++ else ++ mcr &= ~(1 << MXC_CCM_MCR_USB_CLK_MUX_OFFSET); ++ ++ __raw_writel(mcr, MXC_CCM_MCR); ++ ++ return 0; ++} ++ ++static struct clk usb_clk = { ++ .parent = &upll_clk, ++ .get_rate = _clk_usb_getrate, ++ .set_rate = _clk_usb_set_rate, ++ .round_rate = _clk_usb_round_rate, ++ .set_parent = _clk_usb_set_parent, ++}; ++ ++/* CLKO */ ++ ++static unsigned long _clk_clko_round_rate(struct clk *clk, unsigned long rate) ++{ ++ unsigned long div; ++ ++ div = clk_get_rate(clk->parent) / rate; ++ if (clk_get_rate(clk->parent) % rate) ++ div++; ++ ++ if (div > 64) ++ return -EINVAL; ++ ++ return clk_get_rate(clk->parent) / div; ++} ++ ++static int _clk_clko_set_rate(struct clk *clk, unsigned long rate) ++{ ++ unsigned long reg; ++ unsigned long div; ++ ++ div = clk_get_rate(clk->parent) / rate; ++ ++ if ((clk_get_rate(clk->parent) / div) != rate) ++ return -EINVAL; ++ if (div > 64) ++ return -EINVAL; ++ ++ reg = __raw_readl(MXC_CCM_MCR) & ~MXC_CCM_MCR_CLKO_DIV_MASK; ++ reg |= (div - 1) << MXC_CCM_MCR_CLKO_DIV_OFFSET; ++ __raw_writel(reg, MXC_CCM_MCR); ++ ++ return 0; ++} ++ ++static unsigned long _clk_clko_getrate(struct clk *clk) ++{ ++ unsigned long div = __raw_readl(MXC_CCM_MCR); ++ ++ div &= MXC_CCM_MCR_CLKO_DIV_MASK; ++ div >>= MXC_CCM_MCR_CLKO_DIV_OFFSET; ++ ++ return clk_get_rate(clk->parent) / (div + 1); ++} ++ ++static struct clk *clko_sources[] = { ++ &osc32k_clk, /* 0x0 */ ++ &osc24m_clk, /* 0x1 */ ++ &cpu_clk, /* 0x2 */ ++ &ahb_clk, /* 0x3 */ ++ &ipg_clk, /* 0x4 */ ++ NULL, /* 0x5 */ ++ NULL, /* 0x6 */ ++ NULL, /* 0x7 */ ++ NULL, /* 0x8 */ ++ NULL, /* 0x9 */ ++ &per_clk[0], /* 0xA */ ++ &per_clk[2], /* 0xB */ ++ &per_clk[13], /* 0xC */ ++ &per_clk[14], /* 0xD */ ++ &usb_clk, /* 0xE */ ++ NULL, /* 0xF */ ++}; ++ ++#define NR_CLKO_SOURCES (sizeof(clko_sources) / sizeof(struct clk *)) ++ ++static int _clk_clko_set_parent(struct clk *clk, struct clk *parent) ++{ ++ unsigned long reg; ++ struct clk **src; ++ int i; ++ ++ if (clk->parent == parent) ++ return 0; ++ for (i = 0, src = clko_sources; i < NR_CLKO_SOURCES; i++, src++) ++ if (*src == parent) ++ break; ++ ++ if (i == NR_CLKO_SOURCES) ++ return -EINVAL; ++ ++ clk->parent = parent; ++ ++ reg = __raw_readl(MXC_CCM_MCR) & ~MXC_CCM_MCR_CLKO_SEL_MASK; ++ reg |= i << MXC_CCM_MCR_CLKO_SEL_OFFSET; ++ __raw_writel(reg, MXC_CCM_MCR); ++ ++ return 0; ++} ++ ++static struct clk clko_clk = { ++ .set_rate = _clk_clko_set_rate, ++ .round_rate = _clk_clko_round_rate, ++ .set_parent = _clk_clko_set_parent, ++ .get_rate = _clk_clko_getrate, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_MCR, ++ .enable_shift = MXC_CCM_MCR_CLKO_EN_OFFSET, ++ .disable = _clk_disable, ++}; ++ ++#define _REGISTER_CLOCK(d, n, c) \ ++ { \ ++ .dev_id = d, \ ++ .con_id = n, \ ++ .clk = &c, \ ++ }, ++ ++static struct clk_lookup lookups[] = { ++ _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(NULL, "csi", csi_clk[0]) ++ _REGISTER_CLOCK(NULL, "cspi.0", cspi_clk[0]) ++ _REGISTER_CLOCK(NULL, "cspi.1", cspi_clk[1]) ++ _REGISTER_CLOCK(NULL, "cspi.2", cspi_clk[2]) ++ _REGISTER_CLOCK(NULL, "dryice", dryice_clk) ++ _REGISTER_CLOCK(NULL, "ect", ect_clk) ++ _REGISTER_CLOCK(NULL, "epit1", epit1_clk[0]) ++ _REGISTER_CLOCK(NULL, "epit2", epit2_clk[0]) ++ _REGISTER_CLOCK(NULL, "esai", esai_clk[0]) ++ _REGISTER_CLOCK("mxc-mmc.0", NULL, esdhc1_clk[0]) ++ _REGISTER_CLOCK("mxc-mmc.1", NULL, esdhc2_clk[0]) ++ _REGISTER_CLOCK("fec.0", NULL, fec_clk[0]) ++ _REGISTER_CLOCK(NULL, "gpio0", gpio_clk[0]) ++ _REGISTER_CLOCK(NULL, "gpio1", gpio_clk[1]) ++ _REGISTER_CLOCK(NULL, "gpio2", gpio_clk[2]) ++ _REGISTER_CLOCK(NULL, "gpt1", gpt1_clk[0]) ++ _REGISTER_CLOCK(NULL, "gpt2", gpt2_clk[0]) ++ _REGISTER_CLOCK(NULL, "gpt3", gpt3_clk[0]) ++ _REGISTER_CLOCK(NULL, "gpt4", gpt4_clk[0]) ++ _REGISTER_CLOCK("imx-i2c.0", NULL, i2c_clk[0]) ++ _REGISTER_CLOCK("imx-i2c.1", NULL, i2c_clk[1]) ++ _REGISTER_CLOCK("imx-i2c.2", NULL, i2c_clk[2]) ++ _REGISTER_CLOCK(NULL, "iim", iim_clk) ++ _REGISTER_CLOCK(NULL, "iomuxc", iomuxc_clk) ++ _REGISTER_CLOCK(NULL, "kpp", kpp_clk) ++ _REGISTER_CLOCK("imx-fb.0", NULL, lcdc_clk[0]) ++ _REGISTER_CLOCK(NULL, "owire", owire_clk[0]) ++ _REGISTER_CLOCK("mxc_pwm.0", NULL, pwm1_clk[0]) ++ _REGISTER_CLOCK("mxc_pwm.1", NULL, pwm2_clk[0]) ++ _REGISTER_CLOCK("mxc_pwm.2", NULL, pwm3_clk[0]) ++ _REGISTER_CLOCK("mxc_pwm.3", NULL, pwm4_clk[0]) ++ _REGISTER_CLOCK(NULL, "rngb", rngb_clk) ++ _REGISTER_CLOCK(NULL, "scc", scc_clk) ++ _REGISTER_CLOCK(NULL, "sdma", sdma_clk[0]) ++ _REGISTER_CLOCK(NULL, "sim1", sim1_clk[0]) ++ _REGISTER_CLOCK(NULL, "sim2", sim2_clk[0]) ++ _REGISTER_CLOCK(NULL, "slcdc", slcdc_clk[0]) ++ _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("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("imx-wdt.0", NULL, wdog_clk) ++ _REGISTER_CLOCK(NULL, "usb", usb_clk) ++ _REGISTER_CLOCK(NULL, "clko", clko_clk) ++ _REGISTER_CLOCK(NULL, "brom", brom_clk) ++}; ++ ++int __init mx25_clocks_init(unsigned long fref) ++{ ++ int i; ++ ++ 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 : ""); ++ clkdev_add(&lookups[i]); ++ } ++ ++ ckih_rate = fref; ++#ifndef CONFIG_DEBUG_LL ++ /* Turn off all possible clocks */ ++ __raw_writel((1 << MXC_CCM_CGCR0_HCLK_EMI_OFFSET), MXC_CCM_CGCR0); ++ ++ __raw_writel((1 << MXC_CCM_CGCR1_GPT1_OFFSET) | ++ (1 << MXC_CCM_CGCR1_IIM_OFFSET), MXC_CCM_CGCR1); ++ __raw_writel(1 << MXC_CCM_CGCR2_SCC_OFFSET, MXC_CCM_CGCR2); ++#endif ++#if 1 ++ /* Set all perclk sources to upll */ ++ for (i = 0; i < ARRAY_SIZE(per_clk); i++) { ++ int ret; ++ unsigned long rate = per_clk[i].get_rate(&per_clk[i]); ++ ++#ifdef CONFIG_DEBUG_LL ++ if (i == 15) { ++ printk(KERN_DEBUG "skipping per_clk[%d] rate=%lu\n", i, rate); ++ continue; ++ } ++#endif ++ { ++ unsigned long new_rate; ++ ++ 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); ++ clk_set_rate(&per_clk[8], clk_get_rate(&ahb_clk) / 6); ++ ++ /* This will propagate to all children and init all the clock rates */ ++#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)); ++ ++ pr_info("CPU: %lu.%03luMHz\n", ++ clk_get_rate(&cpu_clk) / 1000000, clk_get_rate(&cpu_clk) / 1000 % 1000); ++ pr_info("AHB: %lu.%03luMHz\n", ++ clk_get_rate(&ahb_clk) / 1000000, clk_get_rate(&ahb_clk) / 1000 % 1000); ++ pr_info("MPLL: %lu.%03luMHz\n", ++ clk_get_rate(&mpll_clk) / 1000000, clk_get_rate(&mpll_clk) / 1000 % 1000); ++ pr_info("UPLL: %lu.%03luMHz\n", ++ clk_get_rate(&upll_clk) / 1000000, clk_get_rate(&upll_clk) / 1000 % 1000); ++ 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]); ++ 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:59:15.000000000 +0200 +@@ -621,7 +621,7 @@ DEFINE_CLOCK1(csi_clk, 0, 0, 0, + .clk = &c, \ + }, + +-static struct clk_lookup lookups[] __initdata = { ++static struct clk_lookup lookups[] = { + _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:59:17.000000000 +0200 +@@ -0,0 +1,65 @@ ++/* ++ * arch/arm/mach-mx2/cpu_mx25.c ++ * ++ * Copyright 2009 Lothar Wassmann ++ * derived from: cpu_mx27.c ++ * Copyright 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., 51 Franklin Street, Fifth Floor, Boston, ++ * MA 02110-1301, USA. ++ */ ++ ++/* ++ * i.MX25 specific CPU detection code ++ */ ++ ++#include ++#include ++ ++#include ++ ++static int cpu_silicon_rev = -1; ++static int cpu_partnumber; ++ ++#define IIM_PREV_REG IO_ADDRESS(IIM_BASE_ADDR + 0x20) ++#define IIM_SREV_REG IO_ADDRESS(IIM_BASE_ADDR + 0x24) ++ ++static void query_silicon_parameter(void) ++{ ++ cpu_partnumber = __raw_readl(IIM_PREV_REG) >> 3; ++ cpu_silicon_rev = __raw_readl(IIM_SREV_REG); ++ ++ printk(KERN_DEBUG "CPU rev: 0x%02x chip_rev: 0x%02x\n", ++ cpu_partnumber, cpu_silicon_rev); ++ if (WARN_ON(cpu_partnumber != 0x1f)) { ++ printk(KERN_WARNING "Unsupported CPU rev: 0x%02x\n", cpu_partnumber); ++ } ++} ++ ++/* ++ * Returns: ++ * the silicon revision of the cpu ++ * -EINVAL - not a mx25 ++ */ ++int mx25_revision(void) ++{ ++ if (cpu_silicon_rev == -1) ++ query_silicon_parameter(); ++ ++ if (cpu_partnumber != 0x1f) ++ return -EINVAL; ++ ++ 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:59:17.000000000 +0200 +@@ -0,0 +1,190 @@ ++/* ++ * Copyright 2008 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 __ARCH_ARM_MACH_MX25_CRM_REGS_H__ ++#define __ARCH_ARM_MACH_MX25_CRM_REGS_H__ ++ ++#include ++ ++/* Register offsets */ ++#define MXC_CCM_MPCTL (IO_ADDRESS(CCM_BASE_ADDR) + 0x00) ++#define MXC_CCM_UPCTL (IO_ADDRESS(CCM_BASE_ADDR) + 0x04) ++#define MXC_CCM_CCTL (IO_ADDRESS(CCM_BASE_ADDR) + 0x08) ++#define MXC_CCM_CGCR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x0C) ++#define MXC_CCM_CGCR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x10) ++#define MXC_CCM_CGCR2 (IO_ADDRESS(CCM_BASE_ADDR) + 0x14) ++#define MXC_CCM_PCDR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x18) ++#define MXC_CCM_PCDR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x1C) ++#define MXC_CCM_PCDR2 (IO_ADDRESS(CCM_BASE_ADDR) + 0x20) ++#define MXC_CCM_PCDR3 (IO_ADDRESS(CCM_BASE_ADDR) + 0x24) ++#define MXC_CCM_RCSR (IO_ADDRESS(CCM_BASE_ADDR) + 0x28) ++#define MXC_CCM_CRDR (IO_ADDRESS(CCM_BASE_ADDR) + 0x2C) ++#define MXC_CCM_DCVR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x30) ++#define MXC_CCM_DCVR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x34) ++#define MXC_CCM_DCVR2 (IO_ADDRESS(CCM_BASE_ADDR) + 0x38) ++#define MXC_CCM_DCVR3 (IO_ADDRESS(CCM_BASE_ADDR) + 0x3C) ++#define MXC_CCM_LTR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x40) ++#define MXC_CCM_LTR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x44) ++#define MXC_CCM_LTR2 (IO_ADDRESS(CCM_BASE_ADDR) + 0x48) ++#define MXC_CCM_LTR3 (IO_ADDRESS(CCM_BASE_ADDR) + 0x4C) ++#define MXC_CCM_LTBR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x50) ++#define MXC_CCM_LTBR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x54) ++#define MXC_CCM_PMCR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x58) ++#define MXC_CCM_PMCR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x5C) ++#define MXC_CCM_PMCR2 (IO_ADDRESS(CCM_BASE_ADDR) + 0x60) ++#define MXC_CCM_MCR (IO_ADDRESS(CCM_BASE_ADDR) + 0x64) ++ ++#define MXC_CCM_MPCTL_BRMO (1 << 31) ++#define MXC_CCM_MPCTL_PD_OFFSET 26 ++#define MXC_CCM_MPCTL_PD_MASK (0xf << 26) ++#define MXC_CCM_MPCTL_MFD_OFFSET 16 ++#define MXC_CCM_MPCTL_MFD_MASK (0x3ff << 16) ++#define MXC_CCM_MPCTL_MFI_OFFSET 10 ++#define MXC_CCM_MPCTL_MFI_MASK (0xf << 10) ++#define MXC_CCM_MPCTL_MFN_OFFSET 0 ++#define MXC_CCM_MPCTL_MFN_MASK 0x3ff ++#define MXC_CCM_MPCTL_LF (1 << 15) ++ ++#define MXC_CCM_UPCTL_BRMO (1 << 31) ++#define MXC_CCM_UPCTL_PD_OFFSET 26 ++#define MXC_CCM_UPCTL_PD_MASK (0xf << 26) ++#define MXC_CCM_UPCTL_MFD_OFFSET 16 ++#define MXC_CCM_UPCTL_MFD_MASK (0x3ff << 16) ++#define MXC_CCM_UPCTL_MFI_OFFSET 10 ++#define MXC_CCM_UPCTL_MFI_MASK (0xf << 10) ++#define MXC_CCM_UPCTL_MFN_OFFSET 0 ++#define MXC_CCM_UPCTL_MFN_MASK 0x3ff ++#define MXC_CCM_UPCTL_LF (1 << 15) ++ ++#define MXC_CCM_CCTL_ARM_OFFSET 30 ++#define MXC_CCM_CCTL_ARM_MASK (0x3 << 30) ++#define MXC_CCM_CCTL_AHB_OFFSET 28 ++#define MXC_CCM_CCTL_AHB_MASK (0x3 << 28) ++#define MXC_CCM_CCTL_MPLL_RST (1 << 27) ++#define MXC_CCM_CCTL_UPLL_RST (1 << 26) ++#define MXC_CCM_CCTL_LP_CTL_OFFSET 24 ++#define MXC_CCM_CCTL_LP_CTL_MASK (0x3 << 24) ++#define MXC_CCM_CCTL_LP_MODE_RUN (0x0 << 24) ++#define MXC_CCM_CCTL_LP_MODE_WAIT (0x1 << 24) ++#define MXC_CCM_CCTL_LP_MODE_DOZE (0x2 << 24) ++#define MXC_CCM_CCTL_LP_MODE_STOP (0x3 << 24) ++#define MXC_CCM_CCTL_UPLL_DISABLE (1 << 23) ++#define MXC_CCM_CCTL_MPLL_BYPASS (1 << 22) ++#define MXC_CCM_CCTL_USB_DIV_OFFSET 16 ++#define MXC_CCM_CCTL_USB_DIV_MASK (0x3 << 16) ++#define MXC_CCM_CCTL_CG_CTRL (1 << 15) ++#define MXC_CCM_CCTL_ARM_SRC (1 << 14) ++ ++#define MXC_CCM_CGCR0_HCLK_ATA_OFFSET 16 ++#define MXC_CCM_CGCR0_HCLK_BROM_OFFSET 17 ++#define MXC_CCM_CGCR0_HCLK_CSI_OFFSET 18 ++#define MXC_CCM_CGCR0_HCLK_EMI_OFFSET 19 ++#define MXC_CCM_CGCR0_HCLK_ESAI_OFFSET 20 ++#define MXC_CCM_CGCR0_HCLK_ESDHC1_OFFSET 21 ++#define MXC_CCM_CGCR0_HCLK_ESDHC2_OFFSET 22 ++#define MXC_CCM_CGCR0_HCLK_FEC_OFFSET 23 ++#define MXC_CCM_CGCR0_HCLK_LCDC_OFFSET 24 ++#define MXC_CCM_CGCR0_HCLK_RTIC_OFFSET 25 ++#define MXC_CCM_CGCR0_HCLK_SDMA_OFFSET 26 ++#define MXC_CCM_CGCR0_HCLK_SLCDC_OFFSET 27 ++#define MXC_CCM_CGCR0_HCLK_USBOTG_OFFSET 28 ++ ++#define MXC_CCM_CGCR0_PER_CSI_OFFSET 0 ++#define MXC_CCM_CGCR0_PER_EPIT_OFFSET 1 ++#define MXC_CCM_CGCR0_PER_ESAI_OFFSET 2 ++#define MXC_CCM_CGCR0_PER_ESDHC1_OFFSET 3 ++#define MXC_CCM_CGCR0_PER_ESDHC2_OFFSET 4 ++#define MXC_CCM_CGCR0_PER_GPT_OFFSET 5 ++#define MXC_CCM_CGCR0_PER_I2C_OFFSET 6 ++#define MXC_CCM_CGCR0_PER_LCDC_OFFSET 7 ++#define MXC_CCM_CGCR0_PER_NFC_OFFSET 8 ++#define MXC_CCM_CGCR0_PER_OWIRE_OFFSET 9 ++#define MXC_CCM_CGCR0_PER_PWM_OFFSET 10 ++#define MXC_CCM_CGCR0_PER_SIM1_OFFSET 11 ++#define MXC_CCM_CGCR0_PER_SIM2_OFFSET 12 ++#define MXC_CCM_CGCR0_PER_SSI1_OFFSET 13 ++#define MXC_CCM_CGCR0_PER_SSI2_OFFSET 14 ++#define MXC_CCM_CGCR0_PER_UART_OFFSET 15 ++ ++#define MXC_CCM_CGCR1_AUDMUX_OFFSET 0 ++#define MXC_CCM_CGCR1_ATA_OFFSET 1 ++#define MXC_CCM_CGCR1_CAN1_OFFSET 2 ++#define MXC_CCM_CGCR1_CAN2_OFFSET 3 ++#define MXC_CCM_CGCR1_CSI_OFFSET 4 ++#define MXC_CCM_CGCR1_CSPI1_OFFSET 5 ++#define MXC_CCM_CGCR1_CSPI2_OFFSET 6 ++#define MXC_CCM_CGCR1_CSPI3_OFFSET 7 ++#define MXC_CCM_CGCR1_DRYICE_OFFSET 8 ++#define MXC_CCM_CGCR1_ECT_OFFSET 9 ++#define MXC_CCM_CGCR1_EPIT1_OFFSET 10 ++#define MXC_CCM_CGCR1_EPIT2_OFFSET 11 ++#define MXC_CCM_CGCR1_ESAI_OFFSET 12 ++#define MXC_CCM_CGCR1_ESDHC1_OFFSET 13 ++#define MXC_CCM_CGCR1_ESDHC2_OFFSET 14 ++#define MXC_CCM_CGCR1_FEC_OFFSET 15 ++#define MXC_CCM_CGCR1_GPIO1_OFFSET 16 ++#define MXC_CCM_CGCR1_GPIO2_OFFSET 17 ++#define MXC_CCM_CGCR1_GPIO3_OFFSET 18 ++#define MXC_CCM_CGCR1_GPT1_OFFSET 19 ++#define MXC_CCM_CGCR1_GPT2_OFFSET 20 ++#define MXC_CCM_CGCR1_GPT3_OFFSET 21 ++#define MXC_CCM_CGCR1_GPT4_OFFSET 22 ++#define MXC_CCM_CGCR1_I2C1_OFFSET 23 ++#define MXC_CCM_CGCR1_I2C2_OFFSET 24 ++#define MXC_CCM_CGCR1_I2C3_OFFSET 25 ++#define MXC_CCM_CGCR1_IIM_OFFSET 26 ++#define MXC_CCM_CGCR1_IOMUXC_OFFSET 27 ++#define MXC_CCM_CGCR1_KPP_OFFSET 28 ++#define MXC_CCM_CGCR1_LCDC_OFFSET 29 ++#define MXC_CCM_CGCR1_OWIRE_OFFSET 30 ++#define MXC_CCM_CGCR1_PWM1_OFFSET 31 ++ ++#define MXC_CCM_CGCR2_PWM2_OFFSET (32-32) ++#define MXC_CCM_CGCR2_PWM3_OFFSET (33-32) ++#define MXC_CCM_CGCR2_PWM4_OFFSET (34-32) ++#define MXC_CCM_CGCR2_RNGB_OFFSET (35-32) ++#define MXC_CCM_CGCR2_RTIC_OFFSET (36-32) ++#define MXC_CCM_CGCR2_SCC_OFFSET (37-32) ++#define MXC_CCM_CGCR2_SDMA_OFFSET (38-32) ++#define MXC_CCM_CGCR2_SIM1_OFFSET (39-32) ++#define MXC_CCM_CGCR2_SIM2_OFFSET (40-32) ++#define MXC_CCM_CGCR2_SLCDC_OFFSET (41-32) ++#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_UART1_OFFSET (46-32) ++#define MXC_CCM_CGCR2_UART2_OFFSET (47-32) ++#define MXC_CCM_CGCR2_UART3_OFFSET (48-32) ++#define MXC_CCM_CGCR2_UART4_OFFSET (49-32) ++#define MXC_CCM_CGCR2_UART5_OFFSET (50-32) ++#define MXC_CCM_CGCR2_WDOG_OFFSET (51-32) ++ ++#define MXC_CCM_PCDR1_PERDIV1_MASK 0x3f ++ ++#define MXC_CCM_RCSR_NF16B (1 << 14) ++ ++#define MXC_CCM_MCR_USB_XTAL_MUX_OFFSET 31 ++#define MXC_CCM_MCR_CLKO_EN_OFFSET 30 ++#define MXC_CCM_MCR_CLKO_DIV_OFFSET 24 ++#define MXC_CCM_MCR_CLKO_DIV_MASK (0x3F << 24) ++#define MXC_CCM_MCR_CLKO_SEL_OFFSET 20 ++#define MXC_CCM_MCR_CLKO_SEL_MASK (0xF << 20) ++#define MXC_CCM_MCR_ESAI_CLK_MUX_OFFSET 19 ++#define MXC_CCM_MCR_SSI2_CLK_MUX_OFFSET 18 ++#define MXC_CCM_MCR_SSI1_CLK_MUX_OFFSET 17 ++#define MXC_CCM_MCR_USB_CLK_MUX_OFFSET 16 ++ ++#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:59:16.000000000 +0200 +@@ -20,3 +20,9 @@ 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; ++#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:59:17.000000000 +0200 +@@ -0,0 +1,402 @@ ++/* ++ * Copyright 2008 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 ++ */ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++ ++#include "sdma_script_code.h" ++ ++#include "karo.h" ++ ++void mx25_sdma_get_script_info(sdma_script_start_addrs * sdma_script_addr) ++{ ++ sdma_script_addr->mxc_sdma_ap_2_ap_addr = ap_2_ap_ADDR; ++ sdma_script_addr->mxc_sdma_ap_2_bp_addr = -1; ++ sdma_script_addr->mxc_sdma_bp_2_ap_addr = -1; ++ sdma_script_addr->mxc_sdma_loopback_on_dsp_side_addr = -1; ++ sdma_script_addr->mxc_sdma_mcu_interrupt_only_addr = -1; ++ ++ sdma_script_addr->mxc_sdma_firi_2_per_addr = -1; ++ sdma_script_addr->mxc_sdma_firi_2_mcu_addr = -1; ++ sdma_script_addr->mxc_sdma_per_2_firi_addr = -1; ++ sdma_script_addr->mxc_sdma_mcu_2_firi_addr = -1; ++ ++ sdma_script_addr->mxc_sdma_uart_2_per_addr = uart_2_per_ADDR; ++ sdma_script_addr->mxc_sdma_uart_2_mcu_addr = uart_2_mcu_ADDR; ++ sdma_script_addr->mxc_sdma_per_2_app_addr = per_2_app_ADDR; ++ sdma_script_addr->mxc_sdma_mcu_2_app_addr = mcu_2_app_ADDR; ++ ++ sdma_script_addr->mxc_sdma_per_2_per_addr = -1; ++ ++ sdma_script_addr->mxc_sdma_uartsh_2_per_addr = uartsh_2_per_ADDR; ++ sdma_script_addr->mxc_sdma_uartsh_2_mcu_addr = uartsh_2_mcu_ADDR; ++ sdma_script_addr->mxc_sdma_per_2_shp_addr = per_2_shp_ADDR; ++ sdma_script_addr->mxc_sdma_mcu_2_shp_addr = mcu_2_shp_ADDR; ++ ++ sdma_script_addr->mxc_sdma_ata_2_mcu_addr = ata_2_mcu_ADDR; ++ sdma_script_addr->mxc_sdma_mcu_2_ata_addr = mcu_2_ata_ADDR; ++ ++ sdma_script_addr->mxc_sdma_app_2_per_addr = app_2_per_ADDR; ++ sdma_script_addr->mxc_sdma_app_2_mcu_addr = app_2_mcu_ADDR; ++ sdma_script_addr->mxc_sdma_shp_2_per_addr = shp_2_per_ADDR; ++ sdma_script_addr->mxc_sdma_shp_2_mcu_addr = shp_2_mcu_ADDR; ++ ++ sdma_script_addr->mxc_sdma_mshc_2_mcu_addr = -1; ++ sdma_script_addr->mxc_sdma_mcu_2_mshc_addr = -1; ++ ++ sdma_script_addr->mxc_sdma_spdif_2_mcu_addr = -1; ++ sdma_script_addr->mxc_sdma_mcu_2_spdif_addr = -1; ++ ++ sdma_script_addr->mxc_sdma_asrc_2_mcu_addr = -1; ++ ++ sdma_script_addr->mxc_sdma_dptc_dvfs_addr = -1; ++ sdma_script_addr->mxc_sdma_ext_mem_2_ipu_addr = ext_mem__ipu_ram_ADDR; ++ sdma_script_addr->mxc_sdma_descrambler_addr = -1; ++ ++ sdma_script_addr->mxc_sdma_start_addr = (unsigned short *)sdma_code; ++ sdma_script_addr->mxc_sdma_ram_code_size = RAM_CODE_SIZE; ++ sdma_script_addr->mxc_sdma_ram_code_start_addr = RAM_CODE_START_ADDR; ++} ++ ++#if defined(CONFIG_MXC_WATCHDOG) || defined(CONFIG_MXC_WATCHDOG_MODULE) ++static struct resource wdt_resources[] = { ++ { ++ .start = WDOG_BASE_ADDR, ++ .end = WDOG_BASE_ADDR + 0x2f, ++ .flags = IORESOURCE_MEM, ++ }, ++}; ++ ++static struct platform_device mx25_wdt_device = { ++ .name = "mxc_wdt", ++ .id = 0, ++ .num_resources = ARRAY_SIZE(wdt_resources), ++ .resource = wdt_resources, ++}; ++ ++static void mx25_init_wdt(void) ++{ ++ (void)platform_device_register(&mx25_wdt_device); ++} ++#else ++static inline void mx25_init_wdt(void) ++{ ++} ++#endif ++ ++/* ++ * lcdc: ++ * - i.MX1: the basic controller ++ * - i.MX21: to be checked ++ * - i.MX27: like i.MX1, with slightly variations ++ */ ++static struct resource mxc_fb[] = { ++ { ++ .start = LCDC_BASE_ADDR, ++ .end = LCDC_BASE_ADDR + 0xFFF, ++ .flags = IORESOURCE_MEM, ++ }, ++ { ++ .start = MXC_INT_LCDC, ++ .end = MXC_INT_LCDC, ++ .flags = IORESOURCE_IRQ, ++ } ++}; ++ ++/* mxc lcd driver */ ++struct platform_device mxc_fb_device = { ++ .name = "imx-fb", ++ .id = 0, ++ .num_resources = ARRAY_SIZE(mxc_fb), ++ .resource = mxc_fb, ++ .dev = { ++ .coherent_dma_mask = 0xFFFFFFFF, ++ }, ++}; ++ ++/* SPI controller and device data */ ++#if defined(CONFIG_SPI_MXC) || defined(CONFIG_SPI_MXC_MODULE) ++ ++#ifdef CONFIG_SPI_MXC_SELECT1 ++/*! ++ * 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, ++ }, ++}; ++ ++/*! Platform Data for MXC CSPI1 */ ++static struct mxc_spi_master mx25_spi1_data = { ++ .maxchipselect = 4, ++ .spi_version = 7, ++}; ++ ++/*! Device Definition for MXC CSPI1 */ ++static struct platform_device mx25_spi1_device = { ++ .name = "mxc_spi", ++ .id = 0, ++ .dev = { ++ .platform_data = &mx25_spi1_data, ++ }, ++ .num_resources = ARRAY_SIZE(mx25_spi1_resources), ++ .resource = mx25_spi1_resources, ++}; ++ ++#endif /* CONFIG_SPI_MXC_SELECT1 */ ++ ++#ifdef CONFIG_SPI_MXC_SELECT2 ++/*! ++ * 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, ++ }, ++}; ++ ++/*! Platform Data for MXC CSPI2 */ ++static struct mxc_spi_master mx25_spi2_data = { ++ .maxchipselect = 4, ++ .spi_version = 7, ++}; ++ ++/*! Device Definition for MXC CSPI2 */ ++static struct platform_device mx25_spi2_device = { ++ .name = "mxc_spi", ++ .id = 1, ++ .dev = { ++ .platform_data = &mx25_spi2_data, ++ }, ++ .num_resources = ARRAY_SIZE(mx25_spi2_resources), ++ .resource = mx25_spi2_resources, ++}; ++#endif /* CONFIG_SPI_MXC_SELECT2 */ ++ ++#ifdef CONFIG_SPI_MXC_SELECT3 ++/*! ++ * 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, ++ }, ++}; ++ ++/*! Platform Data for MXC CSPI3 */ ++static struct mxc_spi_master mx25_spi3_data = { ++ .maxchipselect = 4, ++ .spi_version = 7, ++}; ++ ++/*! Device Definition for MXC CSPI3 */ ++static struct platform_device mx25_spi3_device = { ++ .name = "mxc_spi", ++ .id = 2, ++ .dev = { ++ .platform_data = &mx25_spi3_data, ++ }, ++ .num_resources = ARRAY_SIZE(mx25_spi3_resources), ++ .resource = mx25_spi3_resources, ++}; ++#endif /* CONFIG_SPI_MXC_SELECT3 */ ++ ++static inline void mx25_init_spi(void) ++{ ++ spba_take_ownership(SPBA_CSPI2, SPBA_MASTER_A); ++ spba_take_ownership(SPBA_CSPI3, SPBA_MASTER_A); ++ ++#ifdef CONFIG_SPI_MXC_SELECT1 ++ if (platform_device_register(&mx25_spi1_device) < 0) ++ printk(KERN_ERR "Error: Registering the SPI Controller_1\n"); ++#endif /* CONFIG_SPI_MXC_SELECT1 */ ++#ifdef CONFIG_SPI_MXC_SELECT2 ++ if (platform_device_register(&mx25_spi2_device) < 0) ++ printk(KERN_ERR "Error: Registering the SPI Controller_2\n"); ++#endif /* CONFIG_SPI_MXC_SELECT2 */ ++#ifdef CONFIG_SPI_MXC_SELECT3 ++ if (platform_device_register(&mx25_spi3_device) < 0) ++ printk(KERN_ERR "Error: Registering the SPI Controller_3\n"); ++#endif /* CONFIG_SPI_MXC_SELECT3 */ ++} ++#else ++static inline void mx25_init_spi(void) ++{ ++} ++#endif ++ ++/* I2C controller and device data */ ++#if defined(CONFIG_I2C_IMX) || defined(CONFIG_I2C_IMX_MODULE) ++ ++/*! ++ * 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, ++ }, ++}; ++ ++/*! ++ * 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, ++ }, ++}; ++ ++/*! ++ * 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, ++ }, ++}; ++ ++/*! Device Definition for MXC I2C1 */ ++struct platform_device mx25_i2c_device0 = { ++ .name = "imx-i2c", ++ .id = 0, ++ .num_resources = ARRAY_SIZE(mx25_i2c1_resources), ++ .resource = mx25_i2c1_resources, ++}; ++ ++struct platform_device mx25_i2c_device1 = { ++ .name = "imx-i2c", ++ .id = 1, ++ .num_resources = ARRAY_SIZE(mx25_i2c2_resources), ++ .resource = mx25_i2c2_resources, ++}; ++ ++struct platform_device mx25_i2c_device2 = { ++ .name = "imx-i2c", ++ .id = 2, ++ .num_resources = ARRAY_SIZE(mx25_i2c3_resources), ++ .resource = mx25_i2c3_resources, ++}; ++#endif ++ ++static struct mxc_gpio_port mx25_gpio_ports[] = { ++ { ++ .chip.label = "gpio-1", ++ .base = IO_ADDRESS(GPIO1_BASE_ADDR), ++ .irq = MXC_INT_GPIO1, ++ .virtual_irq_start = MXC_GPIO_IRQ_START, ++ }, ++ { ++ .chip.label = "gpio-2", ++ .base = IO_ADDRESS(GPIO2_BASE_ADDR), ++ .irq = MXC_INT_GPIO2, ++ .virtual_irq_start = MXC_GPIO_IRQ_START + 1 * 32, ++ }, ++ { ++ .chip.label = "gpio-3", ++ .base = IO_ADDRESS(GPIO3_BASE_ADDR), ++ .irq = MXC_INT_GPIO3, ++ .virtual_irq_start = MXC_GPIO_IRQ_START + 2 * 32, ++ }, ++ { ++ .chip.label = "gpio-4", ++ .base = IO_ADDRESS(GPIO4_BASE_ADDR), ++ .irq = MXC_INT_GPIO4, ++ .virtual_irq_start = MXC_GPIO_IRQ_START + 3 * 32, ++ }, ++}; ++ ++static inline void mx25_init_ssi(void) ++{ ++ /* SPBA configuration for SSI - SDMA and MCU are set */ ++ spba_take_ownership(SPBA_SSI1, SPBA_MASTER_A | SPBA_MASTER_C); ++ spba_take_ownership(SPBA_SSI2, SPBA_MASTER_A | SPBA_MASTER_C); ++} ++ ++static struct platform_device mx25_dma_device = { ++ .name = "mxc_dma", ++ .id = 0, ++}; ++ ++static inline void mx25_init_dma(void) ++{ ++ (void)platform_device_register(&mx25_dma_device); ++} ++ ++static int __init mx25_init_devices(void) ++{ ++ mx25_init_wdt(); ++ mx25_init_spi(); ++ mx25_init_dma(); ++ mx25_init_ssi(); ++ ++ return 0; ++} ++arch_initcall(mx25_init_devices); ++ ++int __init mxc_register_gpios(void) ++{ ++ 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:59:16.000000000 +0200 +@@ -26,6 +26,7 @@ + #include + + /* MX27 memory map definition */ ++#if defined(CONFIG_MACH_MX27) || defined(CONFIG_MACH_MX21) + static struct map_desc mxc_io_desc[] __initdata = { + /* + * this fixed mapping covers: +@@ -61,7 +62,7 @@ static struct map_desc mxc_io_desc[] __i + .pfn = __phys_to_pfn(X_MEMC_BASE_ADDR), + .length = X_MEMC_SIZE, + .type = MT_DEVICE +- } ++ }, + }; + + /* +@@ -82,4 +83,46 @@ void __init mx27_map_io(void) + + iotable_init(mxc_io_desc, ARRAY_SIZE(mxc_io_desc)); + } ++#endif ++ ++#ifdef CONFIG_MACH_MX25 ++static struct map_desc mx25_io_desc[] __initdata = { ++ { ++ .virtual = (unsigned long)X_MEMC_BASE_ADDR_VIRT, ++ .pfn = __phys_to_pfn(X_MEMC_BASE_ADDR), ++ .length = X_MEMC_SIZE, ++ .type = MT_DEVICE ++ }, ++ { ++ .virtual = (unsigned long)ASIC_BASE_ADDR_VIRT, ++ .pfn = __phys_to_pfn(ASIC_BASE_ADDR), ++ .length = ASIC_SIZE, ++ .type = MT_DEVICE_NONSHARED ++ }, ++ { ++ .virtual = (unsigned long)AIPS1_BASE_ADDR_VIRT, ++ .pfn = __phys_to_pfn(AIPS1_BASE_ADDR), ++ .length = AIPS1_SIZE, ++ .type = MT_DEVICE_NONSHARED ++ }, ++ { ++ .virtual = (unsigned long)AIPS2_BASE_ADDR_VIRT, ++ .pfn = __phys_to_pfn(AIPS2_BASE_ADDR), ++ .length = AIPS2_SIZE, ++ .type = MT_DEVICE_NONSHARED ++ }, ++ { ++ .virtual = (unsigned long)SPBA0_BASE_ADDR_VIRT, ++ .pfn = __phys_to_pfn(SPBA0_BASE_ADDR), ++ .length = SPBA0_SIZE, ++ .type = MT_DEVICE_NONSHARED ++ }, ++}; ++ ++void __init mx25_map_io(void) ++{ ++ mxc_set_cpu_type(MXC_CPU_MX25); + ++ 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-08 12:47:51.000000000 +0200 +@@ -0,0 +1,1122 @@ ++/* ++ * arch/arm/mach-mx2/karo-tx25.c ++ * ++ * Copyright (C) 2008 Lothar Wassmann ++ * ++ * based on: arch/arm/mach-mx27ads.c (C) 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 ++ * 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 ++ * ++ * This file adds support for the Ka-Ro electronics TX25 processor modules ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++//#include ++//#include ++#include ++#include ++#include ++#if defined(CONFIG_MTD) || defined(CONFIG_MTD_MODULE) ++#include ++#include ++#include ++#include ++#endif ++ ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++//#include ++//#include ++#include ++#include ++#include ++//#include ++//#include ++//#include ++ ++#include "crm_regs.h" ++#include "devices.h" ++#include "karo.h" ++ ++#ifdef DEBUG ++int tx25_debug = 1; ++module_param(tx25_debug, int, S_IRUGO | S_IWUSR); ++#else ++static int tx25_debug; ++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) ++{ ++ 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); ++ } ++ } ++ 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; ++} ++device_initcall(tx25_usbh2_register); ++#endif // CONFIG_USB_EHCI_MXC ++ ++//#define FEC_MII_IRQ IRQ_GPIOD(8) ++ ++#if defined(CONFIG_FEC) || defined(CONFIG_FEC_MODULE) ++static struct resource fec_resources[] = { ++ { ++ .start = FEC_BASE_ADDR, ++ .end = FEC_BASE_ADDR + 0x18f, ++ .flags = IORESOURCE_MEM, ++ }, { ++ .start = FEC_BASE_ADDR + 0x200, ++ .end = FEC_BASE_ADDR + 0x30b, ++ .flags = IORESOURCE_MEM, ++ }, { ++ .start = MXC_INT_FEC, ++ .end = MXC_INT_FEC, ++ .flags = IORESOURCE_IRQ, ++#ifdef FEC_MII_IRQ ++ }, { ++ .start = FEC_MII_IRQ, ++ .end = FEC_MII_IRQ, ++ .flags = IORESOURCE_IRQ | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, ++#endif ++ }, ++}; ++ ++/* ++ * Setup GPIO for FEC device to be active ++ * ++ */ ++static struct pad_desc karo_tx25_fec_gpios_off[] = { ++ MX25_PAD_FEC_MDC__GPIO_3_5, ++ MX25_PAD_FEC_MDIO__GPIO_3_6, ++ MX25_PAD_FEC_TDATA0__GPIO_3_7, ++ MX25_PAD_FEC_TDATA1__GPIO_3_8, ++ MX25_PAD_FEC_TX_EN__GPIO_3_9, ++ MX25_PAD_FEC_RDATA0__GPIO_3_10, ++ MX25_PAD_FEC_RDATA1__GPIO_3_11, ++ MX25_PAD_FEC_RX_DV__GPIO_3_12, ++ MX25_PAD_FEC_TX_CLK__GPIO_3_13, ++ MX25_PAD_D12__GPIO_4_8, ++ MX25_PAD_D10__GPIO_4_10, ++}; ++ ++static struct pad_desc karo_tx25_fec_pwr_gpios[] = { ++ MX25_PAD_D11__GPIO_4_9, /* FEC PHY power on pin */ ++ MX25_PAD_D13__GPIO_4_7, /* FEC reset */ ++}; ++ ++static struct pad_desc karo_tx25_fec_gpios_on[] = { ++ MX25_PAD_FEC_MDC__FEC_MDC, ++ MX25_PAD_FEC_MDIO__FEC_MDIO, ++ MX25_PAD_FEC_TDATA0__FEC_TDATA0, ++ MX25_PAD_FEC_TDATA1__FEC_TDATA1, ++ MX25_PAD_FEC_TX_EN__FEC_TX_EN, ++ MX25_PAD_FEC_RDATA0__FEC_RDATA0, ++ MX25_PAD_FEC_RDATA1__FEC_RDATA1, ++ MX25_PAD_FEC_RX_DV__FEC_RX_DV, ++ MX25_PAD_FEC_TX_CLK__FEC_TX_CLK, ++ MX25_PAD_D12__GPIO_4_8, ++ MX25_PAD_D10__GPIO_4_10, ++}; ++ ++static struct gpio_desc { ++ unsigned int gpio:7; ++ unsigned int dir:1; ++ unsigned int level:1; ++} karo_tx25_fec_strap_gpios[] = { ++ /* configure the PHY strap pins to the correct values */ ++ { GPIO_PORTC | 5, 1, 0, }, ++ { GPIO_PORTC | 6, 1, 0, }, ++ { GPIO_PORTC | 7, 1, 0, }, ++ { GPIO_PORTC | 8, 1, 0, }, ++ { GPIO_PORTC | 9, 1, 0, }, ++ { GPIO_PORTC | 10, 1, 1, }, ++ { GPIO_PORTC | 11, 1, 1, }, ++ { GPIO_PORTC | 12, 0, 1, }, ++ { GPIO_PORTC | 13, 1, 0, }, ++ ++ { GPIO_PORTD | 8, 0, 0, }, ++ { GPIO_PORTD | 10, 0, 0, }, ++ { GPIO_PORTD | 9, 1, 1, }, ++ { GPIO_PORTD | 7, 1, 0, }, ++}; ++ ++#define TX25_FEC_PWR_GPIO (GPIO_PORTD | 9) ++#define TX25_FEC_RST_GPIO (GPIO_PORTD | 7) ++ ++static int gpio_fec_active(void) ++{ ++ int ret; ++ int i; ++ ++#ifdef FEC_MII_IRQ ++ DBG(0, "%s: Using IRQ %d (GPIO %d) for MII\n", __FUNCTION__, ++ FEC_MII_IRQ, irq_to_gpio(FEC_MII_IRQ)); ++ ++ set_irq_type(FEC_MII_IRQ, IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING); ++#endif ++ ret = mxc_iomux_v3_setup_multiple_pads(karo_tx25_fec_pwr_gpios, ++ ARRAY_SIZE(karo_tx25_fec_pwr_gpios)); ++ if (ret) { ++ return ret; ++ } ++ /* ++ * If the PHY is already powered on, assume it has been ++ * correctly configured (by the boot loader) ++ */ ++ if (0 && gpio_get_value(TX25_FEC_PWR_GPIO) && ++ gpio_get_value(TX25_FEC_RST_GPIO)) { ++ ret = mxc_iomux_v3_setup_multiple_pads(karo_tx25_fec_gpios_on, ++ ARRAY_SIZE(karo_tx25_fec_gpios_on)); ++ if (ret) { ++ mxc_iomux_v3_release_multiple_pads(karo_tx25_fec_pwr_gpios, ++ ARRAY_SIZE(karo_tx25_fec_pwr_gpios)); ++ return ret; ++ } ++ } else { ++ /* switch PHY strap pins into required state */ ++ ret = mxc_iomux_v3_setup_multiple_pads(karo_tx25_fec_gpios_off, ++ ARRAY_SIZE(karo_tx25_fec_gpios_off)); ++ if (ret) { ++ mxc_iomux_v3_release_multiple_pads(karo_tx25_fec_pwr_gpios, ++ ARRAY_SIZE(karo_tx25_fec_pwr_gpios)); ++ 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]; ++ ++ ret = gpio_request(pd->gpio, "FEC"); ++ if (ret < 0) { ++ DBG(0, "%s: Failed to request GPIO%d_%d: %d\n", ++ __FUNCTION__, pd->gpio / 32 + 1, pd->gpio % 32, ret); ++ goto rel_mux; ++ } ++ if (pd->dir) { ++ gpio_direction_output(pd->gpio, ++ pd->level); ++ } else { ++ gpio_direction_input(pd->gpio); ++ } ++ } ++#ifdef DEBUG ++ for (i = 0; i < ARRAY_SIZE(karo_tx25_fec_strap_gpios); i++) { ++ struct gpio_desc *pd = &karo_tx25_fec_strap_gpios[i]; ++ int grp = pd->gpio / 32 + 1; ++ int ofs = pd->gpio % 32; ++ ++ if (pd->dir && pd->level != gpio_get_value(pd->gpio)) { ++ DBG(0, "%s: GPIO%d_%d is %d instead of %d\n", __FUNCTION__, ++ grp, ofs, gpio_get_value(pd->gpio), ++ pd->level); ++ } ++ } ++#endif ++ DBG(0, "%s: Delaying for 22ms\n", __FUNCTION__); ++ mdelay(22); ++ DBG(0, "%s: Deasserting FEC PHY reset\n", __FUNCTION__); ++ gpio_set_value(TX25_FEC_RST_GPIO, 1); ++#ifdef DEBUG ++ for (i = 0; i < ARRAY_SIZE(karo_tx25_fec_strap_gpios); i++) { ++ struct gpio_desc *pd = &karo_tx25_fec_strap_gpios[i]; ++ int grp = pd->gpio / 32 + 1; ++ int ofs = pd->gpio % 32; ++ ++ DBG(0, "%s: GPIO%d_%d is %d\n", __FUNCTION__, ++ grp, ofs, gpio_get_value(pd->gpio)); ++ } ++#endif ++ mxc_iomux_v3_release_multiple_pads(karo_tx25_fec_gpios_off, ++ ARRAY_SIZE(karo_tx25_fec_gpios_off)); ++ ret = mxc_iomux_v3_setup_multiple_pads(karo_tx25_fec_gpios_on, ++ ARRAY_SIZE(karo_tx25_fec_gpios_on)); ++ if (ret) { ++ goto rel_gpio; ++ } ++#ifdef DEBUG ++ for (i = 0; i < ARRAY_SIZE(karo_tx25_fec_strap_gpios); i++) { ++ struct gpio_desc *pd = &karo_tx25_fec_strap_gpios[i]; ++ int grp = pd->gpio / 32 + 1; ++ int ofs = pd->gpio % 32; ++ ++ DBG(0, "%s: GPIO%d_%d is %d\n", __FUNCTION__, ++ grp, ofs, gpio_get_value(pd->gpio)); ++ } ++#endif ++ } ++ return ret; ++ ++ rel_mux: ++ mxc_iomux_v3_release_multiple_pads(karo_tx25_fec_gpios_off, ++ ARRAY_SIZE(karo_tx25_fec_gpios_off)); ++ 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, ++ ARRAY_SIZE(karo_tx25_fec_pwr_gpios)); ++ return ret; ++} ++ ++/* ++ * Setup GPIO for FEC device to be inactive ++ * ++ */ ++static void gpio_fec_inactive(void) ++{ ++ int i; ++ ++ mxc_iomux_v3_release_multiple_pads(karo_tx25_fec_gpios_on, ++ ARRAY_SIZE(karo_tx25_fec_gpios_on)); ++ mxc_iomux_v3_setup_multiple_pads(karo_tx25_fec_gpios_off, ++ ARRAY_SIZE(karo_tx25_fec_gpios_off)); ++ DBG(0, "%s: Asserting FEC PHY reset\n", __FUNCTION__); ++ gpio_set_value(TX25_FEC_RST_GPIO, 0); ++ DBG(0, "%s: Switching FEC PHY power off\n", __FUNCTION__); ++ gpio_set_value(TX25_FEC_PWR_GPIO, 0); ++ ++ mxc_iomux_v3_release_multiple_pads(karo_tx25_fec_gpios_off, ++ ARRAY_SIZE(karo_tx25_fec_gpios_off)); ++ mxc_iomux_v3_release_multiple_pads(karo_tx25_fec_pwr_gpios, ++ 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); ++ } ++} ++ ++static struct clk *tx25_fec_clk; ++ ++static int tx25_fec_suspend(struct platform_device *pdev) ++{ ++ BUG_ON(tx25_fec_clk == NULL); ++ DBG(1, "%s: Switching FEC PHY off\n", __FUNCTION__); ++ gpio_fec_inactive(); ++ clk_disable(tx25_fec_clk); ++ return 0; ++} ++ ++static int tx25_fec_resume(struct platform_device *pdev) ++{ ++ BUG_ON(tx25_fec_clk == NULL); ++ DBG(1, "%s: Switching FEC PHY on\n", __FUNCTION__); ++ clk_enable(tx25_fec_clk); ++ gpio_fec_active(); ++ 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; ++ ++ DBG(0, "%s: Activating FEC GPIOs\n", __FUNCTION__); ++ dump_regs(); ++ ++ ret = gpio_fec_active(); ++ if (ret) { ++ printk(KERN_ERR "%s: could not enable FEC gpios: %d\n", __FUNCTION__, ret); ++ return ret; ++ } ++ ++ BUG_ON(tx25_fec_clk != NULL); ++ tx25_fec_clk = clk_get(&pdev->dev, NULL); ++ if (unlikely(IS_ERR(tx25_fec_clk))) { ++ printk(KERN_ERR "Failed to get fec_clk\n"); ++ return PTR_ERR(tx25_fec_clk); ++ } ++ DBG(0, "%s: Enabling FEC clock\n", __FUNCTION__); ++ clk_enable(tx25_fec_clk); ++ dump_regs(); ++ return 0; ++} ++ ++static void fec_arch_exit(struct platform_device *pdev) ++{ ++ BUG_ON(tx25_fec_clk == NULL); ++ if (unlikely(IS_ERR(tx25_fec_clk))) { ++ printk(KERN_ERR "Failed to get fec_clk\n"); ++ return; ++ } ++ DBG(0, "%s: Disabling FEC clock\n", __FUNCTION__); ++ clk_disable(tx25_fec_clk); ++ clk_put(tx25_fec_clk); ++ tx25_fec_clk = NULL; ++ DBG(0, "%s: Deactivating FEC GPIOs\n", __FUNCTION__); ++ gpio_fec_inactive(); ++} ++ ++static struct fec_enet_platform_data fec_data = { ++ .arch_init = fec_arch_init, ++ .arch_exit = fec_arch_exit, ++ .suspend = tx25_fec_suspend, ++ .resume = tx25_fec_resume, ++}; ++ ++static struct platform_device fec_device = { ++ .name = "fec", ++ .id = 0, ++ .num_resources = ARRAY_SIZE(fec_resources), ++ .resource = fec_resources, ++ .dev = { ++ .platform_data = &fec_data, ++ .coherent_dma_mask = 0xFFFFFFFF, ++ }, ++}; ++#endif ++ ++/* MTD NAND flash */ ++#if defined(CONFIG_MTD_NAND_MXC) || defined(CONFIG_MTD_NAND_MXC_MODULE) ++static struct pad_desc karo_tx25_nand_pads[] = { ++ MX25_PAD_NF_CE0__NF_CE0, ++ MX25_PAD_NFWE_B__NFWE_B, ++ MX25_PAD_NFRE_B__NFRE_B, ++ MX25_PAD_NFALE__NFALE, ++ MX25_PAD_NFCLE__NFCLE, ++ MX25_PAD_NFWP_B__NFWP_B, ++ MX25_PAD_NFRB__NFRB, ++ MX25_PAD_D7__D7, ++ MX25_PAD_D6__D6, ++ MX25_PAD_D5__D5, ++ MX25_PAD_D4__D4, ++ MX25_PAD_D3__D3, ++ MX25_PAD_D2__D2, ++ MX25_PAD_D1__D1, ++ MX25_PAD_D0__D0, ++}; ++ ++#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 int tx25_nand_init(void) ++{ ++ int ret; ++ ++ DBG(0, "%s: Configuring NAND pins\n", __FUNCTION__); ++ ret = mxc_iomux_v3_setup_multiple_pads(karo_tx25_nand_pads, ++ ARRAY_SIZE(karo_tx25_nand_pads)); ++ if (ret) { ++ return ret; ++ } ++ 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, ++}; ++ ++static int tx25_nand_init(void) ++{ ++ int ret; ++ ++ DBG(0, "%s: Configuring NAND pins\n", __FUNCTION__); ++ ret = mxc_iomux_v3_setup_multiple_pads(karo_tx25_nand_pads, ++ ARRAY_SIZE(karo_tx25_nand_pads)); ++ if (ret) { ++ return ret; ++ } ++ return 0; ++} ++arch_initcall(tx25_nand_init); ++#endif ++ ++static struct resource tx25_nand_resources[] = { ++ { ++ .start = NFC_BASE_ADDR + 0x1e00, ++ .end = NFC_BASE_ADDR + 0x1e2f, ++ .flags = IORESOURCE_MEM, ++ }, { ++ .start = NFC_BASE_ADDR, ++ .end = NFC_BASE_ADDR + 0x11ff, ++ .flags = IORESOURCE_MEM, ++ }, { ++ .start = MXC_INT_NANDFC, ++ .end = MXC_INT_NANDFC, ++ .flags = IORESOURCE_IRQ, ++ }, ++}; ++ ++static struct platform_device tx25_nand_mtd_device = { ++ .name = "mxc_nand", ++ .id = 0, ++ .num_resources = ARRAY_SIZE(tx25_nand_resources), ++ .resource = tx25_nand_resources, ++ .dev = { ++ .platform_data = &tx25_nand_data, ++ }, ++}; ++#endif ++ ++#if defined(CONFIG_VIDEO_MXC_EMMA_OUTPUT) || defined(CONFIG_VIDEO_MXC_EMMA_OUTPUT_MODULE) ++static u64 mxc_emma_dmamask = 0xffffffffUL; ++ ++static struct platform_device tx25_v4l2out_device = { ++ .name = "MXC Video Output", ++ .id = 0, ++ .dev = { ++ .dma_mask = &mxc_emma_dmamask, ++ .coherent_dma_mask = ~0UL, ++ }, ++}; ++#endif ++ ++#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, ++}; ++ ++static int karo_tx25_i2c_0_init(struct device *dev) ++{ ++ DBG(-1, "%s: \n", __FUNCTION__); ++ return mxc_iomux_v3_setup_multiple_pads(mxc_i2c0_pins, ++ ARRAY_SIZE(mxc_i2c0_pins)); ++} ++ ++static void karo_tx25_i2c_0_exit(struct device *dev) ++{ ++ DBG(-1, "%s: \n", __FUNCTION__); ++ mxc_iomux_v3_release_multiple_pads(mxc_i2c0_pins, ++ ARRAY_SIZE(mxc_i2c0_pins)); ++} ++ ++static struct imxi2c_platform_data karo_tx25_i2c_0_data = { ++ .bitrate = 100000, ++ .init = karo_tx25_i2c_0_init, ++ .exit = karo_tx25_i2c_0_exit, ++}; ++ ++static struct at24_platform_data karo_tx25_eeprom = { ++ .byte_len = 2048, ++ .page_size = 32, ++ .flags = AT24_FLAG_ADDR16 | AT24_FLAG_TAKE8ADDR, ++}; ++ ++static struct i2c_board_info karo_i2c_0_boardinfo[] __initdata = { ++ { ++ I2C_BOARD_INFO("24c16", 0x50), ++ .platform_data = &karo_tx25_eeprom, ++ .type = "24c16", ++ }, ++}; ++ ++int __init karo_i2c_init(void) ++{ ++ int ret; ++ ++ DBG(0, "%s: Registering I2C bus 0\n", __FUNCTION__); ++ ret = mxc_register_device(&mx25_i2c_device0, &karo_tx25_i2c_0_data); ++ if (ret != 0) { ++ printk(KERN_ERR "Failed to register I2C device: %d\n", ret); ++ return ret; ++ } ++ ret = i2c_register_board_info(0, karo_i2c_0_boardinfo, ++ ARRAY_SIZE(karo_i2c_0_boardinfo)); ++ if (ret != 0) { ++ printk(KERN_ERR "Failed to register I2C board info: %d\n", ret); ++ } ++ return ret; ++} ++device_initcall(karo_i2c_init); ++#endif ++#endif ++ ++struct platform_dev_list { ++ struct platform_device *pdev; ++ int flag; ++} tx25_devices[] __initdata = { ++#if defined(CONFIG_RTC_MXC) || defined(CONFIG_RTC_MXC_MODULE) ++ { .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, }, ++#endif ++#if defined(CONFIG_FEC) || defined(CONFIG_FEC_MODULE) ++ { .pdev = &fec_device, .flag = 1, }, ++#endif ++#if defined(CONFIG_SPI_MXC) || defined(CONFIG_SPI_MXC_MODULE) ++ { .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, }, ++#endif ++#if defined(CONFIG_MXC_VPU) || defined(CONFIG_MXC_VPU_MODULE) ++ { .pdev = &mxc_vpu_device, .flag = 1, }, ++#endif ++}; ++#define TX25_NUM_DEVICES ARRAY_SIZE(tx25_devices) ++ ++static __init void karo_tx25_board_init(void) ++{ ++ int i; ++ ++ DBG(0, "%s: \n", __FUNCTION__); ++ ++ dump_regs(); ++ ++ for (i = 0; i < TX25_NUM_DEVICES; i++) { ++ int ret; ++ ++ if (tx25_devices[i].pdev == NULL) continue; ++ if (!tx25_devices[i].flag) { ++ DBG(0, "%s: Skipping platform device[%d] @ %p dev %p: %s\n", ++ __FUNCTION__, i, tx25_devices[i].pdev, &tx25_devices[i].pdev->dev, ++ tx25_devices[i].pdev->name); ++ continue; ++ } ++ DBG(0, "%s: Registering platform device[%d] @ %p dev %p: %s\n", ++ __FUNCTION__, i, tx25_devices[i].pdev, &tx25_devices[i].pdev->dev, ++ tx25_devices[i].pdev->name); ++ ret = platform_device_register(tx25_devices[i].pdev); ++ if (ret) { ++ printk(KERN_WARNING "%s: Failed to register platform_device[%d]: %s: %d\n", ++ __FUNCTION__, i, tx25_devices[i].pdev->name, ret); ++ } ++ } ++ DBG(0, "%s: Done\n", __FUNCTION__); ++} ++ ++static struct pad_desc karo_tx25_gpios[] __initdata = { ++ MX25_PAD_GPIO_A__GPIO_A, ++ MX25_PAD_GPIO_B__GPIO_B, ++ MX25_PAD_GPIO_C__GPIO_C, ++ MX25_PAD_GPIO_D__GPIO_D, ++ MX25_PAD_GPIO_E__GPIO_E, ++ MX25_PAD_GPIO_F__GPIO_F, ++ MX25_PAD_CSI_D7__GPIO_1_6, ++ MX25_PAD_CSI_D8__GPIO_1_7, ++ MX25_PAD_CSI_MCLK__GPIO_1_8, ++ MX25_PAD_CSI_VSYNC__GPIO_1_9, ++ MX25_PAD_CSI_HSYNC__GPIO_1_10, ++ MX25_PAD_CSI_PIXCLK__GPIO_1_11, ++ MX25_PAD_I2C1_CLK__GPIO_1_12, ++ MX25_PAD_I2C1_DAT__GPIO_1_13, ++ MX25_PAD_CSPI1_MOSI__GPIO_1_14, ++ MX25_PAD_CSPI1_MISO__GPIO_1_15, ++ MX25_PAD_CSPI1_SS0__GPIO_1_16, ++ MX25_PAD_CSPI1_SS1__GPIO_1_17, ++ MX25_PAD_CSPI1_SCLK__GPIO_1_18, ++ MX25_PAD_LD5__GPIO_1_19, ++ MX25_PAD_LD6__GPIO_1_20, ++ MX25_PAD_LD7__GPIO_1_21, ++ MX25_PAD_HSYNC__GPIO_1_22, ++ MX25_PAD_VSYNC__GPIO_1_23, ++ MX25_PAD_LSCLK__GPIO_1_24, ++ MX25_PAD_OE_ACD__GPIO_1_25, ++ MX25_PAD_PWM__GPIO_1_26, ++ MX25_PAD_CSI_D2__GPIO_1_27, ++ MX25_PAD_CSI_D3__GPIO_1_28, ++ MX25_PAD_CSI_D4__GPIO_1_29, ++ MX25_PAD_CSI_D5__GPIO_1_30, ++ MX25_PAD_CSI_D6__GPIO_1_31, ++ ++ MX25_PAD_A14__GPIO_2_0, ++ MX25_PAD_A15__GPIO_2_1, ++ MX25_PAD_A16__GPIO_2_2, ++ MX25_PAD_A17__GPIO_2_3, ++ MX25_PAD_A18__GPIO_2_4, ++ MX25_PAD_A19__GPIO_2_5, ++ MX25_PAD_A20__GPIO_2_6, ++ MX25_PAD_A21__GPIO_2_7, ++ MX25_PAD_A22__GPIO_2_8, ++ MX25_PAD_A23__GPIO_2_9, ++ MX25_PAD_A24__GPIO_2_10, ++ MX25_PAD_A25__GPIO_2_11, ++ MX25_PAD_EB0__GPIO_2_12, ++ MX25_PAD_EB1__GPIO_2_13, ++ MX25_PAD_OE__GPIO_2_14, ++ MX25_PAD_LD0__GPIO_2_15, ++ MX25_PAD_LD1__GPIO_2_16, ++ MX25_PAD_LD2__GPIO_2_17, ++ MX25_PAD_LD3__GPIO_2_18, ++ MX25_PAD_LD4__GPIO_2_19, ++ MX25_PAD_DE_B__GPIO_2_20, ++ MX25_PAD_CLKO__GPIO_2_21, ++ MX25_PAD_CSPI1_RDY__GPIO_2_22, ++ MX25_PAD_SD1_CMD__GPIO_2_23, ++ MX25_PAD_SD1_CLK__GPIO_2_24, ++ MX25_PAD_SD1_DATA0__GPIO_2_25, ++ MX25_PAD_SD1_DATA1__GPIO_2_26, ++ MX25_PAD_SD1_DATA2__GPIO_2_27, ++ MX25_PAD_SD1_DATA3__GPIO_2_28, ++ MX25_PAD_KPP_ROW0__GPIO_2_29, ++ MX25_PAD_KPP_ROW1__GPIO_2_30, ++ MX25_PAD_KPP_ROW2__GPIO_2_31, ++ ++ MX25_PAD_KPP_ROW3__GPIO_3_0, ++ MX25_PAD_KPP_COL0__GPIO_3_1, ++ MX25_PAD_KPP_COL1__GPIO_3_2, ++ MX25_PAD_KPP_COL2__GPIO_3_3, ++ MX25_PAD_KPP_COL3__GPIO_3_4, ++ MX25_PAD_FEC_MDC__GPIO_3_5, ++ MX25_PAD_FEC_MDIO__GPIO_3_6, ++ MX25_PAD_FEC_TDATA0__GPIO_3_7, ++ MX25_PAD_FEC_TDATA1__GPIO_3_8, ++ MX25_PAD_FEC_TX_EN__GPIO_3_9, ++ MX25_PAD_FEC_RDATA0__GPIO_3_10, ++ MX25_PAD_FEC_RDATA1__GPIO_3_11, ++ MX25_PAD_FEC_RX_DV__GPIO_3_12, ++ MX25_PAD_FEC_TX_CLK__GPIO_3_13, ++ MX25_PAD_RTCK__GPIO_3_14, ++ MX25_PAD_EXT_ARMCLK__GPIO_3_15, ++ MX25_PAD_UPLL_BYPCLK__GPIO_3_16, ++ MX25_PAD_VSTBY_REQ__GPIO_3_17, ++ MX25_PAD_VSTBY_ACK__GPIO_3_18, ++ MX25_PAD_POWER_FAIL__GPIO_3_19, ++ MX25_PAD_CS4__GPIO_3_20, ++ MX25_PAD_CS5__GPIO_3_21, ++ MX25_PAD_NF_CE0__GPIO_3_22, ++ MX25_PAD_ECB__GPIO_3_23, ++ MX25_PAD_LBA__GPIO_3_24, ++ MX25_PAD_RW__GPIO_3_25, ++ MX25_PAD_NFWE_B__GPIO_3_26, ++ MX25_PAD_NFRE_B__GPIO_3_27, ++ MX25_PAD_NFALE__GPIO_3_28, ++ MX25_PAD_NFCLE__GPIO_3_29, ++ MX25_PAD_NFWP_B__GPIO_3_30, ++ MX25_PAD_NFRB__GPIO_3_31, ++ ++ MX25_PAD_A10__GPIO_4_0, ++ MX25_PAD_A13__GPIO_4_1, ++ MX25_PAD_CS0__GPIO_4_2, ++ MX25_PAD_CS1__GPIO_4_3, ++ MX25_PAD_BCLK__GPIO_4_4, ++ MX25_PAD_D15__GPIO_4_5, ++ MX25_PAD_D14__GPIO_4_6, ++ MX25_PAD_D13__GPIO_4_7, ++ MX25_PAD_D12__GPIO_4_8, ++ MX25_PAD_D11__GPIO_4_9, ++ MX25_PAD_D10__GPIO_4_10, ++ MX25_PAD_D9__GPIO_4_11, ++ MX25_PAD_D8__GPIO_4_12, ++ MX25_PAD_D7__GPIO_4_13, ++ MX25_PAD_D6__GPIO_4_14, ++ MX25_PAD_D5__GPIO_4_15, ++ MX25_PAD_D4__GPIO_4_16, ++ MX25_PAD_D3__GPIO_4_17, ++ MX25_PAD_D2__GPIO_4_18, ++ MX25_PAD_D1__GPIO_4_19, ++ MX25_PAD_D0__GPIO_4_20, ++ MX25_PAD_CSI_D9__GPIO_4_21, ++ MX25_PAD_UART1_RXD__GPIO_4_22, ++ MX25_PAD_UART1_TXD__GPIO_4_23, ++ MX25_PAD_UART1_RTS__GPIO_4_24, ++ MX25_PAD_UART1_CTS__GPIO_4_25, ++ MX25_PAD_UART2_RXD__GPIO_4_26, ++ MX25_PAD_UART2_TXD__GPIO_4_27, ++ MX25_PAD_UART2_RTS__GPIO_4_28, ++ MX25_PAD_UART2_CTS__GPIO_4_29, ++ MX25_PAD_BOOT_MODE0__GPIO_4_30, ++ MX25_PAD_BOOT_MODE1__GPIO_4_31, ++}; ++ ++static int __init karo_tx25_setup_gpios(void) ++{ ++ 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 ++ DBG(0, "%s: PAD[%d] %s set up as GPIO\n", __FUNCTION__, i, pd->name); ++#else ++ DBG(0, "%s: PAD[%d] set up as GPIO\n", __FUNCTION__, i); ++#endif ++ count++; ++ mxc_iomux_v3_release_pad(pd); ++ } else { ++#ifdef IOMUX_DEBUG ++ DBG(0, "%s: PAD[%d] %s skipped\n", __FUNCTION__, i, pd->name); ++#else ++ DBG(0, "%s: PAD[%d] skipped\n", __FUNCTION__, i); ++#endif ++ } ++ } ++ 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; ++} ++late_initcall(karo_tx25_setup_gpios); ++ ++static void __init karo_tx25_map_io(void) ++{ ++ mx25_map_io(); ++} ++ ++static void __init karo_tx25_fixup(struct machine_desc *desc, struct tag *tags, ++ char **cmdline, struct meminfo *mi) ++{ ++} ++ ++static void __init karo_tx25_timer_init(void) ++{ ++ DBG(0, "%s: \n", __FUNCTION__); ++ mx25_clocks_init(24000000); ++ DBG(0, "%s: Done\n", __FUNCTION__); ++} ++ ++struct sys_timer karo_tx25_timer = { ++ .init = karo_tx25_timer_init, ++}; ++ ++static int __init karo_mod_type_setup(char *line) ++{ ++ get_option(&line, &karo_mod_type); ++ DBG(0, "%s: Module type set to 0x%02x by kernel cmd line\n", __FUNCTION__, karo_mod_type); ++ ++ return 1; ++} ++__setup("module_type=", karo_mod_type_setup); ++ ++static int __init karo_board_type_setup(char *line) ++{ ++ get_option(&line, &karo_board_type); ++ DBG(0, "%s: Board type set to 0x%02x by kernel cmd line\n", __FUNCTION__, karo_board_type); ++ ++ return 1; ++} ++__setup("board_type=", karo_board_type_setup); ++ ++MACHINE_START(TX25, "Ka-Ro electronics TX25 module (Freescale i.MX25)") ++ /* Maintainer: */ ++ .phys_io = AIPS1_BASE_ADDR, ++ .io_pg_offst = ((unsigned long)AIPS1_BASE_ADDR_VIRT >> 18) & 0xfffc, ++ .fixup = karo_tx25_fixup, ++ .map_io = karo_tx25_map_io, ++ .init_irq = mxc_init_irq, ++ .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:59:18.000000000 +0200 +@@ -0,0 +1,99 @@ ++/* ++ * arch/arm/mach-mx2/karo.h ++ * ++ * Copyright (C) 2009 Lothar Wassmann ++ * ++ * 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 ++ * ++ * This file provides platform specific definitions for the ++ * Ka-Ro electronics TX25 processor modules ++ */ ++ ++#include ++#include "crm_regs_mx25.h" ++ ++enum { ++ BOARD_KARO_STK5, ++}; ++ ++extern int karo_board_type; ++extern int karo_mod_type; ++ ++#ifdef DEBUG ++extern int tx25_debug; ++#define dbg_lvl(n) ((n) < tx25_debug) ++#define DBG(lvl, fmt...) do { if (dbg_lvl(lvl)) printk(KERN_DEBUG fmt); } while (0) ++#else ++#define dbg_lvl(n) 0 ++#define DBG(lvl, fmt...) do { } while (0) ++#endif ++ ++static inline int karo_get_board_type(void) ++{ ++ return karo_board_type; ++} ++ ++static inline int karo_get_module_type(void) ++{ ++ return karo_mod_type; ++} ++ ++#define SHOW_REG(reg) DBG(0, "%s[%08lx]=%08x\n", #reg, MXC_PHYS_ADDRESS(reg), __raw_readl(reg)) ++ ++#define SHOW_GPIO_REG(port, reg) \ ++ DBG(0, "GPIO%d_%s[%08lx]=%08x\n", port, #reg, \ ++ GPIO_BASE_ADDR(port) + GPIO_##reg, \ ++ __raw_readl(IO_ADDRESS(GPIO_BASE_ADDR(port) + GPIO_##reg))) ++ ++static inline void dump_regs(void) ++{ ++ int i; ++ ++ SHOW_REG(MXC_CCM_MPCTL); ++ SHOW_REG(MXC_CCM_UPCTL); ++ SHOW_REG(MXC_CCM_CCTL); ++ SHOW_REG(MXC_CCM_RCSR); ++ SHOW_REG(MXC_CCM_CRDR); ++ SHOW_REG(MXC_CCM_PCDR0); ++ SHOW_REG(MXC_CCM_PCDR1); ++ SHOW_REG(MXC_CCM_PCDR2); ++ SHOW_REG(MXC_CCM_PCDR3); ++ SHOW_REG(MXC_CCM_CGCR0); ++ SHOW_REG(MXC_CCM_CGCR1); ++ SHOW_REG(MXC_CCM_CGCR2); ++ SHOW_REG(MXC_CCM_MCR); ++ SHOW_REG(MXC_CCM_PMCR0); ++ SHOW_REG(MXC_CCM_PMCR1); ++ SHOW_REG(MXC_CCM_PMCR2); ++ SHOW_REG(MXC_CCM_LTBR0); ++ SHOW_REG(MXC_CCM_LTBR1); ++ SHOW_REG(MXC_CCM_LTR0); ++ SHOW_REG(MXC_CCM_LTR1); ++ SHOW_REG(MXC_CCM_LTR2); ++ SHOW_REG(MXC_CCM_LTR3); ++ SHOW_REG(MXC_CCM_DCVR0); ++ SHOW_REG(MXC_CCM_DCVR1); ++ SHOW_REG(MXC_CCM_DCVR2); ++ SHOW_REG(MXC_CCM_DCVR3); ++ ++ for (i = 1; i <= 4; i++) { ++ SHOW_GPIO_REG(i, DR); ++ SHOW_GPIO_REG(i, GDIR); ++ SHOW_GPIO_REG(i, PSR); ++ SHOW_GPIO_REG(i, ICR1); ++ SHOW_GPIO_REG(i, ICR2); ++ SHOW_GPIO_REG(i, IMR); ++ 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:59:18.000000000 +0200 +@@ -0,0 +1,159 @@ ++ ++/* ++ * Copyright 2008 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 ++ */ ++ ++/*! ++ * @file sdma_script_code.h ++ * @brief This file contains functions of SDMA scripts code initialization ++ * ++ * The file was generated automatically. Based on sdma scripts library. ++ * ++ * @ingroup SDMA ++ */ ++/************************************************************************ ++ ++ SDMA RELEASE LABEL: "SS15_SENNA" ++ ++************************************************************************/ ++ ++#ifndef SDMA_SCRIPT_CODE_H ++#define SDMA_SCRIPT_CODE_H ++ ++/*! ++ * SDMA ROM scripts start addresses and sizes ++ */ ++#define start_ADDR 0 ++#define start_SIZE 22 ++ ++#define core_ADDR 80 ++#define core_SIZE 233 ++ ++#define common_ADDR 313 ++#define common_SIZE 416 ++ ++#define ap_2_ap_ADDR 729 ++#define ap_2_ap_SIZE 41 ++ ++#define app_2_mcu_ADDR 770 ++#define app_2_mcu_SIZE 64 ++ ++#define mcu_2_app_ADDR 834 ++#define mcu_2_app_SIZE 70 ++ ++#define uart_2_mcu_ADDR 904 ++#define uart_2_mcu_SIZE 75 ++ ++#define shp_2_mcu_ADDR 979 ++#define shp_2_mcu_SIZE 69 ++ ++#define mcu_2_shp_ADDR 1048 ++#define mcu_2_shp_SIZE 72 ++ ++#define uartsh_2_mcu_ADDR 1120 ++#define uartsh_2_mcu_SIZE 69 ++ ++#define app_2_per_ADDR 1189 ++#define app_2_per_SIZE 66 ++ ++#define per_2_app_ADDR 1255 ++#define per_2_app_SIZE 74 ++ ++#define per_2_shp_ADDR 1329 ++#define per_2_shp_SIZE 78 ++ ++#define shp_2_per_ADDR 1407 ++#define shp_2_per_SIZE 72 ++ ++#define mcu_2_ata_ADDR 1479 ++#define mcu_2_ata_SIZE 81 ++ ++#define ata_2_mcu_ADDR 1560 ++#define ata_2_mcu_SIZE 96 ++ ++#define loop_DMAs_routines_ADDR 1656 ++#define loop_DMAs_routines_SIZE 227 ++ ++#define test_ADDR 1883 ++#define test_SIZE 63 ++ ++#define signature_ADDR 1022 ++#define signature_SIZE 1 ++ ++/*! ++ * SDMA RAM scripts start addresses and sizes ++ */ ++#define ext_mem__ipu_ram_ADDR 6144 ++#define ext_mem__ipu_ram_SIZE 123 ++ ++#define uart_2_per_ADDR 6267 ++#define uart_2_per_SIZE 73 ++ ++#define uartsh_2_per_ADDR 6340 ++#define uartsh_2_per_SIZE 67 ++ ++/*! ++ * SDMA RAM image start address and size ++ */ ++#define RAM_CODE_START_ADDR 6144 ++#define RAM_CODE_SIZE 263 ++ ++/*! ++ * Buffer that holds the SDMA RAM image ++ */ ++__attribute__ ((__aligned__(4))) ++#ifndef CONFIG_XIP_KERNEL ++const ++#endif ++static const short sdma_code[] = { ++ 0x0e70, 0x0611, 0x5616, 0xc18a, 0x7d2a, 0x5ade, 0x008e, 0xc19c, ++ 0x7c26, 0x5be0, 0x5ef0, 0x5ce8, 0x0688, 0x08ff, 0x0011, 0x28ff, ++ 0x00bc, 0x53f6, 0x05df, 0x7d0b, 0x6dc5, 0x03df, 0x7d03, 0x6bd5, ++ 0xd84f, 0x982b, 0x6b05, 0xc6d8, 0x7e27, 0x7f29, 0x982b, 0x6d01, ++ 0x03df, 0x7d05, 0x6bd5, 0xc702, 0x7e18, 0x7f1a, 0x982b, 0x6b05, ++ 0xc678, 0x7e07, 0x7f06, 0x52de, 0x53e6, 0xc1a8, 0x7dd7, 0x0200, ++ 0x9803, 0x0007, 0x6004, 0x680c, 0x53f6, 0x028e, 0x00a3, 0xc2ad, ++ 0x048b, 0x0498, 0x0454, 0x068a, 0x982b, 0x0207, 0x680c, 0x6ddf, ++ 0x0107, 0x68ff, 0x60d0, 0x9834, 0x0207, 0x68ff, 0x6d28, 0x0107, ++ 0x6004, 0x680c, 0x9834, 0x0007, 0x68ff, 0x60d0, 0x9834, 0x0288, ++ 0x03a5, 0x3b03, 0x3d03, 0x4d00, 0x7d0a, 0x0804, 0x00a5, 0x00da, ++ 0x7d1a, 0x02a0, 0x7b01, 0x65d8, 0x7eee, 0x65ff, 0x7eec, 0x0804, ++ 0x02d0, 0x7d11, 0x4b00, 0x7c0f, 0x008a, 0x3003, 0x6dcf, 0x6bdf, ++ 0x0015, 0x0015, 0x7b02, 0x65d8, 0x0000, 0x7edd, 0x63ff, 0x7edb, ++ 0x3a03, 0x6dcd, 0x6bdd, 0x008a, 0x7b02, 0x65d8, 0x0000, 0x7ed3, ++ 0x65ff, 0x7ed1, 0x0006, 0xc23a, 0x57db, 0x52f3, 0x6ad5, 0x56fb, ++ 0x028e, 0x1a94, 0x6ac3, 0x62c8, 0x0269, 0x7d1e, 0x1e94, 0x6ee3, ++ 0x62d0, 0x5aeb, 0x62c8, 0x0248, 0x6ed3, 0x6ac8, 0x2694, 0x52eb, ++ 0x6ad5, 0x6ee3, 0x62c8, 0x026e, 0x7d27, 0x6ac8, 0x7f23, 0x2501, ++ 0x4d00, 0x7d26, 0x028e, 0x1a98, 0x6ac3, 0x62c8, 0x6ec3, 0x0260, ++ 0x7df1, 0x62d0, 0xc2d1, 0x98c0, 0x6ee3, 0x008f, 0x2001, 0x00d5, ++ 0x7d01, 0x008d, 0x05a0, 0x62c8, 0x026e, 0x7d0e, 0x6ac8, 0x7f0a, ++ 0x2001, 0x7cf9, 0x6add, 0x7f06, 0x0000, 0x4d00, 0x7d09, 0xc251, ++ 0x57db, 0x987f, 0x0007, 0x6aff, 0x62d0, 0xc2d1, 0x0458, 0x0454, ++ 0x6add, 0x7ff8, 0xc261, 0x987c, 0xc230, 0xc23a, 0x57db, 0x52f3, ++ 0x6ad5, 0x56fb, 0x028e, 0x1a94, 0x5202, 0x0269, 0x7d17, 0x1e94, ++ 0x5206, 0x0248, 0x5a06, 0x2694, 0x5206, 0x026e, 0x7d26, 0x6ac8, ++ 0x7f22, 0x2501, 0x4d00, 0x7d27, 0x028e, 0x1a98, 0x5202, 0x0260, ++ 0x7df3, 0x6add, 0x7f18, 0x62d0, 0xc2d1, 0x9903, 0x008f, 0x2001, ++ 0x00d5, 0x7d01, 0x008d, 0x05a0, 0x5206, 0x026e, 0x7d0e, 0x6ac8, ++ 0x7f0a, 0x2001, 0x7cf9, 0x6add, 0x7f06, 0x0000, 0x4d00, 0x7d0b, ++ 0xc251, 0x57db, 0x98c9, 0x0007, 0x6aff, 0x6add, 0x7ffc, 0x62d0, ++ 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:59:18.000000000 +0200 +@@ -0,0 +1,1003 @@ ++/* ++ * arch/arm/mach-mx2/stk5-baseboard.c ++ * ++ * Copyright (C) 2009 Lothar Wassmann ++ * ++ * ++ * 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 ++ * ++ * This file adds support for devices found on Ka-Ro electronics ++ * Starterkit-5 (STK5) baseboard ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++//#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++//#include ++#include ++#include ++#include ++//#include ++//#include ++#include ++ ++#include "crm_regs.h" ++#include "devices.h" ++#include "karo.h" ++ ++#if defined(CONFIG_SERIAL_IMX) || defined(CONFIG_SERIAL_IMX_MODULE) ++static struct pad_desc stk5_uart_pads[][4] = { ++ { ++ MX25_PAD_UART1_TXD__UART1_TXD, ++ MX25_PAD_UART1_RXD__UART1_RXD, ++ MX25_PAD_UART1_CTS__UART1_CTS, ++ MX25_PAD_UART1_RTS__UART1_RTS, ++ }, { ++ MX25_PAD_UART2_TXD__UART2_TXD, ++ MX25_PAD_UART2_RXD__UART2_RXD, ++ MX25_PAD_UART2_CTS__UART2_CTS, ++ MX25_PAD_UART2_RTS__UART2_RTS, ++ }, { ++ MX25_PAD_ECB__UART5_TXD_MUX, ++ MX25_PAD_LBA__UART5_RXD_MUX, ++ MX25_PAD_CS4__UART5_CTS, ++ MX25_PAD_CS5__UART5_RTS, ++#if 0 ++ }, { ++ MX25_PAD_UART4_TXD__UART4_TXD, ++ MX25_PAD_UART4_RXD__UART4_RXD, ++ MX25_PAD_UART4_CTS__UART4_CTS, ++ MX25_PAD_UART4_RTS__UART4_RTS, ++ }, { ++ MX25_PAD_UART5_TXD__UART5_TXD, ++ MX25_PAD_UART5_RXD__UART5_RXD, ++ MX25_PAD_UART5_CTS__UART5_CTS, ++ MX25_PAD_UART5_RTS__UART5_RTS, ++#endif ++ }, ++}; ++ ++static int stk5_uart_init(struct platform_device *pdev) ++{ ++ DBG(0, "%s: \n", __FUNCTION__); ++ return mxc_iomux_v3_setup_multiple_pads(stk5_uart_pads[pdev->id], ++ ARRAY_SIZE(stk5_uart_pads[pdev->id])); ++} ++ ++static void stk5_uart_exit(struct platform_device *pdev) ++{ ++ DBG(0, "%s: \n", __FUNCTION__); ++ mxc_iomux_v3_release_multiple_pads(stk5_uart_pads[pdev->id], ++ ARRAY_SIZE(stk5_uart_pads[pdev->id])); ++} ++ ++static struct imxuart_platform_data stk5_uart_ports[] = { ++ { ++ .init = stk5_uart_init, ++ .exit = stk5_uart_exit, ++ .flags = IMXUART_HAVE_RTSCTS, ++ }, { ++ .init = stk5_uart_init, ++ .exit = stk5_uart_exit, ++ .flags = IMXUART_HAVE_RTSCTS, ++ }, { ++ .init = stk5_uart_init, ++ .exit = stk5_uart_exit, ++ .flags = IMXUART_HAVE_RTSCTS, ++ }, { ++ .init = stk5_uart_init, ++ .exit = stk5_uart_exit, ++ .flags = IMXUART_HAVE_RTSCTS, ++ }, { ++ .init = stk5_uart_init, ++ .exit = stk5_uart_exit, ++ .flags = IMXUART_HAVE_RTSCTS, ++ }, { ++ .init = stk5_uart_init, ++ .exit = stk5_uart_exit, ++ .flags = IMXUART_HAVE_RTSCTS, ++ }, ++}; ++ ++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 void __init karo_stk5_serial_init(void) ++{ ++} ++#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) ++{ ++ if ((unsigned long)view & 0x400) { ++ return "USBH2"; ++ } else { ++ return "USBOTG"; ++ } ++} ++ ++static int usb3317_init(void __iomem *view) ++{ ++ int vid, pid, ret; ++ ++ 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) { ++ 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; ++ } ++ return 0; ++} ++ ++static int usb3317_set_vbus_power(void __iomem *view, int on) ++{ ++ 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); ++ } ++ } ++ 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 stk5_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 stk5_usbh2_exit(struct platform_device *pdev) ++{ ++ gpio_usbh2_inactive(); ++ return 0; ++} ++ ++static struct mxc_usbh_platform_data stk5_usbh2_data = { ++ .init = stk5_usbh2_init, ++ .exit = stk5_usbh2_exit, ++}; ++ ++static int __init karo_stk5_usbh2_register(void) ++{ ++ int ret; ++ ++ ret = mxc_register_device(&mxc_ehci2, &stk5_usbh2_data); ++ return ret; ++} ++#else ++static inline int karo_stk5_usbh2_register(void) ++{ ++ return 0; ++} ++#endif // CONFIG_USB_EHCI_MXC ++ ++#if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE) ++static struct gpio_led stk5_leds[] = { ++ { ++ .name = "GPIO-LED", ++ .default_trigger = "heartbeat", ++ .gpio = GPIO_PORTB | 7, ++ }, ++}; ++ ++static struct gpio_led_platform_data stk5_led_data = { ++ .leds = stk5_leds, ++ .num_leds = ARRAY_SIZE(stk5_leds), ++}; ++ ++static struct platform_device stk5_led_device = { ++ .name = "leds-gpio", ++ .id = -1, ++ .dev = { ++ .platform_data = &stk5_led_data, ++ }, ++}; ++#endif ++ ++#if defined(CONFIG_KEYBOARD_MXC) || defined(CONFIG_KEYBOARD_MXC_MODULE) ++/*! ++ * This array is used for mapping mx25 ADS keypad scancodes to input keyboard ++ * keycodes. ++ */ ++static u16 stk5_kpd_keycodes[] = { ++ KEY_POWER, ++}; ++ ++static struct keypad_data stk5_keypad = { ++ .rowmax = 1, ++ .colmax = 1, ++ .irq = MXC_INT_KPP, ++ .learning = 0, ++ //.delay = 2, /* unused in the driver! */ ++ .matrix = stk5_kpd_keycodes, ++}; ++ ++static struct resource stk5_kpp_resources[] = { ++ { ++ .start = MXC_INT_KPP, ++ .end = MXC_INT_KPP, ++ .flags = IORESOURCE_IRQ, ++ }, ++}; ++ ++/* stk5 keypad driver */ ++static struct platform_device stk5_keypad_device = { ++ .name = "mxc_keypad", ++ .id = 0, ++ .num_resources = ARRAY_SIZE(stk5_kpp_resources), ++ .resource = stk5_kpp_resources, ++ .dev = { ++ .platform_data = &stk5_keypad, ++ }, ++}; ++#endif ++ ++#if defined(CONFIG_FB_IMX) || defined(CONFIG_FB_IMX_MODULE) ++/* ++ * Setup GPIO for LCDC device to be active ++ * ++ */ ++static struct pad_desc mx25_lcdc_gpios[] = { ++#if 0 ++ MXC_PIN(A, 30, GPIO, GPIO_OUT | GPIO_DFLT_LOW), /* PA30 */ ++ MXC_PIN(A, 25, GPIO, GPIO_OUT | GPIO_DFLT_LOW), /* PA25 */ ++ MXC_PIN(A, 26, GPIO, GPIO_OUT | GPIO_DFLT_LOW), /* PA26 */ ++ MXC_PIN(A, 24, GPIO, GPIO_OUT | GPIO_DFLT_LOW), /* PA24 */ ++ MXC_PIN(A, 27, GPIO, GPIO_OUT | GPIO_DFLT_LOW), /* PA27 */ ++#endif ++ MX25_PAD_LSCLK__LSCLK, ++ MX25_PAD_LD0__LD0, ++ MX25_PAD_LD1__LD1, ++ MX25_PAD_LD2__LD2, ++ MX25_PAD_LD3__LD3, ++ MX25_PAD_LD4__LD4, ++ MX25_PAD_LD5__LD5, ++ MX25_PAD_LD6__LD6, ++ MX25_PAD_LD7__LD7, ++ MX25_PAD_LD8__LD8, ++ MX25_PAD_LD9__LD9, ++ MX25_PAD_LD10__LD10, ++ MX25_PAD_LD11__LD11, ++ MX25_PAD_LD12__LD12, ++ MX25_PAD_LD13__LD13, ++ MX25_PAD_LD14__LD14, ++ MX25_PAD_LD15__LD15, ++ MX25_PAD_D15__LD16, ++ MX25_PAD_D14__LD17, ++ MX25_PAD_HSYNC__HSYNC, ++ MX25_PAD_VSYNC__VSYNC, ++ MX25_PAD_OE_ACD__OE_ACD, ++}; ++ ++static int stk5_gpio_lcdc_active(struct platform_device *dev) ++{ ++ int ret; ++ ++ DBG(0, "%s: Setting up GPIO pins for LCD\n", __FUNCTION__); ++ ret = mxc_iomux_v3_setup_multiple_pads(mx25_lcdc_gpios, ++ ARRAY_SIZE(mx25_lcdc_gpios)); ++ if (ret) { ++ DBG(0, "%s: Failed to setup GPIO pins for LCD: %d\n", ++ __FUNCTION__, ret); ++ return ret; ++ } ++ return 0; ++} ++ ++/* ++ * Setup GPIO for LCDC device to be inactive ++ * ++ */ ++static void stk5_gpio_lcdc_inactive(struct platform_device *dev) ++{ ++ mxc_iomux_v3_release_multiple_pads(mx25_lcdc_gpios, ++ ARRAY_SIZE(mx25_lcdc_gpios)); ++} ++ ++static struct imx_fb_platform_data stk5_fb_data[] __initdata = { ++ { ++ //.fb_mode = "Xenarc_700_Y-18", ++ .init = stk5_gpio_lcdc_active, ++ .exit = stk5_gpio_lcdc_inactive, ++ .lcd_power = NULL, ++ .backlight_power = NULL, ++ ++ .pixclock = 34576, ++ .xres = 640, ++ .yres = 480, ++ ++ .bpp = 32, ++ ++ .hsync_len = 64, ++ .right_margin = 60 + 1, ++ .left_margin = 80 + 3, ++ ++ .vsync_len = 2, ++ .upper_margin = 54, ++ .lower_margin = 54, ++#if 0 ++ /* currently not used by driver! */ ++ .sync = ((0*FB_SYNC_HOR_HIGH_ACT) | ++ (0*FB_SYNC_VERT_HIGH_ACT) | ++ (1*FB_SYNC_OE_ACT_HIGH)), ++#else ++ .pcr = PCR_TFT | PCR_COLOR | PCR_PBSIZ_8 | ++ PCR_BPIX_18 | PCR_END_SEL | PCR_FLMPOL | PCR_LPPOL | PCR_SCLK_SEL, ++ .dmacr = 0x800a0078, ++#endif ++ .cmap_greyscale = 0, ++ .cmap_inverse = 0, ++ .cmap_static = 0, ++ ++ .fixed_screen_cpu = NULL, ++ }, { ++ //.fb_mode = "Xenarc_700_Y-16", ++ .init = stk5_gpio_lcdc_active, ++ .exit = stk5_gpio_lcdc_inactive, ++ .lcd_power = NULL, ++ .backlight_power = NULL, ++ ++ .pixclock = 34576, ++ .xres = 640, ++ .yres = 480, ++ ++ .bpp = 16, ++ ++ .hsync_len = 64, ++ .right_margin = 138 + 1, ++ .left_margin = 118 + 3, ++ ++ .vsync_len = 7, ++ .upper_margin = 44, ++ .lower_margin = 44, ++#if 0 ++ /* currently not used by driver! */ ++ .sync = ((0*FB_SYNC_HOR_HIGH_ACT) | ++ (0*FB_SYNC_VERT_HIGH_ACT) | ++ (1*FB_SYNC_OE_ACT_HIGH)), ++#else ++ .pcr = PCR_TFT | PCR_COLOR | PCR_PBSIZ_8 | ++ PCR_BPIX_16 | PCR_FLMPOL | PCR_LPPOL | PCR_SCLK_SEL, ++ .dmacr = 0x80040060, ++#endif ++ .cmap_greyscale = 0, ++ .cmap_inverse = 0, ++ .cmap_static = 0, ++ ++ .fixed_screen_cpu = NULL, ++ }, { ++ //.fb_mode = "SHARP LQ10D42-16", ++ .init = stk5_gpio_lcdc_active, ++ .exit = stk5_gpio_lcdc_inactive, ++ .lcd_power = NULL, ++ .backlight_power = NULL, ++ ++ .pixclock = 34576, ++ .xres = 640, ++ .yres = 480, ++ ++#ifdef USE_18BPP ++ .bpp = 32, ++#else ++ .bpp = 16, ++#endif ++ .hsync_len = 64, ++ .right_margin = 138 + 1, ++ .left_margin = 118 + 3, ++ ++ .vsync_len = 7, ++ .upper_margin = 28, ++ .lower_margin = 60, ++#if 0 ++ /* currently not used by driver! */ ++ .sync = ((0*FB_SYNC_HOR_HIGH_ACT) | ++ (0*FB_SYNC_VERT_HIGH_ACT) | ++ (1*FB_SYNC_OE_ACT_HIGH)), ++#else ++ .pcr = PCR_TFT | PCR_COLOR | PCR_PBSIZ_8 | ++#ifdef USE_18BPP ++ PCR_BPIX_18 | PCR_END_SEL | PCR_FLMPOL | PCR_LPPOL | PCR_SCLK_SEL, ++#else ++ PCR_BPIX_16 | PCR_FLMPOL | PCR_LPPOL | PCR_SCLK_SEL, ++#endif ++ .dmacr = 0x80040060, ++#endif ++ .cmap_greyscale = 0, ++ .cmap_inverse = 0, ++ .cmap_static = 0, ++ ++ .fixed_screen_cpu = NULL, ++ }, { ++ //.fb_mode = "SHARP LQ104V1DG61-16", ++ .init = stk5_gpio_lcdc_active, ++ .exit = stk5_gpio_lcdc_inactive, ++ .lcd_power = NULL, ++ .backlight_power = NULL, ++ ++ .pixclock = 40000, ++ .xres = 640, ++ .yres = 480, ++ ++#ifdef USE_18BPP ++ .bpp = 32, ++#else ++ .bpp = 16, ++#endif ++ .hsync_len = 32, ++ .right_margin = 32 + 1, ++ .left_margin = 0 + 3, ++ ++ .vsync_len = 35, ++ .upper_margin = 0, ++ .lower_margin = 0, ++#if 0 ++ /* currently not used by driver! */ ++ .sync = ((0*FB_SYNC_HOR_HIGH_ACT) | ++ (0*FB_SYNC_VERT_HIGH_ACT) | ++ (1*FB_SYNC_OE_ACT_HIGH)), ++#else ++ .pcr = PCR_TFT | PCR_COLOR | PCR_PBSIZ_8 | ++#ifdef USE_18BPP ++ PCR_BPIX_18 | PCR_END_SEL | PCR_FLMPOL | PCR_LPPOL | PCR_SCLK_SEL, ++#else ++ PCR_BPIX_16 | PCR_FLMPOL | PCR_LPPOL | PCR_CLKPOL | PCR_SCLK_SEL, ++#endif ++ .dmacr = 0x80040060, ++#endif ++ .cmap_greyscale = 0, ++ .cmap_inverse = 0, ++ .cmap_static = 0, ++ ++ .fixed_screen_cpu = NULL, ++ }, ++}; ++ ++static int __init karo_stk5_fb_register(void) ++{ ++ int ret; ++ ++ ret = mxc_register_device(&mxc_fb_device, &stk5_fb_data[0]); ++ if (ret != 0) { ++ DBG(0, "%s: Failed to register FB device: %d\n", __FUNCTION__, ret); ++ } ++ return ret; ++} ++#else ++static inline int karo_stk5_fb_register(void) ++{ ++ return 0; ++} ++#endif ++ ++#if defined(CONFIG_MMC_MXC) || defined(CONFIG_MMC_MXC_MODULE) ++/*! ++ * Resource definition for the SDHC1 ++ */ ++static struct resource stk5_sdhc1_resources[] = { ++ { ++ .start = MMC_SDHC1_BASE_ADDR, ++ .end = MMC_SDHC1_BASE_ADDR + SZ_4K - 1, ++ .flags = IORESOURCE_MEM, ++ }, { ++ .start = MXC_INT_SDHC1, ++ .end = MXC_INT_SDHC1, ++ .flags = IORESOURCE_IRQ, ++ }, { ++ .start = gpio_to_irq(4 * 32 + 4), ++ .end = gpio_to_irq(4 * 32 + 4), ++ .flags = IORESOURCE_IRQ, ++#if 0 ++ }, { ++ .name = "sdhc1", ++ .start = DMA_REQ_SDHC1, ++ .end = DMA_REQ_SDHC1, ++ .flags = IORESOURCE_DMA ++#endif ++ }, ++}; ++ ++static inline int stk5_mmc_get_irq(int id) ++{ ++ int irq; ++ ++ switch (id) { ++ case 0: ++ irq = stk5_sdhc1_resources[2].start; ++ break; ++ default: ++ BUG(); ++ } ++ return irq; ++} ++ ++static const char *stk5_mmc_irqdesc[] = { ++ "MMC card 0 detect", ++}; ++ ++static struct pad_desc stk5_sdhc_pads[] = { ++}; ++ ++static int stk5_mmc_init(struct device *dev, irqreturn_t (*mmc_detect_irq)(int, void *), ++ void *data) ++{ ++ int err; ++ int id = to_platform_device(dev)->id; ++ struct mmc_host *host = data; ++ int irq = stk5_mmc_get_irq(id); ++ ++ err = mxc_iomux_v3_setup_multiple_pads(stk5_sdhc_pads, ++ ARRAY_SIZE(stk5_sdhc_pads)); ++ if (err) { ++ return err; ++ } ++ ++ host->caps |= MMC_CAP_4_BIT_DATA; ++ ++ err = request_irq(irq, mmc_detect_irq, ++ IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING, ++ stk5_mmc_irqdesc[id], data); ++ if (err) { ++ printk(KERN_ERR "%s: MMC/SD: can't request MMC card detect IRQ %d\n", ++ __FUNCTION__, irq); ++ return err; ++ } ++ device_set_wakeup_capable(dev, 1); ++ ++ return 0; ++} ++ ++static void stk5_mmc_exit(struct device *dev, void *data) ++{ ++ int id = to_platform_device(dev)->id; ++ int irq = stk5_mmc_get_irq(id); ++ ++ free_irq(irq, data); ++ mxc_iomux_v3_release_multiple_pads(stk5_sdhc_pads, ++ ARRAY_SIZE(stk5_sdhc_pads)); ++} ++ ++#if 0 ++static int stk5_mmc_suspend(struct device *dev, pm_message_t state) ++{ ++ int id = to_platform_device(dev)->id; ++ int irq = stk5_mmc_get_irq(id); ++ ++ if (device_may_wakeup(dev)) { ++ DBG(0, "%s: Enabling IRQ %d wakeup\n", __FUNCTION__, irq); ++ return enable_irq_wake(irq); ++ } ++ return 0; ++} ++ ++static int stk5_mmc_resume(struct device *dev) ++{ ++ int id = to_platform_device(dev)->id; ++ int irq = stk5_mmc_get_irq(id); ++ ++ if (device_may_wakeup(dev)) { ++ DBG(0, "%s: Disabling IRQ %d wakeup\n", __FUNCTION__, irq); ++ return disable_irq_wake(irq); ++ } ++ return 0; ++} ++#endif ++ ++static struct imxmmc_platform_data stk5_sdhc1_data = { ++ //.ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, ++ //.min_clk = 150000, ++ //.max_clk = 25000000, ++ //.detect_delay = 20, ++ .init = stk5_mmc_init, ++ .exit = stk5_mmc_exit, ++// .suspend = stk5_mmc_suspend, ++// .resume = stk5_mmc_resume, ++}; ++ ++static struct platform_device stk5_sdhc1_device = { ++ .name = "imx-mmc", ++ .id = 0, ++ .dev = { ++ .platform_data = &stk5_sdhc1_data, ++ }, ++ .num_resources = ARRAY_SIZE(stk5_sdhc1_resources), ++ .resource = stk5_sdhc1_resources, ++}; ++#endif ++ ++#if defined(CONFIG_SPI_MXC) || defined(CONFIG_SPI_MXC_MODULE) ++static struct resource mxcspi1_resources[] = { ++ { ++ .start = CSPI1_BASE_ADDR, ++ .end = CSPI1_BASE_ADDR + SZ_4K - 1, ++ .flags = IORESOURCE_MEM, ++ }, { ++ .start = MXC_INT_CSPI1, ++ .end = MXC_INT_CSPI1, ++ .flags = IORESOURCE_IRQ, ++ }, ++}; ++ ++static struct mxc_spi_master mxcspi1_data = { ++ .maxchipselect = 2, ++ .spi_version = 0, ++}; ++ ++static struct platform_device mxcspi1_device = { ++ .name = "mxc_spi", ++ .id = 0, ++ .dev = { ++ .platform_data = &mxcspi1_data, ++ }, ++ .num_resources = ARRAY_SIZE(mxcspi1_resources), ++ .resource = mxcspi1_resources, ++}; ++#endif // defined(CONFIG_SPI_MXC) || defined(CONFIG_SPI_MXC_MODULE) ++ ++#if defined(CONFIG_AC97_BUS) || defined(CONFIG_AC97_BUS_MODULE) ++static u64 stk5_dma_mask = ~0UL; ++ ++static struct pad_desc stk5_ac97_pads_on[] = { ++ MX25_PAD_VSTBY_ACK__GPIO_3_18, /* UCB1400 Reset */ ++ MX25_PAD_RW__AUD4_TXFS, ++ MX25_PAD_EB0__AUD4_TXD, ++ MX25_PAD_EB1__AUD4_RXD, ++ MX25_PAD_OE__AUD4_TXC, ++}; ++ ++static struct pad_desc stk5_ac97_pads_off[] = { ++ MX25_PAD_VSTBY_ACK__GPIO_3_18, /* UCB1400 Reset */ ++ MX25_PAD_RW__GPIO_3_25, ++ MX25_PAD_EB0__GPIO_2_12, ++ MX25_PAD_EB1__AUD4_RXD, ++ MX25_PAD_OE__AUD4_TXC, ++}; ++ ++static struct gpio_desc { ++ unsigned int gpio:7; ++ unsigned int dir:1; ++ unsigned int level:1; ++} stk5_ac97_gpios[] = { ++ /* configure the PHY strap pins to the correct values */ ++ { GPIO_PORTC | 18, 1, 0, }, ++ { GPIO_PORTC | 25, 1, 0, }, ++ { GPIO_PORTB | 12, 1, 0, }, ++}; ++ ++static int stk5_ac97_init(struct platform_device *dev) ++{ ++ int ret; ++ int i; ++ ++ DBG(0, "%s: \n", __FUNCTION__); ++ ++ ret = mxc_iomux_v3_setup_multiple_pads(stk5_ac97_pads_off, ++ ARRAY_SIZE(stk5_ac97_pads_off)); ++ if (ret == 0) { ++ for (i = 0; i < ARRAY_SIZE(stk5_ac97_gpios); i++) { ++ struct gpio_desc *pd = &stk5_ac97_gpios[i]; ++ ++ ret = gpio_request(pd->gpio, "AC97"); ++ if (ret < 0) { ++ DBG(0, "%s: Failed to request GPIO%d_%d: %d\n", ++ __FUNCTION__, pd->gpio / 32 + 1, pd->gpio % 32, ret); ++ goto rel_mux; ++ } ++ if (pd->dir) { ++ gpio_direction_output(pd->gpio, ++ pd->level); ++ } else { ++ gpio_direction_input(pd->gpio); ++ } ++ } ++ ++ ret = mxc_iomux_v3_setup_multiple_pads(stk5_ac97_pads_on, ++ ARRAY_SIZE(stk5_ac97_pads_on)); ++ if (ret != 0) { ++ goto rel_gpio; ++ } ++ udelay(1); ++ gpio_set_value(stk5_ac97_gpios[0].gpio, !stk5_ac97_gpios[0].level); ++ } ++ return ret; ++ ++ rel_mux: ++ mxc_iomux_v3_release_multiple_pads(stk5_ac97_gpios_off, ++ ARRAY_SIZE(stk5_ac97_gpios_off)); ++ rel_gpio: ++ while (--i >= 0) { ++ struct gpio_desc *pd = &stk5_ac97_gpios[i]; ++ int grp = pd->gpio / 32 + 1; ++ int ofs = pd->gpio % 32; ++ ++ DBG(0, "%s: Freeing GPIO%d_%d\n", __FUNCTION__, ++ grp, ofs); ++ gpio_free(pd->gpio); ++ } ++ return ret; ++} ++ ++static void stk5_ac97_exit(struct platform_device *dev) ++{ ++ int i; ++ ++ DBG(0, "%s: Releasing AC97 GPIO pins\n", __FUNCTION__); ++ ++ mxc_iomux_v3_release_multiple_pads(stk5_ac97_pads_on, ++ ARRAY_SIZE(stk5_ac97_pads_on)); ++ for (i = 0; i < ARRAY_SIZE(stk5_ac97_gpios); i++) { ++ struct gpio_desc *pd = &stk5_ac97_gpios[i]; ++ int grp = pd->gpio / 32 + 1; ++ int ofs = pd->gpio % 32; ++ ++ DBG(0, "%s: Freeing GPIO%d_%d\n", __FUNCTION__, ++ grp, ofs); ++ gpio_free(pd->gpio); ++ } ++} ++ ++static struct mxc_ac97_audio_ops stk5_ac97_ops = { ++ .init = stk5_ac97_init, ++ .exit = stk5_ac97_exit, ++ .startup = NULL, ++ .shutdown = NULL, ++ .suspend = NULL, ++ .resume = NULL, ++ .priv = NULL, ++}; ++ ++static struct platform_device ac97_device = { ++ .name = "mx25-ac97", ++ .id = -1, ++ .dev = { ++ .dma_mask = &stk5_dma_mask, ++ .coherent_dma_mask = ~0UL, ++ .platform_data = &stk5_ac97_ops, ++ }, ++}; ++#endif ++ ++static struct platform_dev_list { ++ struct platform_device *pdev; ++ int flag; ++} stk5_devices[] __initdata = { ++#if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE) ++ { .pdev = &stk5_led_device, .flag = -1, }, ++#endif ++#if defined(CONFIG_KEYBOARD_MXC) || defined(CONFIG_KEYBOARD_MXC_MODULE) ++ { .pdev = &stk5_keypad_device, .flag = 1, }, ++#endif ++#if defined(CONFIG_SPI_MXC) || defined(CONFIG_SPI_MXC_MODULE) ++ { .pdev = &mxcspi1_device, .flag = 1, }, ++#endif ++#if defined(CONFIG_AC97_BUS) || defined(CONFIG_AC97_BUS_MODULE) ++ { .pdev = &ac97_device, .flag = 1, }, ++#endif ++#if defined(CONFIG_MMC_MXC) || defined(CONFIG_MMC_MXC_MODULE) ++ { .pdev = &stk5_sdhc1_device, .flag = 1, }, ++#endif ++}; ++#define STK5_NUM_DEVICES ARRAY_SIZE(stk5_devices) ++ ++static __init int karo_stk5_board_init(void) ++{ ++ int ret; ++ int i; ++ ++ if (karo_get_board_type() != BOARD_KARO_STK5) { ++ return -ENODEV; ++ } ++ DBG(0, "%s: \n", __FUNCTION__); ++ ++ karo_stk5_serial_init(); ++ ++ dump_regs(); ++ ++ /* enable SSI1_INT (GPIO_3_15) for IRQ probing */ ++ set_irq_flags(gpio_to_irq(GPIO_PORTC | 15), IRQF_VALID | IRQF_PROBE); ++ ++ ret = karo_stk5_fb_register(); ++ if (ret) { ++ 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; ++ if (!stk5_devices[i].flag) { ++ DBG(0, "%s: Skipping platform device[%d] @ %p dev %p: %s\n", ++ __FUNCTION__, i, stk5_devices[i].pdev, &stk5_devices[i].pdev->dev, ++ stk5_devices[i].pdev->name); ++ continue; ++ } ++ DBG(0, "%s: Registering platform device[%d] @ %p dev %p: %s\n", ++ __FUNCTION__, i, stk5_devices[i].pdev, &stk5_devices[i].pdev->dev, ++ stk5_devices[i].pdev->name); ++ ret = platform_device_register(stk5_devices[i].pdev); ++ if (ret) { ++ printk(KERN_WARNING "%s: Failed to register platform_device[%d]: %s: %d\n", ++ __FUNCTION__, i, stk5_devices[i].pdev->name, ret); ++ } ++ } ++ DBG(0, "%s: Done\n", __FUNCTION__); ++ 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:59:19.000000000 +0200 +@@ -381,7 +381,7 @@ DEFINE_CLOCK(gpu2d_clk, 0, CCM_CGR3, 4 + .clk = &c, \ + }, + +-static struct clk_lookup lookups[] __initdata = { ++static struct clk_lookup lookups[] = { + _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:59:19.000000000 +0200 +@@ -516,7 +516,7 @@ DEFINE_CLOCK(ipg_clk, 0, NULL, + .clk = &c, \ + }, + +-static struct clk_lookup lookups[] __initdata = { ++static struct clk_lookup lookups[] = { + _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 18:01:59.000000000 +0200 +@@ -56,6 +56,9 @@ config ARCH_HAS_RNGA + bool + depends on ARCH_MXC + ++config ARCH_MXC_IOMUX_V2 ++ bool ++ + 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 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 + +-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 ++obj-$(CONFIG_ARCH_MXC_IOMUX_V2) += iomux-mx1-mx2.o dma-mx1-mx2.o ++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 18:02:13.000000000 +0200 +@@ -0,0 +1,17 @@ ++/* ++ * Copyright 2009 ++ * ++ * 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 ++ */ ++ ++#define UART1_ENABLED 1 ++#define UART2_ENABLED 1 ++#define UART3_ENABLED 1 ++/* 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 18:02:13.000000000 +0200 +@@ -0,0 +1,13 @@ ++/* ++ * Copyright 2009 ++ * ++ * 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 ++ */ ++ ++#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 18:02:05.000000000 +0200 +@@ -17,6 +17,7 @@ struct clk; + extern void mx1_map_io(void); + extern void mx21_map_io(void); + extern void mx27_map_io(void); ++extern void mx25_map_io(void); + extern void mx31_map_io(void); + extern void mx35_map_io(void); + extern void mxc_init_irq(void); +@@ -24,6 +25,7 @@ extern void mxc_timer_init(struct clk *t + extern int mx1_clocks_init(unsigned long fref); + extern int mx21_clocks_init(unsigned long lref, unsigned long fref); + extern int mx27_clocks_init(unsigned long fref); ++extern int mx25_clocks_init(unsigned long fref); + 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 18:02:13.000000000 +0200 +@@ -0,0 +1,259 @@ ++/* ++ * Copyright 2004-2008 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_DMA_H__ ++#define __ASM_ARCH_MXC_DMA_H__ ++ ++#include ++ ++#define MXC_DMA_DYNAMIC_CHANNEL 255 ++ ++#define MXC_DMA_DONE 0x0 ++#define MXC_DMA_REQUEST_TIMEOUT 0x1 ++#define MXC_DMA_TRANSFER_ERROR 0x2 ++ ++/*! This defines the list of device ID's for DMA */ ++typedef enum mxc_dma_device { ++ MXC_DMA_UART1_RX, ++ MXC_DMA_UART1_TX, ++ MXC_DMA_UART2_RX, ++ MXC_DMA_UART2_TX, ++ MXC_DMA_UART3_RX, ++ MXC_DMA_UART3_TX, ++ MXC_DMA_UART4_RX, ++ MXC_DMA_UART4_TX, ++ MXC_DMA_UART5_RX, ++ MXC_DMA_UART5_TX, ++ MXC_DMA_UART6_RX, ++ MXC_DMA_UART6_TX, ++ MXC_DMA_MMC1_WIDTH_1, ++ MXC_DMA_MMC1_WIDTH_4, ++ MXC_DMA_MMC2_WIDTH_1, ++ MXC_DMA_MMC2_WIDTH_4, ++ MXC_DMA_SSI1_8BIT_RX0, ++ MXC_DMA_SSI1_8BIT_TX0, ++ MXC_DMA_SSI1_16BIT_RX0, ++ MXC_DMA_SSI1_16BIT_TX0, ++ MXC_DMA_SSI1_24BIT_RX0, ++ MXC_DMA_SSI1_24BIT_TX0, ++ MXC_DMA_SSI1_8BIT_RX1, ++ MXC_DMA_SSI1_8BIT_TX1, ++ MXC_DMA_SSI1_16BIT_RX1, ++ MXC_DMA_SSI1_16BIT_TX1, ++ MXC_DMA_SSI1_24BIT_RX1, ++ MXC_DMA_SSI1_24BIT_TX1, ++ MXC_DMA_SSI2_8BIT_RX0, ++ MXC_DMA_SSI2_8BIT_TX0, ++ MXC_DMA_SSI2_16BIT_RX0, ++ MXC_DMA_SSI2_16BIT_TX0, ++ MXC_DMA_SSI2_24BIT_RX0, ++ MXC_DMA_SSI2_24BIT_TX0, ++ MXC_DMA_SSI2_8BIT_RX1, ++ MXC_DMA_SSI2_8BIT_TX1, ++ MXC_DMA_SSI2_16BIT_RX1, ++ MXC_DMA_SSI2_16BIT_TX1, ++ MXC_DMA_SSI2_24BIT_RX1, ++ MXC_DMA_SSI2_24BIT_TX1, ++ MXC_DMA_FIR_RX, ++ MXC_DMA_FIR_TX, ++ MXC_DMA_CSPI1_RX, ++ MXC_DMA_CSPI1_TX, ++ MXC_DMA_CSPI2_RX, ++ MXC_DMA_CSPI2_TX, ++ MXC_DMA_CSPI3_RX, ++ MXC_DMA_CSPI3_TX, ++ MXC_DMA_ATA_RX, ++ MXC_DMA_ATA_TX, ++ MXC_DMA_MEMORY, ++ MXC_DMA_FIFO_MEMORY, ++ MXC_DMA_DSP_PACKET_DATA0_RD, ++ MXC_DMA_DSP_PACKET_DATA0_WR, ++ MXC_DMA_DSP_PACKET_DATA1_RD, ++ MXC_DMA_DSP_PACKET_DATA1_WR, ++ MXC_DMA_DSP_LOG0_CHNL, ++ MXC_DMA_DSP_LOG1_CHNL, ++ MXC_DMA_DSP_LOG2_CHNL, ++ MXC_DMA_DSP_LOG3_CHNL, ++ MXC_DMA_CSI_RX, ++ MXC_DMA_SPDIF_16BIT_TX, ++ MXC_DMA_SPDIF_16BIT_RX, ++ MXC_DMA_SPDIF_32BIT_TX, ++ MXC_DMA_SPDIF_32BIT_RX, ++ MXC_DMA_ASRC_A_RX, ++ MXC_DMA_ASRC_A_TX, ++ MXC_DMA_ASRC_B_RX, ++ MXC_DMA_ASRC_B_TX, ++ MXC_DMA_ASRC_C_RX, ++ MXC_DMA_ASRC_C_TX, ++ MXC_DMA_ESAI_16BIT_RX, ++ MXC_DMA_ESAI_16BIT_TX, ++ MXC_DMA_ESAI_24BIT_RX, ++ MXC_DMA_ESAI_24BIT_TX, ++ MXC_DMA_TEST_RAM2D2RAM, ++ MXC_DMA_TEST_RAM2RAM2D, ++ MXC_DMA_TEST_RAM2D2RAM2D, ++ MXC_DMA_TEST_RAM2RAM, ++ MXC_DMA_TEST_HW_CHAINING, ++ MXC_DMA_TEST_SW_CHAINING ++} mxc_dma_device_t; ++ ++/*! This defines the prototype of callback funtion registered by the drivers */ ++typedef void (*mxc_dma_callback_t) (void *arg, int error_status, ++ unsigned int count); ++ ++/*! This defines the type of DMA transfer requested */ ++typedef enum mxc_dma_mode { ++ MXC_DMA_MODE_READ, ++ MXC_DMA_MODE_WRITE, ++} mxc_dma_mode_t; ++ ++/*! This defines the DMA channel parameters */ ++typedef struct mxc_dma_channel { ++ unsigned int active:1; /*!< When there has a active tranfer, it is set to 1 */ ++ unsigned int lock; /*!< Defines the channel is allocated or not */ ++ int curr_buf; /*!< Current buffer */ ++ mxc_dma_mode_t mode; /*!< Read or Write */ ++ unsigned int channel; /*!< Channel info */ ++ unsigned int dynamic:1; /*!< Channel not statically allocated when 1 */ ++ char *dev_name; /*!< Device name */ ++ void *private; /*!< Private structure for platform */ ++ mxc_dma_callback_t cb_fn; /*!< The callback function */ ++ void *cb_args; /*!< The argument of callback function */ ++} mxc_dma_channel_t; ++ ++/*! This structure contains the information about a dma transfer */ ++typedef struct mxc_dma_requestbuf { ++ dma_addr_t src_addr; /*!< source address */ ++ dma_addr_t dst_addr; /*!< destination address */ ++ int num_of_bytes; /*!< the length of this transfer : bytes */ ++} mxc_dma_requestbuf_t; ++ ++/*! ++ * This function is generally called by the driver at open time. ++ * The DMA driver would do any initialization steps that is required ++ * to get the channel ready for data transfer. ++ * ++ * @param channel_id a pre-defined id. The peripheral driver would specify ++ * the id associated with its peripheral. This would be ++ * used by the DMA driver to identify the peripheral ++ * requesting DMA and do the necessary setup on the ++ * channel associated with the particular peripheral. ++ * The DMA driver could use static or dynamic DMA channel ++ * allocation. ++ * @param dev_name module name or device name ++ * @return returns a negative number on error if request for a DMA channel did not ++ * succeed, returns the channel number to be used on success. ++ */ ++extern int mxc_dma_request(mxc_dma_device_t channel_id, char *dev_name); ++ ++/*! ++ * This function is generally called by the driver at close time. The DMA ++ * driver would do any cleanup associated with this channel. ++ * ++ * @param channel_num the channel number returned at request time. This ++ * would be used by the DMA driver to identify the calling ++ * driver and do the necessary cleanup on the channel ++ * associated with the particular peripheral ++ * @return returns a negative number on error or 0 on success ++ */ ++extern int mxc_dma_free(int channel_num); ++ ++/*! ++ * This function would just configure the buffers specified by the user into ++ * dma channel. The caller must call mxc_dma_enable to start this transfer. ++ * ++ * @param channel_num the channel number returned at request time. This ++ * would be used by the DMA driver to identify the calling ++ * driver and do the necessary cleanup on the channel ++ * associated with the particular peripheral ++ * @param dma_buf an array of physical addresses to the user defined ++ * buffers. The caller must guarantee the dma_buf is ++ * available until the transfer is completed. ++ * @param num_buf number of buffers in the array ++ * @param mode specifies whether this is READ or WRITE operation ++ * @return This function returns a negative number on error if buffer could not be ++ * added with DMA for transfer. On Success, it returns 0 ++ */ ++extern int mxc_dma_config(int channel_num, mxc_dma_requestbuf_t * dma_buf, ++ int num_buf, mxc_dma_mode_t mode); ++ ++/*! ++ * This function would just configure the scatterlist specified by the ++ * user into dma channel. This is a slight variation of mxc_dma_config(), ++ * it is provided for the convenience of drivers that have a scatterlist ++ * passed into them. It is the calling driver's responsibility to have the ++ * correct physical address filled in the "dma_address" field of the ++ * scatterlist. ++ * ++ * @param channel_num the channel number returned at request time. This ++ * would be used by the DMA driver to identify the calling ++ * driver and do the necessary cleanup on the channel ++ * associated with the particular peripheral ++ * @param sg a scatterlist of buffers. The caller must guarantee ++ * the dma_buf is available until the transfer is ++ * completed. ++ * @param num_buf number of buffers in the array ++ * @param num_of_bytes total number of bytes to transfer. If set to 0, this ++ * would imply to use the length field of the scatterlist ++ * for each DMA transfer. Else it would calculate the size ++ * for each DMA transfer. ++ * @param mode specifies whether this is READ or WRITE operation ++ * @return This function returns a negative number on error if buffer could not ++ * be added with DMA for transfer. On Success, it returns 0 ++ */ ++extern int mxc_dma_sg_config(int channel_num, struct scatterlist *sg, ++ int num_buf, int num_of_bytes, ++ mxc_dma_mode_t mode); ++ ++/*! ++ * This function is provided if the driver would like to set/change its ++ * callback function. ++ * ++ * @param channel_num the channel number returned at request time. This ++ * would be used by the DMA driver to identify the calling ++ * driver and do the necessary cleanup on the channel ++ * associated with the particular peripheral ++ * @param callback a callback function to provide notification on transfer ++ * completion, user could specify NULL if he does not wish ++ * to be notified ++ * @param arg an argument that gets passed in to the callback ++ * function, used by the user to do any driver specific ++ * operations. ++ * @return this function returns a negative number on error if the callback ++ * could not be set for the channel or 0 on success ++ */ ++extern int mxc_dma_callback_set(int channel_num, mxc_dma_callback_t callback, ++ void *arg); ++ ++/*! ++ * This stops the DMA channel and any ongoing transfers. Subsequent use of ++ * mxc_dma_enable() will restart the channel and restart the transfer. ++ * ++ * @param channel_num the channel number returned at request time. This ++ * would be used by the DMA driver to identify the calling ++ * driver and do the necessary cleanup on the channel ++ * associated with the particular peripheral ++ * @return returns a negative number on error or 0 on success ++ */ ++extern int mxc_dma_disable(int channel_num); ++ ++/*! ++ * This starts DMA transfer. Or it restarts DMA on a stopped channel ++ * previously stopped with mxc_dma_disable(). ++ * ++ * @param channel_num the channel number returned at request time. This ++ * would be used by the DMA driver to identify the calling ++ * driver and do the necessary cleanup on the channel ++ * associated with the particular peripheral ++ * @return returns a negative number on error or 0 on success ++ */ ++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 18:02:06.000000000 +0200 +@@ -29,13 +29,18 @@ + #endif + + #ifdef CONFIG_ARCH_MX2 ++#ifndef CONFIG_MACH_MX25 + # include ++#endif + # ifdef CONFIG_MACH_MX21 + # include + # endif + # ifdef CONFIG_MACH_MX27 + # include + # endif ++# ifdef CONFIG_MACH_MX25 ++# include ++# endif + #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 18:02:06.000000000 +0200 +@@ -13,7 +13,8 @@ + #define PCR_BPIX_4 (2 << 25) + #define PCR_BPIX_8 (3 << 25) + #define PCR_BPIX_12 (4 << 25) +-#define PCR_BPIX_16 (4 << 25) ++#define PCR_BPIX_16 (5 << 25) ++#define PCR_BPIX_18 (6 << 25) + #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 18:02:13.000000000 +0200 +@@ -0,0 +1,905 @@ ++/* ++ * arch/arm/plat-mxc/include/mach/iomux-mx25.h ++ * ++ * Copyright (C) 2009 by Lothar Wassmann ++ * ++ * based on arch/arm/mach-mx25/mx25_pins.h ++ * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved. ++ * and ++ * arch/arm/plat-mxc/include/mach/iomux-mx35.h ++ * Copyright (C, NO_PAD_CTRL) 2009 by Jan Weitzel Phytec Messtechnik GmbH ++ * ++ * 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 __IOMUX_MX25_H__ ++#define __IOMUX_MX25_H__ ++ ++#include ++ ++/* ++ * ++ * @brief MX25 I/O Pin List ++ * ++ * @ingroup GPIO_MX25 ++ */ ++ ++#ifndef __ASSEMBLY__ ++ ++/* ++ * 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 IOMUX_TO_GPIO(__pad_desc) ({ \ ++ int __gpio = -1; \ ++ struct pad_desc *__pd = __pad_desc; \ ++ \ ++ switch (__pd->mux_ctrl_ofs) { \ ++ case MX25_PAD_GPIO_A__GPIO_A: \ ++ __gpio = GPIO_A; \ ++ break; \ ++ case MX25_PAD_GPIO_B__GPIO_B: \ ++ __gpio = GPIO_B; \ ++ break; \ ++ case MX25_PAD_GPIO_C__GPIO_C: \ ++ __gpio = GPIO_C; \ ++ break; \ ++ case MX25_PAD_GPIO_D__GPIO_D: \ ++ __gpio = GPIO_D; \ ++ break; \ ++ case MX25_PAD_GPIO_E__GPIO_E: \ ++ __gpio = GPIO_E; \ ++ break; \ ++ case MX25_PAD_GPIO_F__GPIO_F: \ ++ __gpio = GPIO_F; \ ++ break; \ ++ case MX25_PAD_CSI_D7__GPIO_1_6: \ ++ __gpio = GPIO_1_6; \ ++ break; \ ++ case MX25_PAD_CSI_D8__GPIO_1_7: \ ++ __gpio = GPIO_1_7; \ ++ break; \ ++ case MX25_PAD_CSI_MCLK__GPIO_1_8: \ ++ __gpio = GPIO_1_8; \ ++ break; \ ++ case MX25_PAD_CSI_VSYNC__GPIO_1_9: \ ++ __gpio = GPIO_1_9; \ ++ break; \ ++ case MX25_PAD_CSI_HSYNC__GPIO_1_10: \ ++ __gpio = GPIO_1_10; \ ++ break; \ ++ case MX25_PAD_CSI_PIXCLK__GPIO_1_11: \ ++ __gpio = GPIO_1_11; \ ++ break; \ ++ case MX25_PAD_I2C1_CLK__GPIO_1_12: \ ++ __gpio = GPIO_1_12; \ ++ break; \ ++ case MX25_PAD_I2C1_DAT__GPIO_1_13: \ ++ __gpio = GPIO_1_13; \ ++ break; \ ++ case MX25_PAD_CSPI1_MOSI__GPIO_1_14: \ ++ __gpio = GPIO_1_14; \ ++ break; \ ++ case MX25_PAD_CSPI1_MISO__GPIO_1_15: \ ++ __gpio = GPIO_1_15; \ ++ break; \ ++ case MX25_PAD_CSPI1_SS0__GPIO_1_16: \ ++ __gpio = GPIO_1_16; \ ++ break; \ ++ case MX25_PAD_CSPI1_SS1__GPIO_1_17: \ ++ __gpio = GPIO_1_17; \ ++ break; \ ++ case MX25_PAD_CSPI1_SCLK__GPIO_1_18: \ ++ __gpio = GPIO_1_18; \ ++ break; \ ++ case MX25_PAD_LD5__GPIO_1_19: \ ++ __gpio = GPIO_1_19; \ ++ break; \ ++ case MX25_PAD_LD6__GPIO_1_20: \ ++ __gpio = GPIO_1_20; \ ++ break; \ ++ case MX25_PAD_LD7__GPIO_1_21: \ ++ __gpio = GPIO_1_21; \ ++ break; \ ++ case MX25_PAD_HSYNC__GPIO_1_22: \ ++ __gpio = GPIO_1_22; \ ++ break; \ ++ case MX25_PAD_VSYNC__GPIO_1_23: \ ++ __gpio = GPIO_1_23; \ ++ break; \ ++ case MX25_PAD_LSCLK__GPIO_1_24: \ ++ __gpio = GPIO_1_24; \ ++ break; \ ++ case MX25_PAD_OE_ACD__GPIO_1_25: \ ++ __gpio = GPIO_1_25; \ ++ break; \ ++ case MX25_PAD_PWM__GPIO_1_26: \ ++ __gpio = GPIO_1_26; \ ++ break; \ ++ case MX25_PAD_CSI_D2__GPIO_1_27: \ ++ __gpio = GPIO_1_27; \ ++ break; \ ++ case MX25_PAD_CSI_D3__GPIO_1_28: \ ++ __gpio = GPIO_1_28; \ ++ break; \ ++ case MX25_PAD_CSI_D4__GPIO_1_29: \ ++ __gpio = GPIO_1_29; \ ++ break; \ ++ case MX25_PAD_CSI_D5__GPIO_1_30: \ ++ __gpio = GPIO_1_30; \ ++ break; \ ++ case MX25_PAD_CSI_D6__GPIO_1_31: \ ++ __gpio = GPIO_1_31; \ ++ break; \ ++ \ ++ case MX25_PAD_A14__GPIO_2_0: \ ++ __gpio = GPIO_2_0; \ ++ break; \ ++ case MX25_PAD_A15__GPIO_2_1: \ ++ __gpio = GPIO_2_1; \ ++ break; \ ++ case MX25_PAD_A16__GPIO_2_2: \ ++ __gpio = GPIO_2_2; \ ++ break; \ ++ case MX25_PAD_A17__GPIO_2_3: \ ++ __gpio = GPIO_2_3; \ ++ break; \ ++ case MX25_PAD_A18__GPIO_2_4: \ ++ __gpio = GPIO_2_4; \ ++ break; \ ++ case MX25_PAD_A19__GPIO_2_5: \ ++ __gpio = GPIO_2_5; \ ++ break; \ ++ case MX25_PAD_A20__GPIO_2_6: \ ++ __gpio = GPIO_2_6; \ ++ break; \ ++ case MX25_PAD_A21__GPIO_2_7: \ ++ __gpio = GPIO_2_7; \ ++ break; \ ++ case MX25_PAD_A22__GPIO_2_8: \ ++ __gpio = GPIO_2_8; \ ++ break; \ ++ case MX25_PAD_A23__GPIO_2_9: \ ++ __gpio = GPIO_2_9; \ ++ break; \ ++ case MX25_PAD_A24__GPIO_2_10: \ ++ __gpio = GPIO_2_10; \ ++ break; \ ++ case MX25_PAD_A25__GPIO_2_11: \ ++ __gpio = GPIO_2_11; \ ++ break; \ ++ case MX25_PAD_EB0__GPIO_2_12: \ ++ __gpio = GPIO_2_12; \ ++ break; \ ++ case MX25_PAD_EB1__GPIO_2_13: \ ++ __gpio = GPIO_2_13; \ ++ break; \ ++ case MX25_PAD_OE__GPIO_2_14: \ ++ __gpio = GPIO_2_14; \ ++ break; \ ++ case MX25_PAD_LD0__GPIO_2_15: \ ++ __gpio = GPIO_2_15; \ ++ break; \ ++ case MX25_PAD_LD1__GPIO_2_16: \ ++ __gpio = GPIO_2_16; \ ++ break; \ ++ case MX25_PAD_LD2__GPIO_2_17: \ ++ __gpio = GPIO_2_17; \ ++ break; \ ++ case MX25_PAD_LD3__GPIO_2_18: \ ++ __gpio = GPIO_2_18; \ ++ break; \ ++ case MX25_PAD_LD4__GPIO_2_19: \ ++ __gpio = GPIO_2_19; \ ++ break; \ ++ case MX25_PAD_DE_B__GPIO_2_20: \ ++ __gpio = GPIO_2_20; \ ++ break; \ ++ case MX25_PAD_CLKO__GPIO_2_21: \ ++ __gpio = GPIO_2_21; \ ++ break; \ ++ case MX25_PAD_CSPI1_RDY__GPIO_2_22: \ ++ __gpio = GPIO_2_22; \ ++ break; \ ++ case MX25_PAD_SD1_CMD__GPIO_2_23: \ ++ __gpio = GPIO_2_23; \ ++ break; \ ++ case MX25_PAD_SD1_CLK__GPIO_2_24: \ ++ __gpio = GPIO_2_24; \ ++ break; \ ++ case MX25_PAD_SD1_DATA0__GPIO_2_25: \ ++ __gpio = GPIO_2_25; \ ++ break; \ ++ case MX25_PAD_SD1_DATA1__GPIO_2_26: \ ++ __gpio = GPIO_2_26; \ ++ break; \ ++ case MX25_PAD_SD1_DATA2__GPIO_2_27: \ ++ __gpio = GPIO_2_27; \ ++ break; \ ++ case MX25_PAD_SD1_DATA3__GPIO_2_28: \ ++ __gpio = GPIO_2_28; \ ++ break; \ ++ case MX25_PAD_KPP_ROW0__GPIO_2_29: \ ++ __gpio = GPIO_2_29; \ ++ break; \ ++ case MX25_PAD_KPP_ROW1__GPIO_2_30: \ ++ __gpio = GPIO_2_30; \ ++ break; \ ++ case MX25_PAD_KPP_ROW2__GPIO_2_31: \ ++ __gpio = GPIO_2_31; \ ++ break; \ ++ \ ++ case MX25_PAD_KPP_ROW3__GPIO_3_0: \ ++ __gpio = GPIO_3_0; \ ++ break; \ ++ case MX25_PAD_KPP_COL0__GPIO_3_1: \ ++ __gpio = GPIO_3_1; \ ++ break; \ ++ case MX25_PAD_KPP_COL1__GPIO_3_2: \ ++ __gpio = GPIO_3_2; \ ++ break; \ ++ case MX25_PAD_KPP_COL2__GPIO_3_3: \ ++ __gpio = GPIO_3_3; \ ++ break; \ ++ case MX25_PAD_KPP_COL3__GPIO_3_4: \ ++ __gpio = GPIO_3_4; \ ++ break; \ ++ case MX25_PAD_FEC_MDC__GPIO_3_5: \ ++ __gpio = GPIO_3_5; \ ++ break; \ ++ case MX25_PAD_FEC_MDIO__GPIO_3_6: \ ++ __gpio = GPIO_3_6; \ ++ break; \ ++ case MX25_PAD_FEC_TDATA0__GPIO_3_7: \ ++ __gpio = GPIO_3_7; \ ++ break; \ ++ case MX25_PAD_FEC_TDATA1__GPIO_3_8: \ ++ __gpio = GPIO_3_8; \ ++ break; \ ++ case MX25_PAD_FEC_TX_EN__GPIO_3_9: \ ++ __gpio = GPIO_3_9; \ ++ break; \ ++ case MX25_PAD_FEC_RDATA0__GPIO_3_10: \ ++ __gpio = GPIO_3_10; \ ++ break; \ ++ case MX25_PAD_FEC_RDATA1__GPIO_3_11: \ ++ __gpio = GPIO_3_11; \ ++ break; \ ++ case MX25_PAD_FEC_RX_DV__GPIO_3_12: \ ++ __gpio = GPIO_3_12; \ ++ break; \ ++ case MX25_PAD_FEC_TX_CLK__GPIO_3_13: \ ++ __gpio = GPIO_3_13; \ ++ break; \ ++ case MX25_PAD_RTCK__GPIO_3_14: \ ++ __gpio = GPIO_3_14; \ ++ break; \ ++ case MX25_PAD_EXT_ARMCLK__GPIO_3_15: \ ++ __gpio = GPIO_3_15; \ ++ break; \ ++ case MX25_PAD_UPLL_BYPCLK__GPIO_3_16: \ ++ __gpio = GPIO_3_16; \ ++ break; \ ++ case MX25_PAD_VSTBY_REQ__GPIO_3_17: \ ++ __gpio = GPIO_3_17; \ ++ break; \ ++ case MX25_PAD_VSTBY_ACK__GPIO_3_18: \ ++ __gpio = GPIO_3_18; \ ++ break; \ ++ case MX25_PAD_POWER_FAIL__GPIO_3_19: \ ++ __gpio = GPIO_3_19; \ ++ break; \ ++ case MX25_PAD_CS4__GPIO_3_20: \ ++ __gpio = GPIO_3_20; \ ++ break; \ ++ case MX25_PAD_CS5__GPIO_3_21: \ ++ __gpio = GPIO_3_21; \ ++ break; \ ++ case MX25_PAD_NF_CE0__GPIO_3_22: \ ++ __gpio = GPIO_3_22; \ ++ break; \ ++ case MX25_PAD_ECB__GPIO_3_23: \ ++ __gpio = GPIO_3_23; \ ++ break; \ ++ case MX25_PAD_LBA__GPIO_3_24: \ ++ __gpio = GPIO_3_24; \ ++ break; \ ++ case MX25_PAD_RW__GPIO_3_25: \ ++ __gpio = GPIO_3_25; \ ++ break; \ ++ case MX25_PAD_NFWE_B__GPIO_3_26: \ ++ __gpio = GPIO_3_26; \ ++ break; \ ++ case MX25_PAD_NFRE_B__GPIO_3_27: \ ++ __gpio = GPIO_3_27; \ ++ break; \ ++ case MX25_PAD_NFALE__GPIO_3_28: \ ++ __gpio = GPIO_3_28; \ ++ break; \ ++ case MX25_PAD_NFCLE__GPIO_3_29: \ ++ __gpio = GPIO_3_29; \ ++ break; \ ++ case MX25_PAD_NFWP_B__GPIO_3_30: \ ++ __gpio = GPIO_3_30; \ ++ break; \ ++ case MX25_PAD_NFRB__GPIO_3_31: \ ++ __gpio = GPIO_3_31; \ ++ break; \ ++ \ ++ case MX25_PAD_A10__GPIO_4_0: \ ++ __gpio = GPIO_4_0; \ ++ break; \ ++ case MX25_PAD_A13__GPIO_4_1: \ ++ __gpio = GPIO_4_1; \ ++ break; \ ++ case MX25_PAD_CS0__GPIO_4_2: \ ++ __gpio = GPIO_4_2; \ ++ break; \ ++ case MX25_PAD_CS1__GPIO_4_3: \ ++ __gpio = GPIO_4_3; \ ++ break; \ ++ case MX25_PAD_BCLK__GPIO_4_4: \ ++ __gpio = GPIO_4_4; \ ++ break; \ ++ case MX25_PAD_D15__GPIO_4_5: \ ++ __gpio = GPIO_4_5; \ ++ break; \ ++ case MX25_PAD_D14__GPIO_4_6: \ ++ __gpio = GPIO_4_6; \ ++ break; \ ++ case MX25_PAD_D13__GPIO_4_7: \ ++ __gpio = GPIO_4_7; \ ++ break; \ ++ case MX25_PAD_D12__GPIO_4_8: \ ++ __gpio = GPIO_4_8; \ ++ break; \ ++ case MX25_PAD_D11__GPIO_4_9: \ ++ __gpio = GPIO_4_9; \ ++ break; \ ++ case MX25_PAD_D10__GPIO_4_10: \ ++ __gpio = GPIO_4_10; \ ++ break; \ ++ case MX25_PAD_D9__GPIO_4_11: \ ++ __gpio = GPIO_4_11; \ ++ break; \ ++ case MX25_PAD_D8__GPIO_4_12: \ ++ __gpio = GPIO_4_12; \ ++ break; \ ++ case MX25_PAD_D7__GPIO_4_13: \ ++ __gpio = GPIO_4_13; \ ++ break; \ ++ case MX25_PAD_D6__GPIO_4_14: \ ++ __gpio = GPIO_4_14; \ ++ break; \ ++ case MX25_PAD_D5__GPIO_4_15: \ ++ __gpio = GPIO_4_15; \ ++ break; \ ++ case MX25_PAD_D4__GPIO_4_16: \ ++ __gpio = GPIO_4_16; \ ++ break; \ ++ case MX25_PAD_D3__GPIO_4_17: \ ++ __gpio = GPIO_4_17; \ ++ break; \ ++ case MX25_PAD_D2__GPIO_4_18: \ ++ __gpio = GPIO_4_18; \ ++ break; \ ++ case MX25_PAD_D1__GPIO_4_19: \ ++ __gpio = GPIO_4_19; \ ++ break; \ ++ case MX25_PAD_D0__GPIO_4_20: \ ++ __gpio = GPIO_4_20; \ ++ break; \ ++ case MX25_PAD_CSI_D9__GPIO_4_21: \ ++ __gpio = GPIO_4_21; \ ++ break; \ ++ case MX25_PAD_UART1_RXD__GPIO_4_22: \ ++ __gpio = GPIO_4_22; \ ++ break; \ ++ case MX25_PAD_UART1_TXD__GPIO_4_23: \ ++ __gpio = GPIO_4_23; \ ++ break; \ ++ case MX25_PAD_UART1_RTS__GPIO_4_24: \ ++ __gpio = GPIO_4_24; \ ++ break; \ ++ case MX25_PAD_UART1_CTS__GPIO_4_25: \ ++ __gpio = GPIO_4_25; \ ++ break; \ ++ case MX25_PAD_UART2_RXD__GPIO_4_26: \ ++ __gpio = GPIO_4_26; \ ++ break; \ ++ case MX25_PAD_UART2_TXD__GPIO_4_27: \ ++ __gpio = GPIO_4_27; \ ++ break; \ ++ case MX25_PAD_UART2_RTS__GPIO_4_28: \ ++ __gpio = GPIO_4_28; \ ++ break; \ ++ case MX25_PAD_UART2_CTS__GPIO_4_29: \ ++ __gpio = GPIO_4_29; \ ++ break; \ ++ case MX25_PAD_BOOT_MODE0__GPIO_4_30: \ ++ __gpio = GPIO_4_30; \ ++ break; \ ++ case MX25_PAD_BOOT_MODE1__GPIO_4_31: \ ++ __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 18:02:08.000000000 +0200 +@@ -54,7 +54,7 @@ struct pad_desc { + unsigned select_input:3; + }; + +-#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 { + /* + * 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_DRIVE_VOLTAGE_3_3_V (0 << 13) ++#define PAD_CTL_DRIVE_VOLTAGE_1_8_V (1 << 13) + +-#define PAD_CTL_NO_HYSTERESIS 0 +-#define PAD_CTL_HYSTERESIS 1 ++#define PAD_CTL_NO_HYSTERESIS (0 << 8) ++#define PAD_CTL_HYSTERESIS (1 << 8) + +-#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_PULL_DISABLED (0x0 << 4) ++#define PAD_CTL_PULL_KEEPER (0x8 << 4) ++#define PAD_CTL_PULL_DOWN_100K (0xc << 4) ++#define PAD_CTL_PULL_UP_47K (0xd << 4) ++#define PAD_CTL_PULL_UP_100K (0xe << 4) ++#define PAD_CTL_PULL_UP_22K (0xf << 4) ++ ++#define PAD_CTL_OUTPUT_CMOS (0 << 3) ++#define PAD_CTL_OUTPUT_OPEN_DRAIN (1 << 3) ++ ++#define PAD_CTL_DRIVE_STRENGTH_NORM (0 << 1) ++#define PAD_CTL_DRIVE_STRENGTH_HIGH (1 << 1) ++#define PAD_CTL_DRIVE_STRENGTH_MAX (2 << 1) + +-#define PAD_CTL_SLEW_RATE_SLOW 0 +-#define PAD_CTL_SLEW_RATE_FAST 1 ++#define PAD_CTL_SLEW_RATE_SLOW (0 << 0) ++#define PAD_CTL_SLEW_RATE_FAST (1 << 0) + + /* + * 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 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 + */ ++#ifndef CONFIG_MACH_MX25 + #define VA_GPIO_BASE IO_ADDRESS(GPIO_BASE_ADDR) ++#endif + #define MXC_DDIR(x) (0x00 + ((x) << 8)) ++#ifndef CONFIG_MACH_MX25 + #define MXC_OCR1(x) (0x04 + ((x) << 8)) + #define MXC_OCR2(x) (0x08 + ((x) << 8)) ++#endif + #define MXC_ICONFA1(x) (0x0c + ((x) << 8)) + #define MXC_ICONFA2(x) (0x10 + ((x) << 8)) + #define MXC_ICONFB1(x) (0x14 + ((x) << 8)) +@@ -96,16 +100,20 @@ + + + #ifdef CONFIG_ARCH_MX1 +-#include ++# include + #endif + #ifdef CONFIG_ARCH_MX2 +-#include +-#ifdef CONFIG_MACH_MX21 +-#include +-#endif +-#ifdef CONFIG_MACH_MX27 +-#include +-#endif ++# ifndef CONFIG_MACH_MX25 ++# include ++# ifdef CONFIG_MACH_MX21 ++# include ++# endif ++# endif ++# ifdef CONFIG_MACH_MX27 ++# include ++# else ++# include ++# endif + #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 18:02:09.000000000 +0200 +@@ -21,7 +21,11 @@ + #if defined CONFIG_ARCH_MX1 + #define MXC_GPIO_IRQS (32 * 4) + #elif defined CONFIG_ARCH_MX2 ++#ifndef CONFIG_MACH_MX25 + #define MXC_GPIO_IRQS (32 * 6) ++#else ++#define MXC_GPIO_IRQS (32 * 4) ++#endif + #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 18:02:09.000000000 +0200 +@@ -14,12 +14,13 @@ + #if defined CONFIG_ARCH_MX1 + #define PHYS_OFFSET UL(0x08000000) + #elif defined CONFIG_ARCH_MX2 +-#ifdef CONFIG_MACH_MX21 ++# if defined(CONFIG_MACH_MX21) + #define PHYS_OFFSET UL(0xC0000000) +-#endif +-#ifdef CONFIG_MACH_MX27 ++# elif defined(CONFIG_MACH_MX27) + #define PHYS_OFFSET UL(0xA0000000) +-#endif ++# elif defined(CONFIG_MACH_MX25) ++#define PHYS_OFFSET UL(0x80000000) ++# endif + #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 18:02:13.000000000 +0200 +@@ -0,0 +1,482 @@ ++/* ++ * Copyright 2008-2009 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 ++ */ ++ ++/*! ++ * @file arch-mxc/mx25.h ++ * @brief This file contains register definitions. ++ * ++ * @ingroup MSL_MX25 ++ */ ++ ++#ifndef __ASM_ARCH_MXC_MX25_H__ ++#define __ASM_ARCH_MXC_MX25_H__ ++ ++#ifndef __ASM_ARCH_MXC_HARDWARE_H__ ++#error "Do not include directly." ++#endif ++ ++#ifdef CONFIG_DEBUG_LL ++#ifdef CONFIG_MACH_TX25 ++#include ++#endif ++#endif // CONFIG_DEBUG_LL ++ ++/* ++ * MX25 memory map: ++ * ++ * Virt Phys Size What ++ * --------------------------------------------------------------------------- ++ * FC000000 43F00000 1M AIPS 1 ++ * FC100000 50000000 1M SPBA ++ * FC200000 53F00000 1M AIPS 2 ++ * FC300000 60000000 1M ROMPATCH (128M) ++ * FC400000 68000000 1M ASIC (128M) ++ * FC500000 78000000 128K FBC RAM (IRAM) ++ * 80000000 256M SDRAM0 ++ * 90000000 256M SDRAM1 ++ * A0000000 128M CS0 Flash ++ * A8000000 128M CS1 Flash ++ * B0000000 32M CS2 SRAM ++ * B2000000 32M CS3 ++ * B4000000 32M CS4 ++ * B6000000 32M CS5 ++ * FC520000 B8000000 64K SDRAM, WEIM, M3IF, EMI controllers ++ * FC530000 BB000000 8K NFC ++ */ ++ ++#include ++#define VA(x) _AT(void __force __iomem *,x) ++ ++/* ++ * IRAM ++ */ ++#define IRAM_BASE_ADDR UL(0x78000000) /* internal ram */ ++#define IRAM_BASE_ADDR_VIRT VA(0xFC500000) ++#define IRAM_SIZE SZ_128K ++ ++/* ++ * AIPS 1 ++ */ ++#define AIPS1_BASE_ADDR UL(0x43F00000) ++#define AIPS1_BASE_ADDR_VIRT VA(0xFC000000) ++#define AIPS1_SIZE SZ_1M ++ ++#define MAX_BASE_ADDR (AIPS1_BASE_ADDR + 0x00004000) ++#define CLKCTL_BASE_ADDR (AIPS1_BASE_ADDR + 0x00008000) ++#define ETB_SLOT4_BASE_ADDR (AIPS1_BASE_ADDR + 0x0000C000) ++#define ETB_SLOT5_BASE_ADDR (AIPS1_BASE_ADDR + 0x00010000) ++#define AAPE_BASE_ADDR (AIPS1_BASE_ADDR + 0x00014000) ++#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 UART1_BASE_ADDR (AIPS1_BASE_ADDR + 0x00090000) ++#define UART2_BASE_ADDR (AIPS1_BASE_ADDR + 0x00094000) ++#define I2C2_BASE_ADDR (AIPS1_BASE_ADDR + 0x00098000) ++#define OWIRE_BASE_ADDR (AIPS1_BASE_ADDR + 0x0009C000) ++#define ATA_BASE_ADDR (AIPS1_BASE_ADDR + 0x000A0000) ++#define CSPI1_BASE_ADDR (AIPS1_BASE_ADDR + 0x000A4000) ++#define KPP_BASE_ADDR (AIPS1_BASE_ADDR + 0x000A8000) ++#define IOMUXC_BASE_ADDR (AIPS1_BASE_ADDR + 0x000AC000) ++#define AUDMUX_BASE_ADDR (AIPS1_BASE_ADDR + 0x000B0000) ++#define ECT_A_BASE_ADDR (AIPS1_BASE_ADDR + 0x000B8000) ++#define ECT_B_BASE_ADDR (AIPS1_BASE_ADDR + 0x000BC000) ++ ++/* ++ * SPBA global module enabled #0 ++ */ ++#define SPBA0_BASE_ADDR UL(0x50000000) ++#define SPBA0_BASE_ADDR_VIRT VA(0xFC100000) ++#define SPBA0_SIZE SZ_1M ++ ++#define CSPI3_BASE_ADDR (SPBA0_BASE_ADDR + 0x00004000) ++#define UART4_BASE_ADDR (SPBA0_BASE_ADDR + 0x00008000) ++#define UART3_BASE_ADDR (SPBA0_BASE_ADDR + 0x0000C000) ++#define CSPI2_BASE_ADDR (SPBA0_BASE_ADDR + 0x00010000) ++#define SSI2_BASE_ADDR (SPBA0_BASE_ADDR + 0x00014000) ++#define ESAI_BASE_ADDR (SPBA0_BASE_ADDR + 0x00018000) ++#define ATA_DMA_BASE_ADDR (SPBA0_BASE_ADDR + 0x00020000) ++#define SIM1_BASE_ADDR (SPBA0_BASE_ADDR + 0x00024000) ++#define SIM2_BASE_ADDR (SPBA0_BASE_ADDR + 0x00028000) ++#define UART5_BASE_ADDR (SPBA0_BASE_ADDR + 0x0002C000) ++#define TSC_BASE_ADDR (SPBA0_BASE_ADDR + 0x00030000) ++#define SSI1_BASE_ADDR (SPBA0_BASE_ADDR + 0x00034000) ++#define FEC_BASE_ADDR (SPBA0_BASE_ADDR + 0x00038000) ++#define SPBA_CTRL_BASE_ADDR (SPBA0_BASE_ADDR + 0x0003C000) ++ ++/*! ++ * defines for SPBA modules ++ */ ++#define SPBA_CSPI3 (0x1 << 2) ++#define SPBA_UART4 (0x2 << 2) ++#define SPBA_UART3 (0x3 << 2) ++#define SPBA_CSPI2 (0x4 << 2) ++#define SPBA_SSI2 (0x5 << 2) ++#define SPBA_ESAI (0x6 << 2) ++#define SPBA_ATA (0x8 << 2) ++#define SPBA_SIM1 (0x9 << 2) ++#define SPBA_SIM2 (0xA << 2) ++#define SPBA_UART5 (0xB << 2) ++#define SPBA_ANALOG (0xC << 2) ++#define SPBA_SSI1 (0xD << 2) ++#define SPBA_FEC (0xE << 2) ++ ++/*! ++ * Defines for modules using static and dynamic DMA channels ++ */ ++#define MXC_DMA_CHANNEL_IRAM 30 ++#define MXC_DMA_CHANNEL_UART1_RX MXC_DMA_DYNAMIC_CHANNEL ++#define MXC_DMA_CHANNEL_UART1_TX MXC_DMA_DYNAMIC_CHANNEL ++#define MXC_DMA_CHANNEL_UART2_RX MXC_DMA_DYNAMIC_CHANNEL ++#define MXC_DMA_CHANNEL_UART2_TX MXC_DMA_DYNAMIC_CHANNEL ++#define MXC_DMA_CHANNEL_UART3_RX MXC_DMA_DYNAMIC_CHANNEL ++#define MXC_DMA_CHANNEL_UART3_TX MXC_DMA_DYNAMIC_CHANNEL ++#define MXC_DMA_CHANNEL_UART4_RX MXC_DMA_DYNAMIC_CHANNEL ++#define MXC_DMA_CHANNEL_UART4_TX MXC_DMA_DYNAMIC_CHANNEL ++#define MXC_DMA_CHANNEL_UART5_RX MXC_DMA_DYNAMIC_CHANNEL ++#define MXC_DMA_CHANNEL_UART5_TX MXC_DMA_DYNAMIC_CHANNEL ++#define MXC_DMA_CHANNEL_MMC1 MXC_DMA_DYNAMIC_CHANNEL ++#define MXC_DMA_CHANNEL_SSI1_RX MXC_DMA_DYNAMIC_CHANNEL ++#ifdef CONFIG_SDMA_IRAM ++#define MXC_DMA_CHANNEL_SSI1_TX (MXC_DMA_CHANNEL_IRAM + 1) ++#else ++#define MXC_DMA_CHANNEL_SSI1_TX MXC_DMA_DYNAMIC_CHANNEL ++#endif ++#define MXC_DMA_CHANNEL_SSI2_RX MXC_DMA_DYNAMIC_CHANNEL ++#define MXC_DMA_CHANNEL_SSI2_TX MXC_DMA_DYNAMIC_CHANNEL ++#define MXC_DMA_CHANNEL_CSPI1_RX MXC_DMA_DYNAMIC_CHANNEL ++#define MXC_DMA_CHANNEL_CSPI1_TX MXC_DMA_DYNAMIC_CHANNEL ++#define MXC_DMA_CHANNEL_CSPI2_RX MXC_DMA_DYNAMIC_CHANNEL ++#define MXC_DMA_CHANNEL_CSPI2_TX MXC_DMA_DYNAMIC_CHANNEL ++#define MXC_DMA_CHANNEL_CSPI3_RX MXC_DMA_DYNAMIC_CHANNEL ++#define MXC_DMA_CHANNEL_CSPI3_TX MXC_DMA_DYNAMIC_CHANNEL ++#define MXC_DMA_CHANNEL_ATA_RX MXC_DMA_DYNAMIC_CHANNEL ++#define MXC_DMA_CHANNEL_ATA_TX MXC_DMA_DYNAMIC_CHANNEL ++#define MXC_DMA_CHANNEL_MEMORY MXC_DMA_DYNAMIC_CHANNEL ++#define MXC_DMA_CHANNEL_ESAI_RX MXC_DMA_DYNAMIC_CHANNEL ++#define MXC_DMA_CHANNEL_ESAI_TX MXC_DMA_DYNAMIC_CHANNEL ++ ++/* ++ * AIPS 2 ++ */ ++#define AIPS2_BASE_ADDR UL(0x53F00000) ++#define AIPS2_BASE_ADDR_VIRT VA(0xFC200000) ++#define AIPS2_SIZE SZ_1M ++ ++#define CCM_BASE_ADDR (AIPS2_BASE_ADDR + 0x00080000) ++#define GPT4_BASE_ADDR (AIPS2_BASE_ADDR + 0x00084000) ++#define GPT3_BASE_ADDR (AIPS2_BASE_ADDR + 0x00088000) ++#define GPT2_BASE_ADDR (AIPS2_BASE_ADDR + 0x0008C000) ++#define GPT1_BASE_ADDR (AIPS2_BASE_ADDR + 0x00090000) ++#define EPIT1_BASE_ADDR (AIPS2_BASE_ADDR + 0x00094000) ++#define EPIT2_BASE_ADDR (AIPS2_BASE_ADDR + 0x00098000) ++#define GPIO4_BASE_ADDR (AIPS2_BASE_ADDR + 0x0009C000) ++#define PWM2_BASE_ADDR (AIPS2_BASE_ADDR + 0x000A0000) ++#define GPIO3_BASE_ADDR (AIPS2_BASE_ADDR + 0x000A4000) ++#define PWM3_BASE_ADDR (AIPS2_BASE_ADDR + 0x000A8000) ++#define SCC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000AC000) ++#define RNGD_BASE_ADDR (AIPS2_BASE_ADDR + 0x000B0000) ++#define MMC_SDHC1_BASE_ADDR (AIPS2_BASE_ADDR + 0x000B4000) ++#define MMC_SDHC2_BASE_ADDR (AIPS2_BASE_ADDR + 0x000B8000) ++#define LCDC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000BC000) ++#define SLCDC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000C0000) ++#define PWM4_BASE_ADDR (AIPS2_BASE_ADDR + 0x000C8000) ++#define GPIO1_BASE_ADDR (AIPS2_BASE_ADDR + 0x000CC000) ++#define GPIO2_BASE_ADDR (AIPS2_BASE_ADDR + 0x000D0000) ++#define SDMA_BASE_ADDR (AIPS2_BASE_ADDR + 0x000D4000) ++#define WDOG_BASE_ADDR (AIPS2_BASE_ADDR + 0x000DC000) ++#define PWM1_BASE_ADDR (AIPS2_BASE_ADDR + 0x000E0000) ++#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 CSI_BASE_ADDR (AIPS2_BASE_ADDR + 0x000F8000) ++#define DRYICE_BASE_ADDR (AIPS2_BASE_ADDR + 0x000FC000) ++ ++/* ++ * ROMP and ASIC ++ */ ++#define ROMP_BASE_ADDR UL(0x60000000) ++#define ROMP_BASE_ADDR_VIRT VA(0xFC300000) ++#define ROMP_SIZE SZ_1M ++ ++#define ASIC_BASE_ADDR UL(0x68000000) ++#define ASIC_BASE_ADDR_VIRT VA(0xFC400000) ++#define ASIC_SIZE SZ_1M ++#define AVIC_BASE_ADDR ASIC_BASE_ADDR ++#define AVIC_BASE_ADDR_VIRT ASIC_BASE_ADDR_VIRT ++#define AVIC_SIZE ASIC_SIZE ++ ++/* ++ * SDRAM, WEIM, M3IF, EMI controllers ++ */ ++#define X_MEMC_BASE_ADDR UL(0xB8000000) ++#define X_MEMC_BASE_ADDR_VIRT VA(0xFC520000) ++#define X_MEMC_SIZE SZ_64K ++ ++#define SDRAMC_BASE_ADDR (X_MEMC_BASE_ADDR + 0x1000) ++#define WEIM_BASE_ADDR (X_MEMC_BASE_ADDR + 0x2000) ++#define M3IF_BASE_ADDR (X_MEMC_BASE_ADDR + 0x3000) ++#define EMI_CTL_BASE_ADDR (X_MEMC_BASE_ADDR + 0x4000) ++ ++/* ++ * NFC controller ++ */ ++#define NFC_BASE_ADDR UL(0xBB000000) ++#define NFC_BASE_ADDR_VIRT VA(0xFC530000) ++#define NFC_SIZE SZ_8K ++ ++/* ++ * Memory regions and CS ++ */ ++#define CSD0_BASE_ADDR UL(0x80000000) ++#define CSD1_BASE_ADDR UL(0x90000000) ++ ++#define SDRAM_BASE_ADDR CSD0_BASE_ADDR ++ ++#define CS0_BASE_ADDR UL(0xA0000000) ++#define CS1_BASE_ADDR UL(0xA8000000) ++#define CS2_BASE_ADDR UL(0xB0000000) ++#define CS3_BASE_ADDR UL(0xB2000000) ++#define CS4_BASE_ADDR UL(0xB4000000) ++#define CS4_SIZE SZ_32M ++#define CS5_BASE_ADDR UL(0xB6000000) ++#define CS5_SIZE SZ_32M ++ ++/*! ++ * 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 ++ * and returning the virtual address. If the physical address is not mapped, ++ * it returns 0 ++ */ ++#define IO_ADDRESS(x) \ ++ VA((((x) >= AIPS1_BASE_ADDR) && ((x) < (AIPS1_BASE_ADDR + AIPS1_SIZE))) ? AIPS1_IO_ADDRESS(x): \ ++ (((x) >= SPBA0_BASE_ADDR) && ((x) < (SPBA0_BASE_ADDR + SPBA0_SIZE))) ? SPBA0_IO_ADDRESS(x): \ ++ (((x) >= AIPS2_BASE_ADDR) && ((x) < (AIPS2_BASE_ADDR + AIPS2_SIZE))) ? AIPS2_IO_ADDRESS(x): \ ++ (((x) >= ROMP_BASE_ADDR) && ((x) < (ROMP_BASE_ADDR + ROMP_SIZE))) ? ROMP_IO_ADDRESS(x): \ ++ (((x) >= ASIC_BASE_ADDR) && ((x) < (ASIC_BASE_ADDR + AVIC_SIZE))) ? ASIC_IO_ADDRESS(x): \ ++ (((x) >= IRAM_BASE_ADDR) && ((x) < (IRAM_BASE_ADDR + IRAM_SIZE))) ? IRAM_IO_ADDRESS(x): \ ++ (((x) >= X_MEMC_BASE_ADDR) && ((x) < (X_MEMC_BASE_ADDR + X_MEMC_SIZE))) ? X_MEMC_IO_ADDRESS(x): \ ++ (((x) >= NFC_BASE_ADDR) && ((x) < (NFC_BASE_ADDR + NFC_SIZE))) ? NFC_IO_ADDRESS(x): \ ++ 0) ++ ++#define MXC_VADDR_RANGE(v,n) \ ++ (((v)) >= n##_BASE_ADDR_VIRT) && \ ++ (((v)) < n##_BASE_ADDR_VIRT + n##_SIZE) ? \ ++ ((v)-n##_BASE_ADDR_VIRT + n##_BASE_ADDR) : ++ ++#define MXC_PHYS_ADDRESS(v) \ ++ UL(MXC_VADDR_RANGE(v,AIPS1) \ ++ MXC_VADDR_RANGE(v,AIPS2) \ ++ MXC_VADDR_RANGE(v,SPBA0) \ ++ MXC_VADDR_RANGE(v,ROMP) \ ++ MXC_VADDR_RANGE(v,ASIC) \ ++ MXC_VADDR_RANGE(v,IRAM) \ ++ MXC_VADDR_RANGE(v,X_MEMC) \ ++ MXC_VADDR_RANGE(v,NFC) \ ++ 0) ++ ++#define GPIO_BASE_ADDR(port) \ ++ ((port == 1 ? GPIO1_BASE_ADDR : \ ++ (port == 2 ? GPIO2_BASE_ADDR : \ ++ (port == 3 ? GPIO3_BASE_ADDR : \ ++ (port == 4 ? GPIO4_BASE_ADDR : 0))))) ++ ++/* ++ * define the address mapping macros: in physical address order ++ */ ++ ++#define AIPS1_IO_ADDRESS(x) \ ++ (((x) - AIPS1_BASE_ADDR) + AIPS1_BASE_ADDR_VIRT) ++ ++#define SPBA0_IO_ADDRESS(x) \ ++ (((x) - SPBA0_BASE_ADDR) + SPBA0_BASE_ADDR_VIRT) ++ ++#define AIPS2_IO_ADDRESS(x) \ ++ (((x) - AIPS2_BASE_ADDR) + AIPS2_BASE_ADDR_VIRT) ++ ++#define ROMP_IO_ADDRESS(x) \ ++ (((x) - ROMP_BASE_ADDR) + ROMP_BASE_ADDR_VIRT) ++ ++#define ASIC_IO_ADDRESS(x) \ ++ (((x) - ASIC_BASE_ADDR) + ASIC_BASE_ADDR_VIRT) ++ ++/* for entry-macro.S */ ++#define AVIC_IO_ADDRESS(x) ASIC_IO_ADDRESS(x) ++ ++#define IRAM_IO_ADDRESS(x) \ ++ (((x) - IRAM_BASE_ADDR) + IRAM_BASE_ADDR_VIRT) ++ ++#define X_MEMC_IO_ADDRESS(x) \ ++ (((x) - X_MEMC_BASE_ADDR) + X_MEMC_BASE_ADDR_VIRT) ++ ++#define NFC_IO_ADDRESS(x) \ ++ (((x) - NFC_BASE_ADDR) + NFC_BASE_ADDR_VIRT) ++ ++/* ++ * DMA request assignments ++ */ ++#define DMA_REQ_EXTREQ0 0 ++#define DMA_REQ_CCM 1 ++#define DMA_REQ_ATA_TX_END 2 ++#define DMA_REQ_ATA_TX 3 ++#define DMA_REQ_ATA_RX 4 ++#define DMA_REQ_CSPI2_RX 6 ++#define DMA_REQ_CSPI2_TX 7 ++#define DMA_REQ_CSPI1_RX 8 ++#define DMA_REQ_CSPI1_TX 9 ++#define DMA_REQ_UART3_RX 10 ++#define DMA_REQ_UART3_TX 11 ++#define DMA_REQ_UART4_RX 12 ++#define DMA_REQ_UART4_TX 13 ++#define DMA_REQ_EXTREQ1 14 ++#define DMA_REQ_EXTREQ2 15 ++#define DMA_REQ_UART2_RX 16 ++#define DMA_REQ_UART2_TX 17 ++#define DMA_REQ_UART1_RX 18 ++#define DMA_REQ_UART1_TX 19 ++#define DMA_REQ_SSI2_RX1 22 ++#define DMA_REQ_SSI2_TX1 23 ++#define DMA_REQ_SSI2_RX0 24 ++#define DMA_REQ_SSI2_TX0 25 ++#define DMA_REQ_SSI1_RX1 26 ++#define DMA_REQ_SSI1_TX1 27 ++#define DMA_REQ_SSI1_RX0 28 ++#define DMA_REQ_SSI1_TX0 29 ++#define DMA_REQ_NFC 30 ++#define DMA_REQ_ECT 31 ++#define DMA_REQ_ESAI_RX 32 ++#define DMA_REQ_ESAI_TX 33 ++#define DMA_REQ_CSPI3_RX 34 ++#define DMA_REQ_CSPI3_TX 35 ++#define DMA_REQ_SIM2_RX 36 ++#define DMA_REQ_SIM2_TX 37 ++#define DMA_REQ_SIM1_RX 38 ++#define DMA_REQ_SIM1_TX 39 ++#define DMA_REQ_TSC_GCQ 44 ++#define DMA_REQ_TSC_TCQ 45 ++#define DMA_REQ_UART5_RX 46 ++#define DMA_REQ_UART5_TX 47 ++ ++/* ++ * Interrupt numbers ++ */ ++#define MXC_INT_CSPI3 0 ++#define MXC_INT_GPT4 1 ++#define MXC_INT_OWIRE 2 ++#define MXC_INT_I2C 3 ++#define MXC_INT_I2C2 4 ++#define MXC_INT_UART4 5 ++#define MXC_INT_RTIC 6 ++#define MXC_INT_ESAI 7 ++#define MXC_INT_SDHC2 8 ++#define MXC_INT_SDHC1 9 ++#define MXC_INT_I2C3 10 ++#define MXC_INT_SSI2 11 ++#define MXC_INT_SSI1 12 ++#define MXC_INT_CSPI2 13 ++#define MXC_INT_CSPI1 14 ++#define MXC_INT_ATA 15 ++#define MXC_INT_GPIO3 16 ++#define MXC_INT_CSI 17 ++#define MXC_INT_UART3 18 ++#define MXC_INT_IIM 19 ++#define MXC_INT_SIM1 20 ++#define MXC_INT_SIM2 21 ++#define MXC_INT_RNGD 22 ++#define MXC_INT_GPIO4 23 ++#define MXC_INT_KPP 24 ++#define MXC_INT_DRYICE_RTC 25 ++#define MXC_INT_PWM 26 ++#define MXC_INT_EPIT2 27 ++#define MXC_INT_EPIT1 28 ++#define MXC_INT_GPT3 29 ++#define MXC_INT_POWER_FAIL 30 ++#define MXC_INT_CRM 31 ++#define MXC_INT_UART2 32 ++#define MXC_INT_NANDFC 33 ++#define MXC_INT_SDMA 34 ++#define MXC_INT_USB_HTG 35 ++#define MXC_INT_PWM2 36 ++#define MXC_INT_USB_OTG 37 ++#define MXC_INT_SLCDC 38 ++#define MXC_INT_LCDC 39 ++#define MXC_INT_UART5 40 ++#define MXC_INT_PWM3 41 ++#define MXC_INT_PWM4 42 ++#define MXC_INT_CAN1 43 ++#define MXC_INT_CAN2 44 ++#define MXC_INT_UART1 45 ++#define MXC_INT_TSC 46 ++#define MXC_INT_ECT 48 ++#define MXC_INT_SCC_SCM 49 ++#define MXC_INT_SCC_SMN 50 ++#define MXC_INT_GPIO2 51 ++#define MXC_INT_GPIO1 52 ++#define MXC_INT_GPT2 53 ++#define MXC_INT_GPT1 54 ++#define MXC_INT_WDOG 55 ++#define MXC_INT_DRYICE 56 ++#define MXC_INT_FEC 57 ++#define MXC_INT_EXT_INT5 58 ++#define MXC_INT_EXT_INT4 59 ++#define MXC_INT_EXT_INT3 60 ++#define MXC_INT_EXT_INT2 61 ++#define MXC_INT_EXT_INT1 62 ++#define MXC_INT_EXT_INT0 63 ++ ++#define MXC_INT_GPT MXC_INT_GPT1 ++ ++/* silicon revisions specific to i.MX25 */ ++#define CHIP_REV_1_0 0x00 ++#define CHIP_REV_1_1 0x01 ++ ++/* gpio and gpio based interrupt handling */ ++#define GPIO_DR 0x00 ++#define GPIO_GDIR 0x04 ++#define GPIO_PSR 0x08 ++#define GPIO_ICR1 0x0C ++#define GPIO_ICR2 0x10 ++#define GPIO_IMR 0x14 ++#define GPIO_ISR 0x18 ++#define GPIO_INT_LOW_LEV 0x0 ++#define GPIO_INT_HIGH_LEV 0x1 ++#define GPIO_INT_RISE_EDGE 0x2 ++#define GPIO_INT_FALL_EDGE 0x3 ++#define GPIO_INT_NONE 0x4 ++ ++/* Mandatory defines used globally */ ++ ++/* this CPU supports up to 96 GPIOs */ ++#define ARCH_NR_GPIOS 128 ++ ++#define MXC_TIMER_GPT1 1 ++#define MXC_TIMER_GPT2 2 ++#define MXC_TIMER_GPT3 3 ++#define MXC_TIMER_GPT4 4 ++ ++/*! ++ * NFMS bit in RCSR register for pagesize of nandflash ++ */ ++#define NFMS_REG IO_ADDRESS(CCM_BASE_ADDR + 0x28) ++#define NFMS_NF_DWIDTH 14 ++#define NFMS_NF_PG_SZ 8 ++ ++#if !defined(__ASSEMBLY__) && !defined(__MXC_BOOT_UNCOMPRESS) ++#include ++ ++extern int mx25_revision(void); ++ ++#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 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 + * and returning the virtual address. If the physical address is not mapped, +- * it returns 0xDEADBEEF ++ * it returns 0 + */ + #define IO_ADDRESS(x) \ + (void __force __iomem *) \ +@@ -88,7 +88,7 @@ + ((x >= SAHB1_BASE_ADDR) && (x < (SAHB1_BASE_ADDR + SAHB1_SIZE))) ? \ + SAHB1_IO_ADDRESS(x) : \ + ((x >= X_MEMC_BASE_ADDR) && (x < (X_MEMC_BASE_ADDR + X_MEMC_SIZE))) ? \ +- X_MEMC_IO_ADDRESS(x) : 0xDEADBEEF) ++ X_MEMC_IO_ADDRESS(x) : 0) + + /* 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 18:02:12.000000000 +0200 +@@ -27,6 +27,7 @@ + #define MXC_CPU_MX1 1 + #define MXC_CPU_MX21 21 + #define MXC_CPU_MX27 27 ++#define MXC_CPU_MX25 25 + #define MXC_CPU_MX31 31 + #define MXC_CPU_MX35 35 + +@@ -70,6 +71,18 @@ extern unsigned int __mxc_cpu_type; + # define cpu_is_mx27() (0) + #endif + ++#ifdef CONFIG_MACH_MX25 ++# ifdef mxc_cpu_type ++# undef mxc_cpu_type ++# define mxc_cpu_type __mxc_cpu_type ++# else ++# define mxc_cpu_type MXC_CPU_MX25 ++# endif ++# define cpu_is_mx25() (mxc_cpu_type == MXC_CPU_MX25) ++#else ++# define cpu_is_mx25() (0) ++#endif ++ + #ifdef CONFIG_ARCH_MX31 + # ifdef mxc_cpu_type + # undef mxc_cpu_type +@@ -101,6 +114,6 @@ extern unsigned int __mxc_cpu_type; + #endif + + #define cpu_is_mx3() (cpu_is_mx31() || cpu_is_mx35()) +-#define cpu_is_mx2() (cpu_is_mx21() || cpu_is_mx27()) ++#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 18:02:13.000000000 +0200 +@@ -0,0 +1,504 @@ ++ ++/* ++ * Copyright 2004-2008 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_SDMA_H__ ++#define __ASM_ARCH_MXC_SDMA_H__ ++ ++/*! ++ * @defgroup SDMA Smart Direct Memory Access (SDMA) Driver ++ */ ++ ++/*! ++ * @file arch-mxc/sdma.h ++ * ++ * @brief This file contains the SDMA API declarations. ++ * ++ * SDMA is responsible on moving data between peripherals and memories (MCU, EMI and DSP). ++ * ++ * @ingroup SDMA ++ */ ++ ++#include ++#include ++#include ++#include ++ ++/*! ++ * This defines maximum DMA address ++ */ ++#define MAX_DMA_ADDRESS 0xffffffff ++ ++/*! ++ * This defines maximum number of DMA channels ++ */ ++#ifdef CONFIG_MXC_SDMA_API ++#define MAX_DMA_CHANNELS 32 ++#define MAX_BD_NUMBER 16 ++#define MXC_SDMA_DEFAULT_PRIORITY 1 ++#define MXC_SDMA_MIN_PRIORITY 1 ++#define MXC_SDMA_MAX_PRIORITY 7 ++#else ++#define MAX_DMA_CHANNELS 0 ++#endif ++ ++#define MXC_FIFO_MEM_DEST_FIXED 0x1 ++#define MXC_FIFO_MEM_SRC_FIXED 0x2 ++/*! ++ * This enumerates transfer types ++ */ ++typedef enum { ++ emi_2_per = 0, /*!< EMI memory to peripheral */ ++ emi_2_int, /*!< EMI memory to internal RAM */ ++ emi_2_emi, /*!< EMI memory to EMI memory */ ++ emi_2_dsp, /*!< EMI memory to DSP memory */ ++ per_2_int, /*!< Peripheral to internal RAM */ ++ per_2_emi, /*!< Peripheral to internal EMI memory */ ++ per_2_dsp, /*!< Peripheral to DSP memory */ ++ per_2_per, /*!< Peripheral to Peripheral */ ++ int_2_per, /*!< Internal RAM to peripheral */ ++ int_2_int, /*!< Internal RAM to Internal RAM */ ++ int_2_emi, /*!< Internal RAM to EMI memory */ ++ int_2_dsp, /*!< Internal RAM to DSP memory */ ++ dsp_2_per, /*!< DSP memory to peripheral */ ++ dsp_2_int, /*!< DSP memory to internal RAM */ ++ dsp_2_emi, /*!< DSP memory to EMI memory */ ++ dsp_2_dsp, /*!< DSP memory to DSP memory */ ++ emi_2_dsp_loop, /*!< EMI memory to DSP memory loopback */ ++ dsp_2_emi_loop, /*!< DSP memory to EMI memory loopback */ ++ dvfs_pll, /*!< DVFS script with PLL change */ ++ dvfs_pdr /*!< DVFS script without PLL change */ ++} sdma_transferT; ++ ++/*! ++ * This enumerates peripheral types ++ */ ++typedef enum { ++ SSI, /*!< MCU domain SSI */ ++ SSI_SP, /*!< Shared SSI */ ++ MMC, /*!< MMC */ ++ SDHC, /*!< SDHC */ ++ UART, /*!< MCU domain UART */ ++ UART_SP, /*!< Shared UART */ ++ FIRI, /*!< FIRI */ ++ CSPI, /*!< MCU domain CSPI */ ++ CSPI_SP, /*!< Shared CSPI */ ++ SIM, /*!< SIM */ ++ ATA, /*!< ATA */ ++ CCM, /*!< CCM */ ++ EXT, /*!< External peripheral */ ++ MSHC, /*!< Memory Stick Host Controller */ ++ MSHC_SP, /*!< Shared Memory Stick Host Controller */ ++ DSP, /*!< DSP */ ++ MEMORY, /*!< Memory */ ++ FIFO_MEMORY, /*!< FIFO type Memory */ ++ SPDIF, /*!< SPDIF */ ++ IPU_MEMORY, /*!< IPU Memory */ ++ ASRC, /*!< ASRC */ ++ ESAI, /*!< ESAI */ ++} sdma_periphT; ++ ++#ifndef TRANSFER_32BIT ++/*! ++ * This defines SDMA access data size ++ */ ++#define TRANSFER_32BIT 0x00 ++#define TRANSFER_8BIT 0x01 ++#define TRANSFER_16BIT 0x02 ++#define TRANSFER_24BIT 0x03 ++ ++#endif ++ ++/*! ++ * This defines maximum device name length passed during mxc_request_dma(). ++ */ ++#define MAX_DEVNAME_LENGTH 32 ++ ++/*! ++ * This defines SDMA interrupt callback function prototype. ++ */ ++typedef void (*dma_callback_t) (void *arg); ++ ++/*! ++ * Structure containing sdma channel parameters. ++ */ ++typedef struct { ++ __u32 watermark_level; /*!< Lower/upper threshold that ++ * triggers SDMA event ++ */ ++ __u32 per_address; /*!< Peripheral source/destination ++ * physical address ++ */ ++ sdma_periphT peripheral_type; /*!< Peripheral type */ ++ sdma_transferT transfer_type; /*!< Transfer type */ ++ int event_id; /*!< Event number, ++ * needed by all channels ++ * that started by peripherals dma ++ * request (per_2_*,*_2_per) ++ * Not used for memory and DSP ++ * transfers. ++ */ ++ int event_id2; /*!< Second event number, ++ * used in ATA scripts only. ++ */ ++ int bd_number; /*!< Buffer descriptors number. ++ * If not set, single buffer ++ * descriptor will be used. ++ */ ++ dma_callback_t callback; /*! callback function */ ++ void *arg; /*! callback argument */ ++ unsigned long word_size:8; /*!< SDMA data access word size */ ++} dma_channel_params; ++ ++/*! ++ * Structure containing sdma request parameters. ++ */ ++typedef struct { ++ /*! physical source memory address */ ++ __u8 *sourceAddr; ++ /*! physical destination memory address */ ++ __u8 *destAddr; ++ /*! amount of data to transfer, ++ * updated during mxc_dma_get_config ++ */ ++ __u16 count; ++ /*!< DONE bit of the buffer descriptor, ++ * updated during mxc_dma_get_config ++ * 0 - means the BD is done and closed by SDMA ++ * 1 - means the BD is still being processed by SDMA ++ */ ++ int bd_done; ++ /*!< CONT bit of the buffer descriptor, ++ * set it if full multi-buffer descriptor mechanism ++ * required. ++ */ ++ int bd_cont; ++ /*!< ERROR bit of the buffer descriptor, ++ * updated during mxc_dma_get_config. ++ * If it is set - there was an error during BD processing. ++ */ ++ int bd_error; ++} dma_request_t; ++ ++/*! ++ * Structure containing sdma request parameters. ++ */ ++typedef struct { ++ /*! address of ap_2_ap script */ ++ int mxc_sdma_ap_2_ap_addr; ++ /*! address of ap_2_bp script */ ++ int mxc_sdma_ap_2_bp_addr; ++ /*! address of ap_2_ap_fixed script */ ++ int mxc_sdma_ap_2_ap_fixed_addr; ++ /*! address of bp_2_ap script */ ++ int mxc_sdma_bp_2_ap_addr; ++ /*! address of loopback_on_dsp_side script */ ++ int mxc_sdma_loopback_on_dsp_side_addr; ++ /*! address of mcu_interrupt_only script */ ++ int mxc_sdma_mcu_interrupt_only_addr; ++ ++ /*! address of firi_2_per script */ ++ int mxc_sdma_firi_2_per_addr; ++ /*! address of firi_2_mcu script */ ++ int mxc_sdma_firi_2_mcu_addr; ++ /*! address of per_2_firi script */ ++ int mxc_sdma_per_2_firi_addr; ++ /*! address of mcu_2_firi script */ ++ int mxc_sdma_mcu_2_firi_addr; ++ ++ /*! address of uart_2_per script */ ++ int mxc_sdma_uart_2_per_addr; ++ /*! address of uart_2_mcu script */ ++ int mxc_sdma_uart_2_mcu_addr; ++ /*! address of per_2_app script */ ++ int mxc_sdma_per_2_app_addr; ++ /*! address of mcu_2_app script */ ++ int mxc_sdma_mcu_2_app_addr; ++ /*! address of per_2_per script */ ++ int mxc_sdma_per_2_per_addr; ++ ++ /*! address of uartsh_2_per script */ ++ int mxc_sdma_uartsh_2_per_addr; ++ /*! address of uartsh_2_mcu script */ ++ int mxc_sdma_uartsh_2_mcu_addr; ++ /*! address of per_2_shp script */ ++ int mxc_sdma_per_2_shp_addr; ++ /*! address of mcu_2_shp script */ ++ int mxc_sdma_mcu_2_shp_addr; ++ ++ /*! address of ata_2_mcu script */ ++ int mxc_sdma_ata_2_mcu_addr; ++ /*! address of mcu_2_ata script */ ++ int mxc_sdma_mcu_2_ata_addr; ++ ++ /*! address of app_2_per script */ ++ int mxc_sdma_app_2_per_addr; ++ /*! address of app_2_mcu script */ ++ int mxc_sdma_app_2_mcu_addr; ++ /*! address of shp_2_per script */ ++ int mxc_sdma_shp_2_per_addr; ++ /*! address of shp_2_mcu script */ ++ int mxc_sdma_shp_2_mcu_addr; ++ ++ /*! address of mshc_2_mcu script */ ++ int mxc_sdma_mshc_2_mcu_addr; ++ /*! address of mcu_2_mshc script */ ++ int mxc_sdma_mcu_2_mshc_addr; ++ ++ /*! address of spdif_2_mcu script */ ++ int mxc_sdma_spdif_2_mcu_addr; ++ /*! address of mcu_2_spdif script */ ++ int mxc_sdma_mcu_2_spdif_addr; ++ ++ /*! address of asrc_2_mcu script */ ++ int mxc_sdma_asrc_2_mcu_addr; ++ ++ /*! address of ext_mem_2_ipu script */ ++ int mxc_sdma_ext_mem_2_ipu_addr; ++ ++ /*! address of descrambler script */ ++ int mxc_sdma_descrambler_addr; ++ ++ /*! address of dptc_dvfs script */ ++ int mxc_sdma_dptc_dvfs_addr; ++ ++ int mxc_sdma_utra_addr; ++ ++ /*! address where ram code starts */ ++ int mxc_sdma_ram_code_start_addr; ++ /*! size of the ram code */ ++ int mxc_sdma_ram_code_size; ++ /*! RAM image address */ ++ unsigned short *mxc_sdma_start_addr; ++} sdma_script_start_addrs; ++ ++/*! Structure to store the initialized dma_channel parameters */ ++typedef struct mxc_sdma_channel_params { ++ /*! Channel params */ ++ dma_channel_params chnl_params; ++ /*! Channel type (static channel number or dynamic channel) */ ++ unsigned int channel_num; ++ /*! Channel priority [0x1(lowest) - 0x7(highest)] */ ++ unsigned int chnl_priority; ++} mxc_sdma_channel_params_t; ++ ++/*! Private SDMA data structure */ ++typedef struct mxc_dma_channel_private { ++ /*! ID of the buffer that was processed */ ++ unsigned int buf_tail; ++ /*! Tasklet for the channel */ ++ struct tasklet_struct chnl_tasklet; ++ /*! Flag indicates if interrupt is required after every BD transfer */ ++ int intr_after_every_bd; ++} mxc_dma_channel_private_t; ++ ++/*! ++ * Setup channel according to parameters. ++ * Must be called once after mxc_request_dma() ++ * ++ * @param channel channel number ++ * @param p channel parameters pointer ++ * @return 0 on success, error code on fail ++ */ ++int mxc_dma_setup_channel(int channel, dma_channel_params * p); ++ ++/*! ++ * Setup the channel priority. This can be used to change the default priority ++ * for the channel. ++ * ++ * @param channel channel number ++ * @param priority priority to be set for the channel ++ * ++ * @return 0 on success, error code on failure ++ */ ++int mxc_dma_set_channel_priority(unsigned int channel, unsigned int priority); ++ ++/*! ++ * Allocates dma channel. ++ * If channel's value is 0, then the function allocates a free channel ++ * dynamically and sets its value to channel. ++ * Else allocates requested channel if it is free. ++ * If the channel is busy or no free channels (in dynamic allocation) -EBUSY returned. ++ * ++ * @param channel pointer to channel number ++ * @param devicename device name ++ * @return 0 on success, error code on fail ++ */ ++int mxc_request_dma(int *channel, const char *devicename); ++ ++/*! ++ * Configures request parameters. Can be called multiple times after ++ * mxc_request_dma() and mxc_dma_setup_channel(). ++ * ++ * ++ * @param channel channel number ++ * @param p request parameters pointer ++ * @param bd_index index of buffer descriptor to set ++ * @return 0 on success, error code on fail ++ */ ++/* int mxc_dma_set_config(int channel, dma_request_t *p, int bd_index); */ ++int mxc_dma_set_config(int channel, dma_request_t * p, int bd_index); ++ ++/*! ++ * Returns request parameters. ++ * ++ * @param channel channel number ++ * @param p request parameters pointer ++ * @param bd_index index of buffer descriptor to get ++ * @return 0 on success, error code on fail ++ */ ++/* int mxc_dma_get_config(int channel, dma_request_t *p, int bd_index); */ ++int mxc_dma_get_config(int channel, dma_request_t * p, int bd_index); ++ ++/*! ++ * This function is used by MXC IPC's write_ex2. It passes the a pointer to the ++ * data control structure to iapi_write_ipcv2() ++ * ++ * @param channel SDMA channel number ++ * @param ctrl_ptr Data Control structure pointer ++ */ ++int mxc_sdma_write_ipcv2(int channel, void *ctrl_ptr); ++ ++/*! ++ * This function is used by MXC IPC's read_ex2. It passes the a pointer to the ++ * data control structure to iapi_read_ipcv2() ++ * ++ * @param channel SDMA channel number ++ * @param ctrl_ptr Data Control structure pointer ++ */ ++int mxc_sdma_read_ipcv2(int channel, void *ctrl_ptr); ++ ++/*! ++ * Starts dma channel. ++ * ++ * @param channel channel number ++ */ ++int mxc_dma_start(int channel); ++ ++/*! ++ * Stops dma channel. ++ * ++ * @param channel channel number ++ */ ++int mxc_dma_stop(int channel); ++ ++/*! ++ * Frees dma channel. ++ * ++ * @param channel channel number ++ */ ++void mxc_free_dma(int channel); ++ ++/*! ++ * Sets callback function. Used with standard dma api ++ * for supporting interrupts ++ * ++ * @param channel channel number ++ * @param callback callback function pointer ++ * @param arg argument for callback function ++ */ ++void mxc_dma_set_callback(int channel, dma_callback_t callback, void *arg); ++ ++/*! ++ * Allocates uncachable buffer. Uses hash table. ++ * ++ * @param size size of allocated buffer ++ * @return pointer to buffer ++ */ ++void *sdma_malloc(size_t size); ++ ++#ifdef CONFIG_SDMA_IRAM ++/*! ++ * Allocates uncachable buffer from IRAM.. ++ * ++ * @param size size of allocated buffer ++ * @return pointer to buffer ++ */ ++void *sdma_iram_malloc(size_t size); ++#endif /*CONFIG_SDMA_IRAM */ ++ ++/*! ++ * Frees uncachable buffer. Uses hash table. ++ */ ++void sdma_free(void *buf); ++ ++/*! ++ * Converts virtual to physical address. Uses hash table. ++ * ++ * @param buf virtual address pointer ++ * @return physical address value ++ */ ++unsigned long sdma_virt_to_phys(void *buf); ++ ++/*! ++ * Converts physical to virtual address. Uses hash table. ++ * ++ * @param buf physical address value ++ * @return virtual address pointer ++ */ ++void *sdma_phys_to_virt(unsigned long buf); ++ ++/*! ++ * Configures the BD_INTR bit on a buffer descriptor parameters. ++ * ++ * ++ * @param channel channel number ++ * @param bd_index index of buffer descriptor to set ++ * @param bd_intr flag to set or clear the BD_INTR bit ++ */ ++void mxc_dma_set_bd_intr(int channel, int bd_index, int bd_intr); ++ ++/*! ++ * Gets the BD_INTR bit on a buffer descriptor. ++ * ++ * ++ * @param channel channel number ++ * @param bd_index index of buffer descriptor to set ++ * ++ * @return returns the BD_INTR bit status ++ */ ++int mxc_dma_get_bd_intr(int channel, int bd_index); ++ ++/*! ++ * Stop the current transfer ++ * ++ * @param channel channel number ++ * @param buffer_number number of buffers (beginning with 0), ++ * whose done bits should be reset to 0 ++ */ ++int mxc_dma_reset(int channel, int buffer_number); ++ ++/*! ++ * This functions Returns the SDMA paramaters associated for a module ++ * ++ * @param channel_id the ID of the module requesting DMA ++ * @return returns the sdma parameters structure for the device ++ */ ++mxc_sdma_channel_params_t *mxc_sdma_get_channel_params(mxc_dma_device_t ++ channel_id); ++ ++/*! ++ * This functions marks the SDMA channels that are statically allocated ++ * ++ * @param chnl the channel array used to store channel information ++ */ ++void mxc_get_static_channels(mxc_dma_channel_t * chnl); ++ ++/*! ++ * Initializes SDMA driver ++ */ ++int __init sdma_init(void); ++ ++#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 18:02:13.000000000 +0200 +@@ -0,0 +1,66 @@ ++ ++/* ++ * Copyright 2004-2008 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 ++ */ ++ ++/*! ++ * @defgroup SPBA Shared Peripheral Bus Arbiter (SPBA) ++ * @ingroup MSL_MX31 MSL_MX35 MSL_MX37 MSL_MX51 MSL_MXC91321 ++ */ ++ ++/*! ++ * @file arch-mxc/spba.h ++ * @brief This file contains the Shared Peripheral Bus Arbiter (spba) API. ++ * ++ * @ingroup SPBA ++ */ ++ ++#ifndef __ASM_ARCH_MXC_SPBA_H__ ++#define __ASM_ARCH_MXC_SPBA_H__ ++ ++#ifdef __KERNEL__ ++ ++#define MXC_SPBA_RAR_MASK 0x7 ++ ++/*! ++ * Defines three SPBA masters: A - ARM, C - SDMA (no master B for MX31) ++ */ ++enum spba_masters { ++ SPBA_MASTER_A = 1, ++ SPBA_MASTER_B = 2, ++ SPBA_MASTER_C = 4, ++}; ++ ++/*! ++ * This function allows the three masters (A, B, C) to take ownership of a ++ * shared peripheral. ++ * ++ * @param mod specified module as defined in \b enum \b #spba_module ++ * @param master one of more (or-ed together) masters as defined in \b enum \b #spba_masters ++ * ++ * @return 0 if successful; -1 otherwise. ++ */ ++int spba_take_ownership(int mod, int master); ++ ++/*! ++ * This function releases the ownership for a shared peripheral. ++ * ++ * @param mod specified module as defined in \b enum \b #spba_module ++ * @param master one of more (or-ed together) masters as defined in \b enum \b #spba_masters ++ * ++ * @return 0 if successful; -1 otherwise. ++ */ ++int spba_rel_ownership(int mod, int master); ++ ++#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 18:02:12.000000000 +0200 +@@ -23,7 +23,11 @@ + #if defined CONFIG_ARCH_MX1 + #define CLOCK_TICK_RATE 16000000 + #elif defined CONFIG_ARCH_MX2 ++#ifndef CONFIG_MACH_MX25 + #define CLOCK_TICK_RATE 13300000 ++#else ++#define CLOCK_TICK_RATE 12000000 ++#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 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)); + + if (pin < 16) { ++#ifndef CONFIG_MACH_MX25 + tmp = __raw_readl(VA_GPIO_BASE + MXC_OCR1(port)); + tmp &= ~(3 << (pin * 2)); + tmp |= (ocr << (pin * 2)); + __raw_writel(tmp, VA_GPIO_BASE + MXC_OCR1(port)); +- ++#endif + tmp = __raw_readl(VA_GPIO_BASE + MXC_ICONFA1(port)); + tmp &= ~(3 << (pin * 2)); + tmp |= ((gpio_mode >> GPIO_AOUT_SHIFT) & 3) << (pin * 2); +@@ -90,12 +91,12 @@ void mxc_gpio_mode(int gpio_mode) + __raw_writel(tmp, VA_GPIO_BASE + MXC_ICONFB1(port)); + } else { + pin -= 16; +- ++#ifndef CONFIG_MACH_MX25 + tmp = __raw_readl(VA_GPIO_BASE + MXC_OCR2(port)); + tmp &= ~(3 << (pin * 2)); + tmp |= (ocr << (pin * 2)); + __raw_writel(tmp, VA_GPIO_BASE + MXC_OCR2(port)); +- ++#endif + 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 18:02:02.000000000 +0200 +@@ -31,7 +31,24 @@ + + #define IOMUX_BASE IO_ADDRESS(IOMUXC_BASE_ADDR) + +-static unsigned long iomux_v3_pad_alloc_map[0x200 / BITS_PER_LONG]; ++#ifdef CONFIG_MACH_MX25 ++#define NUM_PADS 0x228 ++#else ++#define NUM_PADS 0x200 ++#endif ++ ++static unsigned long iomux_v3_pad_alloc_map[NUM_PADS / BITS_PER_LONG]; ++ ++static inline int mxc_iomux_v3_pad_offset(struct pad_desc *pad) ++{ ++ int pad_ofs; ++ if (cpu_is_mx25()) ++ pad_ofs = pad->mux_ctrl_ofs; ++ else ++ pad_ofs = pad->pad_ctrl_ofs; ++ BUG_ON((pad_ofs >> 7) >= ARRAY_SIZE(iomux_v3_pad_alloc_map)); ++ return pad_ofs; ++} + + /* + * setups a single pin: +@@ -40,7 +57,7 @@ static unsigned long iomux_v3_pad_alloc_ + */ + int mxc_iomux_v3_setup_pad(struct pad_desc *pad) + { +- unsigned int pad_ofs = pad->pad_ctrl_ofs; ++ unsigned int pad_ofs = mxc_iomux_v3_pad_offset(pad); + + if (test_and_set_bit(pad_ofs >> 2, iomux_v3_pad_alloc_map)) + return -EBUSY; +@@ -65,8 +82,10 @@ int mxc_iomux_v3_setup_multiple_pads(str + + for (i = 0; i < count; i++) { + ret = mxc_iomux_v3_setup_pad(p); +- if (ret) ++ if (ret) { ++ printk(KERN_ERR "Failed to setup PAD[%d]: %d\n", i, ret); + goto setup_error; ++ } + p++; + } + return 0; +@@ -79,7 +98,7 @@ EXPORT_SYMBOL(mxc_iomux_v3_setup_multipl + + void mxc_iomux_v3_release_pad(struct pad_desc *pad) + { +- unsigned int pad_ofs = pad->pad_ctrl_ofs; ++ unsigned int pad_ofs = mxc_iomux_v3_pad_offset(pad); + + 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 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; + +- if (cpu_is_mx27() || cpu_is_mx3()) { ++ if (cpu_is_mx27() || cpu_is_mx3() || cpu_is_mx25()) { + 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 18:02:03.000000000 +0200 +@@ -0,0 +1,143 @@ ++/* ++ * Copyright 2004-2008 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 ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++/*! ++ * @file plat-mxc/spba.c ++ * ++ * @brief This file contains the SPBA API implementation details. ++ * ++ * @ingroup SPBA ++ */ ++ ++static DEFINE_SPINLOCK(spba_lock); ++ ++#define SPBA_MASTER_MIN 1 ++#define SPBA_MASTER_MAX 7 ++ ++/*! ++ * the base addresses for the SPBA modules ++ */ ++static unsigned long spba_base = (unsigned long)IO_ADDRESS(SPBA_CTRL_BASE_ADDR); ++ ++/*! ++ * SPBA clock ++ */ ++static struct clk *spba_clk; ++/*! ++ * This function allows the three masters (A, B, C) to take ownership of a ++ * shared peripheral. ++ * ++ * @param mod specified module as defined in \b enum \b #spba_module ++ * @param master one of more (or-ed together) masters as defined in \b enum \b #spba_masters ++ * ++ * @return 0 if successful; a negative errno value otherwise. ++ */ ++int spba_take_ownership(int mod, int master) ++{ ++ unsigned long spba_flags; ++ int rtn_val = -EIO; ++ ++ if (master < SPBA_MASTER_MIN || master > SPBA_MASTER_MAX) { ++ printk("%s() invalid master %d\n", __FUNCTION__, master); ++ return -EINVAL; ++ } ++ ++ if (spba_clk == NULL) { ++ spba_clk = clk_get(NULL, "spba"); ++ if (IS_ERR(spba_clk)) { ++ int ret = PTR_ERR(spba_clk); ++ ++ spba_clk = NULL; ++ return ret; ++ } ++ } ++ clk_enable(spba_clk); ++ ++ spin_lock_irqsave(&spba_lock, spba_flags); ++ __raw_writel(master, spba_base + mod); ++ ++ if ((__raw_readl(spba_base + mod) & MXC_SPBA_RAR_MASK) == master) { ++ rtn_val = 0; ++ } ++ ++ spin_unlock_irqrestore(&spba_lock, spba_flags); ++ ++ clk_disable(spba_clk); ++ return rtn_val; ++} ++ ++/*! ++ * This function releases the ownership for a shared peripheral. ++ * ++ * @param mod specified module as defined in \b enum \b #spba_module ++ * @param master one of more (or-ed together) masters as defined in \b enum \b #spba_masters ++ * ++ * @return 0 if successful; a negativ errno value otherwise. ++ */ ++int spba_rel_ownership(int mod, int master) ++{ ++ unsigned long spba_flags; ++ volatile unsigned long rar; ++ ++ if (master < SPBA_MASTER_MIN || master > SPBA_MASTER_MAX) { ++ printk("%s() invalid master %d\n", __FUNCTION__, master); ++ return -EINVAL; ++ } ++ ++ if (spba_clk == NULL) { ++ spba_clk = clk_get(NULL, "spba"); ++ if (IS_ERR(spba_clk)) { ++ int ret = PTR_ERR(spba_clk); ++ spba_clk = NULL; ++ return ret; ++ } ++ } ++ clk_enable(spba_clk); ++ ++ if ((__raw_readl(spba_base + mod) & master) == 0) { ++ clk_disable(spba_clk); ++ return -EBUSY; /* does not own it */ ++ } ++ ++ spin_lock_irqsave(&spba_lock, spba_flags); ++ ++ /* Since only the last 3 bits are writeable, doesn't need to mask off ++ bits 31-3 */ ++ rar = __raw_readl(spba_base + mod) & (~master); ++ __raw_writel(rar, spba_base + mod); ++ ++ if ((__raw_readl(spba_base + mod) & master) != 0) { ++ spin_unlock_irqrestore(&spba_lock, spba_flags); ++ clk_disable(spba_clk); ++ return -EIO; ++ } ++ spin_unlock_irqrestore(&spba_lock, spba_flags); ++ ++ clk_disable(spba_clk); ++ return 0; ++} ++ ++EXPORT_SYMBOL(spba_take_ownership); ++EXPORT_SYMBOL(spba_rel_ownership); ++ ++MODULE_AUTHOR("Freescale Semiconductor, Inc."); ++MODULE_DESCRIPTION("SPBA"); ++MODULE_LICENSE("GPL"); +diff -urNp linux-2.6.30-rc4/arch/arm/plat-mxc/system.c linux-2.6.30-rc4-karo/arch/arm/plat-mxc/system.c +--- linux-2.6.30-rc4/arch/arm/plat-mxc/system.c 2009-05-13 09:46:19.000000000 +0200 ++++ linux-2.6.30-rc4-karo/arch/arm/plat-mxc/system.c 2009-06-08 12:48:23.000000000 +0200 +@@ -21,6 +21,7 @@ + */ + + #include ++#include + #include + #include + #include +@@ -38,18 +39,15 @@ + #define WDOG_WCR_ENABLE (1 << 2) + #endif + ++static struct clk *mxc_wdt_clk; ++ + /* + * Reset the system. It is called by machine_restart(). + */ + 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); +- } ++ if (mxc_wdt_clk) ++ clk_enable(mxc_wdt_clk); + + /* Assert SRS signal */ + __raw_writew(WDOG_WCR_ENABLE, WDOG_WCR_REG); +@@ -65,3 +63,20 @@ 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) ++{ ++ if (cpu_is_mx1()) ++ return 0; ++ ++ mxc_wdt_clk = clk_get_sys("imx-wdt.0", NULL); ++ if (IS_ERR(mxc_wdt_clk)) { ++ int ret = PTR_ERR(mxc_wdt_clk); ++ ++ printk(KERN_ERR "%s: Failed to get imx-wdt.0 clk: %d\n", __FUNCTION__, ret); ++ mxc_wdt_clk = NULL; ++ return ret; ++ } ++ return 0; ++} ++arch_initcall(mxc_wdt_init); +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 18:02:02.000000000 +0200 +@@ -66,7 +66,7 @@ static inline void gpt_irq_disable(void) + { + unsigned int tmp; + +- if (cpu_is_mx3()) ++ if (cpu_is_mx3() || cpu_is_mx25()) + __raw_writel(0, timer_base + MX3_IR); + else { + tmp = __raw_readl(timer_base + MXC_TCTL); +@@ -76,7 +76,7 @@ static inline void gpt_irq_disable(void) + + static inline void gpt_irq_enable(void) + { +- if (cpu_is_mx3()) ++ if (cpu_is_mx3() || cpu_is_mx25()) + __raw_writel(1<<0, timer_base + MX3_IR); + else { + __raw_writel(__raw_readl(timer_base + MXC_TCTL) | MX1_2_TCTL_IRQEN, +@@ -88,9 +88,9 @@ static void gpt_irq_acknowledge(void) + { + if (cpu_is_mx1()) + __raw_writel(0, timer_base + MX1_2_TSTAT); +- if (cpu_is_mx2()) ++ if (cpu_is_mx2() && !cpu_is_mx25()) + __raw_writel(MX2_TSTAT_CAPT | MX2_TSTAT_COMP, timer_base + MX1_2_TSTAT); +- if (cpu_is_mx3()) ++ if (cpu_is_mx3() || cpu_is_mx25()) + __raw_writel(MX3_TSTAT_OF1, timer_base + MX3_TSTAT); + } + +@@ -117,7 +117,7 @@ static int __init mxc_clocksource_init(s + { + unsigned int c = clk_get_rate(timer_clk); + +- if (cpu_is_mx3()) ++ if (cpu_is_mx3() || cpu_is_mx25()) + clocksource_mxc.read = mx3_get_cycles; + + clocksource_mxc.mult = clocksource_hz2mult(c, +@@ -180,7 +180,7 @@ static void mxc_set_mode(enum clock_even + + if (mode != clockevent_mode) { + /* Set event time into far-far future */ +- if (cpu_is_mx3()) ++ if (cpu_is_mx3() || cpu_is_mx25()) + __raw_writel(__raw_readl(timer_base + MX3_TCN) - 3, + timer_base + MX3_TCMP); + else +@@ -233,7 +233,7 @@ static irqreturn_t mxc_timer_interrupt(i + struct clock_event_device *evt = &clockevent_mxc; + uint32_t tstat; + +- if (cpu_is_mx3()) ++ if (cpu_is_mx3() || cpu_is_mx25()) + tstat = __raw_readl(timer_base + MX3_TSTAT); + else + tstat = __raw_readl(timer_base + MX1_2_TSTAT); +@@ -264,7 +264,7 @@ static int __init mxc_clockevent_init(st + { + unsigned int c = clk_get_rate(timer_clk); + +- if (cpu_is_mx3()) ++ if (cpu_is_mx3() || cpu_is_mx25()) + 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 + __raw_writel(0, timer_base + MXC_TCTL); + __raw_writel(0, timer_base + MXC_TPRER); /* see datasheet note */ + +- if (cpu_is_mx3()) ++ if (cpu_is_mx3() || cpu_is_mx25()) + 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 18:02:54.000000000 +0200 +@@ -12,7 +12,7 @@ + # + # http://www.arm.linux.org.uk/developer/machines/?action=new + # +-# Last update: Mon Mar 23 20:09:01 2009 ++# Last update: Mon Apr 20 10:31:38 2009 + # + # machine_is_xxx CONFIG_xxxx MACH_TYPE_xxx number + # +@@ -1721,7 +1721,7 @@ sapphire MACH_SAPPHIRE SAPPHIRE 1729 + csb637xo MACH_CSB637XO CSB637XO 1730 + evisiong MACH_EVISIONG EVISIONG 1731 + stmp37xx MACH_STMP37XX STMP37XX 1732 +-stmp378x MACH_STMP38XX STMP38XX 1733 ++stmp378x MACH_STMP378X STMP378X 1733 + tnt MACH_TNT TNT 1734 + tbxt MACH_TBXT TBXT 1735 + playmate MACH_PLAYMATE PLAYMATE 1736 +@@ -2132,3 +2132,41 @@ apollo MACH_APOLLO APOLLO 2141 + at91cap9stk MACH_AT91CAP9STK AT91CAP9STK 2142 + spc300 MACH_SPC300 SPC300 2143 + eko MACH_EKO EKO 2144 ++ccw9m2443 MACH_CCW9M2443 CCW9M2443 2145 ++ccw9m2443js MACH_CCW9M2443JS CCW9M2443JS 2146 ++m2m_router_device MACH_M2M_ROUTER_DEVICE M2M_ROUTER_DEVICE 2147 ++str9104nas MACH_STAR9104NAS STAR9104NAS 2148 ++pca100 MACH_PCA100 PCA100 2149 ++z3_dm365_mod_01 MACH_Z3_DM365_MOD_01 Z3_DM365_MOD_01 2150 ++hipox MACH_HIPOX HIPOX 2151 ++omap3_piteds MACH_OMAP3_PITEDS OMAP3_PITEDS 2152 ++bm150r MACH_BM150R BM150R 2153 ++tbone MACH_TBONE TBONE 2154 ++merlin MACH_MERLIN MERLIN 2155 ++falcon MACH_FALCON FALCON 2156 ++davinci_da850_evm MACH_DAVINCI_DA850_EVM DAVINCI_DA850_EVM 2157 ++s5p6440 MACH_S5P6440 S5P6440 2158 ++at91sam9g10ek MACH_AT91SAM9G10EK AT91SAM9G10EK 2159 ++omap_4430sdp MACH_OMAP_4430SDP OMAP_4430SDP 2160 ++lpc313x MACH_LPC313X LPC313X 2161 ++magx_zn5 MACH_MAGX_ZN5 MAGX_ZN5 2162 ++magx_em30 MACH_MAGX_EM30 MAGX_EM30 2163 ++magx_ve66 MACH_MAGX_VE66 MAGX_VE66 2164 ++meesc MACH_MEESC MEESC 2165 ++otc570 MACH_OTC570 OTC570 2166 ++bcu2412 MACH_BCU2412 BCU2412 2167 ++beacon MACH_BEACON BEACON 2168 ++actia_tgw MACH_ACTIA_TGW ACTIA_TGW 2169 ++e4430 MACH_E4430 E4430 2170 ++ql300 MACH_QL300 QL300 2171 ++btmavb101 MACH_BTMAVB101 BTMAVB101 2172 ++btmawb101 MACH_BTMAWB101 BTMAWB101 2173 ++sq201 MACH_SQ201 SQ201 2174 ++quatro45xx MACH_QUATRO45XX QUATRO45XX 2175 ++openpad MACH_OPENPAD OPENPAD 2176 ++tx25 MACH_TX25 TX25 2177 ++omap3_torpedo MACH_OMAP3_TORPEDO OMAP3_TORPEDO 2178 ++htcraphael_k MACH_HTCRAPHAEL_K HTCRAPHAEL_K 2179 ++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 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", + template->gpio, template->name); +- return 0; ++ return -EINVAL; + } + + 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 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. + ++config MTD_NAND_MXC_FLASH_BBT ++ bool "Support a flash based bad block table" ++ depends on MTD_NAND_MXC ++ ++config ARCH_MXC_HAS_NFC_V1 ++ bool ++ ++config ARCH_MXC_HAS_NFC_V1_1 ++ select ARCH_MXC_HAS_NFC_V1 ++ bool ++ ++config ARCH_MXC_HAS_NFC_V2 ++ bool ++ ++config ARCH_MXC_HAS_NFC_V2_1 ++ bool ++ select ARCH_MXC_HAS_NFC_V2 ++ ++config ARCH_MXC_HAS_NFC_V3 ++ bool ++ + 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/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-08 12:51:07.000000000 +0200 +@@ -34,23 +34,52 @@ + #include + #include + ++#ifdef CONFIG_MTD_DEBUG ++static int debug = 0; ++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(l, fmt...) DBG(l, fmt) ++#else ++static int debug; ++module_param(debug, int, 0); ++ ++#define dbg_lvl(n) 0 ++#define DBG(lvl, fmt...) do { } while (0) ++#endif ++ ++ + #define DRIVER_NAME "mxc_nand" + + /* Addresses for NFC registers */ +-#define NFC_BUF_SIZE 0xE00 +-#define NFC_BUF_ADDR 0xE04 +-#define NFC_FLASH_ADDR 0xE06 +-#define NFC_FLASH_CMD 0xE08 +-#define NFC_CONFIG 0xE0A +-#define NFC_ECC_STATUS_RESULT 0xE0C +-#define NFC_RSLTMAIN_AREA 0xE0E +-#define NFC_RSLTSPARE_AREA 0xE10 +-#define NFC_WRPROT 0xE12 +-#define NFC_UNLOCKSTART_BLKADDR 0xE14 +-#define NFC_UNLOCKEND_BLKADDR 0xE16 +-#define NFC_NF_WRPRST 0xE18 +-#define NFC_CONFIG1 0xE1A +-#define NFC_CONFIG2 0xE1C ++#define NFC_BUF_SIZE 0x000 ++#define NFC_BUF_ADDR 0x004 ++#define NFC_FLASH_ADDR 0x006 ++#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_UNLOCKSTART_BLKADDR 0x014 ++#define NFC_UNLOCKEND_BLKADDR 0x016 ++#endif ++#define NFC_NF_WRPRST 0x018 ++#define NFC_CONFIG1 0x01A ++#define NFC_CONFIG2 0x01C ++#ifdef CONFIG_ARCH_MXC_HAS_NFC_V1_1 ++#define NFC_UNLOCKSTART_BLKADDR 0x020 ++#define NFC_UNLOCKEND_BLKADDR 0x022 ++#define NFC_UNLOCKSTART_BLKADDR1 0x024 ++#define NFC_UNLOCKEND_BLKADDR1 0x026 ++#define NFC_UNLOCKSTART_BLKADDR2 0x028 ++#define NFC_UNLOCKEND_BLKADDR2 0x02a ++#define NFC_UNLOCKSTART_BLKADDR3 0x02c ++#define NFC_UNLOCKEND_BLKADDR3 0x02e ++#endif + + /* Addresses for NFC RAM BUFFER Main area 0 */ + #define MAIN_AREA0 0x000 +@@ -59,10 +88,27 @@ + #define MAIN_AREA3 0x600 + + /* Addresses for NFC SPARE BUFFER Spare area 0 */ ++#ifndef CONFIG_ARCH_MXC_HAS_NFC_V1_1 ++#define SPARE_AREA_SIZE 16 + #define SPARE_AREA0 0x800 + #define SPARE_AREA1 0x810 + #define SPARE_AREA2 0x820 + #define SPARE_AREA3 0x830 ++#else ++#define SPARE_AREA_SIZE 64 ++#define MAIN_AREA4 0x800 ++#define MAIN_AREA5 0xa00 ++#define MAIN_AREA6 0xc00 ++#define MAIN_AREA7 0xe00 ++#define SPARE_AREA0 0x1000 ++#define SPARE_AREA1 0x1040 ++#define SPARE_AREA2 0x1080 ++#define SPARE_AREA3 0x10c0 ++#define SPARE_AREA4 0x1100 ++#define SPARE_AREA5 0x1140 ++#define SPARE_AREA6 0x1180 ++#define SPARE_AREA7 0x11c0 ++#endif + + /* 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 { + struct device *dev; + + void __iomem *regs; ++ void __iomem *nfc_buf; + int spare_only; + int status_request; + int pagesize_2k; +@@ -120,40 +167,149 @@ 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}} ++}; ++ + static struct nand_ecclayout nand_hw_eccoob_8 = { + .eccbytes = 5, + .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}} ++}; ++ ++#ifdef CONFIG_MTD_NAND_MXC_FLASH_BBT ++static u8 bbt_pattern[] = {'B', 'b', 't', '0' }; ++static u8 mirror_pattern[] = {'1', 't', 'b', 'B' }; ++ ++static struct nand_bbt_descr bbt_main_descr = { ++ .options = (NAND_BBT_LASTBLOCK | NAND_BBT_WRITE | ++ NAND_BBT_2BIT | NAND_BBT_VERSION | NAND_BBT_PERCHIP), ++ .offs = 12, ++ .len = 4, ++ .veroffs = 11, ++ .maxblocks = 4, ++ .pattern = bbt_pattern, + }; + ++static struct nand_bbt_descr bbt_mirror_descr = { ++ .options = (NAND_BBT_LASTBLOCK | NAND_BBT_WRITE | ++ NAND_BBT_2BIT | NAND_BBT_VERSION | NAND_BBT_PERCHIP), ++ .offs = 12, ++ .len = 4, ++ .veroffs = 11, ++ .maxblocks = 4, ++ .pattern = mirror_pattern, ++}; ++#endif ++#else ++/* ++ * 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 = {{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}, ++ .oobfree = {{0, 4}}, ++}; ++ ++static struct nand_ecclayout nand_hw_eccoob2k_16 = { ++ .eccbytes = 9, ++ .eccpos = {6, 7, 8, 9, 10, 11, 12, 13, 14}, ++ .oobfree = {{2, 4}, {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 ++*/ ++static u8 bbt_pattern[] = { 'B', 'b', 't', '0' }; ++static u8 mirror_pattern[] = { '1', 't', 'b', 'B' }; ++ ++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 ++}; ++ ++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 ++}; ++#endif ++#endif ++ + #ifdef CONFIG_MTD_PARTITIONS + static const char *part_probes[] = { "RedBoot", "cmdlinepart", NULL }; + #endif + ++#ifdef CONFIG_MTD_DEBUG ++#define nfc_read_reg(b, r) __nfc_read_reg(b, r, #r, __FUNCTION__) ++static inline u16 __nfc_read_reg(void __iomem *base, unsigned int reg, ++ const char *name, const char *fn) ++{ ++ u16 val = readw(base + reg); ++ DBG(3, "%s: Read %04x from %s[%02x]\n", fn, val, name, reg); ++ return val; ++} ++ ++#define nfc_write_reg(v, b, r) __nfc_write_reg(v, b, r, #r, __FUNCTION__) ++static inline void __nfc_write_reg(u16 val, void __iomem *base, unsigned int reg, ++ const char *name, const char *fn) ++{ ++ DBG(3, "%s: Writing %04x to %s[%02x]\n", fn, val, name, reg); ++ writew(val, base + reg); ++} ++#else ++#define nfc_read_reg(b, r) readw(b + r) ++#define nfc_write_reg(v, b, r) writew(v, b + r) ++#endif ++ + 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_LEVEL3, "%s(%d)\n", __FUNCTION__, irq); ++ ++ tmp = nfc_read_reg(host->regs, NFC_CONFIG1); + tmp |= NFC_INT_MSK; /* Disable interrupt */ +- writew(tmp, host->regs + NFC_CONFIG1); ++ nfc_write_reg(tmp, host->regs, NFC_CONFIG1); + + wake_up(&host->irq_waitq); + +@@ -166,35 +322,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; +- + if (useirq) { +- if ((readw(host->regs + NFC_CONFIG2) & NFC_INT) == 0) { +- +- tmp = readw(host->regs + NFC_CONFIG1); +- tmp &= ~NFC_INT_MSK; /* Enable interrupt */ +- writew(tmp, host->regs + NFC_CONFIG1); +- +- wait_event(host->irq_waitq, +- readw(host->regs + NFC_CONFIG2) & NFC_INT); +- +- tmp = readw(host->regs + NFC_CONFIG2); +- tmp &= ~NFC_INT; +- writew(tmp, host->regs + NFC_CONFIG2); ++ if (!(nfc_read_reg(host->regs, NFC_CONFIG2) & NFC_INT)) { ++ uint32_t cfg1; ++ 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_read_reg(host->regs, NFC_CONFIG2) & ++ NFC_INT, timeout); + } + } else { +- while (max_retries-- > 0) { +- if (readw(host->regs + NFC_CONFIG2) & NFC_INT) { +- tmp = readw(host->regs + NFC_CONFIG2); +- tmp &= ~NFC_INT; +- writew(tmp, host->regs + NFC_CONFIG2); +- break; +- } ++ 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); + } + } + +@@ -204,8 +354,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 +369,9 @@ 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); +@@ -230,22 +382,28 @@ static void send_addr(struct mxc_nand_ho + static void send_prog_page(struct mxc_nand_host *host, uint8_t buf_id, + int spare_only) + { ++ int i; + DEBUG(MTD_DEBUG_LEVEL3, "send_prog_page (%d)\n", spare_only); + ++ for (i = 0; i < 4; i++) { ++ void *src = host->nfc_buf + SPARE_AREA0 + i * 16; ++ void *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); ++ nfc_write_reg(buf_id, host->regs, NFC_BUF_ADDR); + + /* Configure spare or page+spare access */ + if (!host->pagesize_2k) { +- uint16_t config1 = readw(host->regs + NFC_CONFIG1); ++ uint16_t config1 = nfc_read_reg(host->regs, NFC_CONFIG1); + if (spare_only) + config1 |= NFC_SP_EN; + else +- 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); +@@ -256,25 +414,33 @@ 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 */ +- writew(buf_id, host->regs + NFC_BUF_ADDR); ++ nfc_write_reg(buf_id, host->regs, NFC_BUF_ADDR); + + /* Configure spare or page+spare access */ + if (!host->pagesize_2k) { +- uint32_t config1 = readw(host->regs + NFC_CONFIG1); ++ uint32_t config1 = nfc_read_reg(host->regs, NFC_CONFIG1); + if (spare_only) + config1 |= NFC_SP_EN; + else + config1 &= ~NFC_SP_EN; +- writew(config1, host->regs + NFC_CONFIG1); ++ nfc_write_reg(config1, host->regs, NFC_CONFIG1); + } + +- 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); ++ for (i = 0; i < 4; i++) { ++ void *src = host->nfc_buf + SPARE_AREA0 + i * 64; ++ void *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 +450,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 */ +- tmp = readw(host->regs + NFC_CONFIG1); ++ tmp = nfc_read_reg(host->regs, NFC_CONFIG1); + tmp &= ~NFC_SP_EN; +- writew(tmp, host->regs + NFC_CONFIG1); ++ 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 */ + wait_op_done(host, TROP_US_DELAY, 0, true); + + 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,32 +480,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_AREA1; + uint32_t store; + uint16_t ret, tmp; + /* 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 + * corruption of read/write buffer on status requests. */ +- writew(1, 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); ++ tmp = nfc_read_reg(host->regs, NFC_CONFIG1); + tmp &= ~NFC_SP_EN; +- writew(tmp, host->regs + NFC_CONFIG1); ++ nfc_write_reg(tmp, host->regs, NFC_CONFIG1); + +- writew(NFC_STATUS, host->regs + NFC_CONFIG2); ++ WARN_ON(nfc_read_reg(host->regs, NFC_CONFIG2)); ++ nfc_write_reg(NFC_STATUS, host->regs, NFC_CONFIG2); + + /* Wait for operation to complete */ + wait_op_done(host, TROP_US_DELAY, 0, true); + + /* Status is placed in first word of main buffer */ +- /* get status, then recovery area 1 data */ ++ /* get status, then recover area 1 data */ + ret = readw(main_buf); + writel(store, main_buf); + ++ DBG(0, "%s: status=%02x\n", __FUNCTION__, ret); ++ + return ret; + } + +@@ -369,7 +541,7 @@ static int mxc_nand_correct_data(struct + * 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, +@@ -392,8 +564,10 @@ 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; +- uint16_t __iomem *main_buf = host->regs + MAIN_AREA0; +- 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; ++ ++ WARN_ON(host->spare_only && host->col_addr >= 16); + + /* Check for status request */ + if (host->status_request) +@@ -431,14 +605,16 @@ static uint16_t mxc_nand_read_word(struc + "mxc_nand_read_word(col = %d)\n", host->col_addr); + + col = host->col_addr; ++ + /* Adjust saved column address */ + if (col < mtd->writesize && host->spare_only) + col += mtd->writesize; ++ WARN_ON(col >= mtd->writesize + 16); + + if (col < mtd->writesize) +- p = (host->regs + MAIN_AREA0) + (col >> 1); ++ p = (host->nfc_buf + MAIN_AREA0) + (col >> 1); + else +- p = (host->regs + SPARE_AREA0) + ((col - mtd->writesize) >> 1); ++ p = (host->nfc_buf + SPARE_AREA0) + ((col - mtd->writesize) >> 1); + + if (col & 1) { + rd_word = readw(p); +@@ -474,10 +650,13 @@ static void mxc_nand_write_buf(struct mt + /* 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 ++ 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); + +@@ -485,10 +664,10 @@ static void mxc_nand_write_buf(struct mt + void __iomem *p; + + if (col < mtd->writesize) +- p = host->regs + MAIN_AREA0 + (col & ~3); ++ p = host->nfc_buf + MAIN_AREA0 + (col & ~3); + else +- p = host->regs + SPARE_AREA0 - +- mtd->writesize + (col & ~3); ++ p = host->nfc_buf + SPARE_AREA0 + ++ (col & ~3) - mtd->writesize; + + DEBUG(MTD_DEBUG_LEVEL3, "%s:%d: p = %p\n", __func__, + __LINE__, p); +@@ -542,6 +721,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); + + memcpy(p, &buf[i], m); + col += m; +@@ -571,18 +751,28 @@ static void mxc_nand_read_buf(struct mtd + /* 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 ++ /* 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; + + if (col < mtd->writesize) +- p = host->regs + MAIN_AREA0 + (col & ~3); ++ p = host->nfc_buf + MAIN_AREA0 + (col & ~3); + else +- p = host->regs + SPARE_AREA0 - +- mtd->writesize + (col & ~3); ++ p = host->nfc_buf + SPARE_AREA0 + ++ (col & ~3) - mtd->writesize; ++ ++ if (dbg_lvl(3)) { ++ print_hex_dump(KERN_DEBUG, "spare: ", DUMP_PREFIX_ADDRESS, ++ 16, 2, p, 64, 0); ++ } + + if (((col | (int)&buf[i]) & 3) || n < 16) { + uint32_t data; +@@ -621,15 +811,20 @@ static void mxc_nand_read_buf(struct mtd + m += mtd->oobsize; + + 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; + } + } ++ 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 +@@ -637,7 +832,22 @@ 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; ++ ++ for (i = 0; i < len >> 1; i++) { ++ u16 w = *wp++; ++ u8 c1 = *buf++; ++ u8 c2 = *buf++; ++ if ((w & 0xff) != c1 || (w >> 8) != c2) { ++ DBG(0, "%s: verify error @ %03x: read: %02x %02x expected: %02x %02x\n", ++ __FUNCTION__, i, w & 0xff, w >> 8, c1, c2); ++ return -EFAULT; ++ } ++ } ++ return 0; + } + + /* This function is used by upper layer for select and +@@ -655,13 +865,15 @@ 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); + 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); + #endif + + switch (chip) { +@@ -679,9 +891,6 @@ static void mxc_nand_select_chip(struct + host->clk_act = 1; + } + break; +- +- default: +- break; + } + } + +@@ -692,7 +901,7 @@ 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", +@@ -712,13 +921,11 @@ static void mxc_nand_command(struct mtd_ + case NAND_CMD_READ0: + 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; +@@ -751,23 +958,25 @@ 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); +- ++#ifndef CONFIG_ARCH_MXC_HAS_NFC_V1_1 + if (host->pagesize_2k) { + /* 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); + } +- ++#endif ++ useirq = true; + break; + + case NAND_CMD_ERASE1: +- useirq = false; ++ break; ++ case NAND_CMD_ERASE2: ++ useirq = true; + break; + } + +@@ -791,23 +1000,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 +1022,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); ++#ifndef CONFIG_ARCH_MXC_HAS_NFC_V1_1 + send_read_page(host, 1, host->spare_only); + send_read_page(host, 2, host->spare_only); + send_read_page(host, 3, host->spare_only); ++#endif + } else + send_read_page(host, 0, host->spare_only); + break; + + case NAND_CMD_READID: ++ host->col_addr = 0; + send_read_id(host); + break; + +@@ -851,9 +1053,12 @@ 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; +- struct resource *res; ++ struct resource *res1, *res2; + 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 +1073,6 @@ static int __init mxcnd_probe(struct pla + mtd->owner = THIS_MODULE; + mtd->dev.parent = &pdev->dev; + +- /* 50 us command delay time */ +- this->chip_delay = 5; +- + this->priv = host; + this->dev_ready = mxc_nand_dev_ready; + this->cmdfunc = mxc_nand_command; +@@ -880,29 +1082,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; ++#ifdef CONFIG_MTD_NAND_MXC_FLASH_BBT ++ this->bbt_td = &bbt_main_descr; ++ this->bbt_md = &bbt_mirror_descr; ++ this->options |= NAND_USE_FLASH_BBT; ++#endif + +- host->clk = clk_get(&pdev->dev, "nfc"); +- if (IS_ERR(host->clk)) ++ host->clk = clk_get(&pdev->dev, "nfc_clk"); ++ if (IS_ERR(host->clk)) { ++ err = PTR_ERR(host->clk); + goto eclk; ++ } + + clk_enable(host->clk); + host->clk_act = 1; + +- res = platform_get_resource(pdev, IORESOURCE_MEM, 0); +- if (!res) { ++ res1 = platform_get_resource(pdev, IORESOURCE_MEM, 0); ++ res2 = platform_get_resource(pdev, IORESOURCE_MEM, 1); ++ if (!res1 || !res2) { + err = -ENODEV; + goto eres; + } + +- 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; ++ } ++ ++ if (!request_mem_region(res2->start, resource_size(res2), "mxc_nand buffer")) { ++ err = -EBUSY; ++ goto ereq2; ++ } ++ ++ host->regs = ioremap(res1->start, resource_size(res1)); + if (!host->regs) { +- err = -EIO; +- goto eres; ++ err = -ENOMEM; ++ goto eunmap1; + } + +- tmp = readw(host->regs + NFC_CONFIG1); ++ 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); + +@@ -912,57 +1139,84 @@ static int __init mxcnd_probe(struct pla + if (err) + goto eirq; + +- 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_ECC_EN; +- writew(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; +- tmp = readw(host->regs + NFC_CONFIG1); +- tmp &= ~NFC_ECC_EN; +- writew(tmp, host->regs + NFC_CONFIG1); +- } +- + /* Reset NAND */ + this->cmdfunc(mtd, NAND_CMD_RESET, -1, -1); + + /* preset operation */ + /* Unlock the internal RAM Buffer */ +- writew(0x2, host->regs + NFC_CONFIG); ++ nfc_write_reg(0x2, host->regs, NFC_CONFIG); + + /* Blocks to be unlocked */ +- writew(0x0, host->regs + NFC_UNLOCKSTART_BLKADDR); +- writew(0x4000, host->regs + NFC_UNLOCKEND_BLKADDR); ++ nfc_write_reg(0x0, host->regs, NFC_UNLOCKSTART_BLKADDR); ++ nfc_write_reg(0x4000, host->regs, NFC_UNLOCKEND_BLKADDR); + + /* Unlock Block Command for given address range */ +- writew(0x4, host->regs + NFC_WRPROT); ++ nfc_write_reg(0x4, host->regs, NFC_WRPROT); + + /* NAND bus width determines access funtions used by upper layer */ + if (pdata->width == 2) { + this->options |= NAND_BUSWIDTH_16; +- this->ecc.layout = &nand_hw_eccoob_16; + } + +- host->pagesize_2k = 0; +- + /* Scan to find existence of the device */ +- if (nand_scan(mtd, 1)) { ++ err = nand_scan_ident(mtd, 1); ++ if (err) { + DEBUG(MTD_DEBUG_LEVEL0, + "MXC_ND: Unable to find any NAND device.\n"); +- err = -ENXIO; ++ goto escan; ++ } ++ /* this is required before completing the scan */ ++ host->pagesize_2k = (mtd->writesize == 2048); ++ tmp = nfc_read_reg(host->regs, NFC_CONFIG1); ++ tmp |= NFC_ONE_CYCLE; ++ tmp &= ~(3 << 9); /* clear PPB mask */ ++ DBG(0, "%s: ppb=%d (%02x)\n", __FUNCTION__, ++ mtd->erasesize / mtd->writesize, ++ ffs(mtd->erasesize / mtd->writesize) - 6); ++ ++ /* set PPB (pages per block */ ++ tmp |= (ffs(mtd->erasesize / mtd->writesize) - 6) << 9; ++ nfc_write_reg(tmp, host->regs, NFC_CONFIG1); ++ if (pdata->width == 2) { ++ if (host->pagesize_2k) { ++ this->ecc.layout = &nand_hw_eccoob2k_16; ++ } else { ++ this->ecc.layout = &nand_hw_eccoob_16; ++ } ++ } 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; ++ nfc_write_reg(tmp, host->regs, NFC_CONFIG1); ++ } ++ ++ err = nand_scan_tail(mtd); ++ if (err) { + goto escan; + } + ++ 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 +1235,19 @@ static int __init mxcnd_probe(struct pla + return 0; + + escan: +- free_irq(host->irq, NULL); ++ free_irq(host->irq, host); + eirq: ++ if (res2) ++ iounmap(host->nfc_buf); ++eunmap2: + iounmap(host->regs); ++eunmap1: ++ release_mem_region(res2->start, resource_size(res2)); ++ereq2: ++ release_mem_region(res1->start, resource_size(res1)); ++ereq1: + eres: ++ clk_disable(host->clk); + clk_put(host->clk); + eclk: + kfree(host); +@@ -995,46 +1258,63 @@ eclk: + static int __devexit mxcnd_remove(struct platform_device *pdev) + { + struct mxc_nand_host *host = platform_get_drvdata(pdev); ++ struct resource *res; + ++ if (host->clk_act) ++ clk_disable(host->clk); + clk_put(host->clk); + +- platform_set_drvdata(pdev, NULL); +- + nand_release(&host->mtd); +- free_irq(host->irq, NULL); ++ free_irq(host->irq, host); + iounmap(host->regs); + kfree(host); + ++ res = platform_get_resource(pdev, IORESOURCE_MEM, 0); ++ if (res) { ++ release_mem_region(res->start, resource_size(res)); ++ } ++ res = platform_get_resource(pdev, IORESOURCE_MEM, 1); ++ if (res) { ++ release_mem_region(res->start, resource_size(res)); ++ } + return 0; + } + + #ifdef CONFIG_PM + static int mxcnd_suspend(struct platform_device *pdev, pm_message_t state) + { +- struct mtd_info *info = platform_get_drvdata(pdev); ++ struct mtd_info *mtd = platform_get_drvdata(pdev); ++ struct nand_chip *nand_chip = mtd->priv; ++ struct mxc_nand_host *host = nand_chip->priv; + int ret = 0; + + DEBUG(MTD_DEBUG_LEVEL0, "MXC_ND : NAND suspend\n"); +- if (info) +- ret = info->suspend(info); ++ if (mtd) ++ ret = mtd->suspend(mtd); + +- /* Disable the NFC clock */ +- clk_disable(nfc_clk); /* FIXME */ ++ if (host->clk_act) { ++ /* Disable the NFC clock */ ++ clk_disable(host->clk); ++ } + + return ret; + } + + static int mxcnd_resume(struct platform_device *pdev) + { +- struct mtd_info *info = platform_get_drvdata(pdev); ++ struct mtd_info *mtd = platform_get_drvdata(pdev); ++ struct nand_chip *nand_chip = mtd->priv; ++ struct mxc_nand_host *host = nand_chip->priv; + int ret = 0; + + DEBUG(MTD_DEBUG_LEVEL0, "MXC_ND : NAND resume\n"); +- /* Enable the NFC clock */ +- clk_enable(nfc_clk); /* FIXME */ + +- if (info) +- info->resume(info); ++ if (host->clk_act) { ++ /* Enable the NFC clock */ ++ clk_enable(host->clk); ++ } ++ if (mtd) ++ mtd->resume(mtd); + + return ret; + } +@@ -1047,7 +1327,7 @@ static int mxcnd_resume(struct platform_ + static struct platform_driver mxcnd_driver = { + .driver = { + .name = DRIVER_NAME, +- }, ++ }, + .remove = __exit_p(mxcnd_remove), + .suspend = mxcnd_suspend, + .resume = mxcnd_resume, +@@ -1055,13 +1335,14 @@ static struct platform_driver mxcnd_driv + + static int __init mxc_nd_init(void) + { ++ int ret; ++ + /* Register the device driver structure. */ +- pr_info("MXC MTD nand Driver\n"); +- if (platform_driver_probe(&mxcnd_driver, mxcnd_probe) != 0) { ++ ret = platform_driver_probe(&mxcnd_driver, mxcnd_probe); ++ if (ret != 0) { + printk(KERN_ERR "Driver register failed for mxcnd_driver\n"); +- return -ENODEV; + } +- return 0; ++ return ret; + } + + static void __exit mxc_nd_cleanup(void) +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 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 -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 18:43:03.000000000 +0200 +@@ -2,6 +2,12 @@ + * Fast Ethernet Controller (FEC) driver for Motorola MPC8xx. + * Copyright (c) 1997 Dan Malek (dmalek@jlc.net) + * ++ * This version of the driver is specific to the FADS implementation, ++ * since the board contains control registers external to the processor ++ * for the control of the LevelOne LXT970 transceiver. The MPC860T manual ++ * describes connections using the internal parallel port I/O, which ++ * is basically all of Port D. ++ * + * Right now, I am very wasteful with the buffers. I allocate memory + * pages and then divide them into 2K frame buffers. This way I know I + * have buffers large enough to hold one frame within one buffer descriptor. +@@ -18,77 +24,123 @@ + * Bug fixes and cleanup by Philippe De Muyter (phdm@macqel.be) + * Copyright (c) 2004-2006 Macq Electronique SA. + */ ++/* ++ * Copyright 2006-2007 Freescale Semiconductor, Inc. All Rights Reserved. ++ */ + + #include + #include +-#include +-#include ++#include + #include + #include + #include + #include +-#include +-#include ++#include + #include ++#include + #include + #include + #include + #include +-#include +-#include +-#include +-#include ++#include + #include +-#include ++#include ++#include + +-#include ++#include ++#include + +-#ifndef CONFIG_ARCH_MXC +-#include +-#include ++#define DRV_NAME "fec" ++#define DEBUG ++ ++#ifdef DEBUG ++static int debug = 0; ++#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 + ++#if defined(CONFIG_M523x) || defined(CONFIG_M527x) || \ ++ defined(CONFIG_M5272) || defined(CONFIG_M528x) || \ ++ defined(CONFIG_M520x) || defined(CONFIG_M532x) ++#include ++#include + #include "fec.h" +- +-#ifdef CONFIG_ARCH_MXC ++#define FEC_ALIGNMENT (0x03) /*FEC needs 4bytes alignment*/ ++#elif defined(CONFIG_ARCH_MXC) + #include +-#define FEC_ALIGNMENT 0xf ++#include ++#include "fec.h" ++#define FEC_ALIGNMENT (0x0F) /*FEC needs 128bits(16bytes) alignment*/ + #else +-#define FEC_ALIGNMENT 0x3 ++#include ++#include ++#include "commproc.h" ++#define FEC_ALIGNMENT (0x03) /*FEC needs 4bytes alignment */ + #endif + ++#define FEC_ADDR_ALIGNMENT(x) ((unsigned char *)(((unsigned long)(x) + (FEC_ALIGNMENT)) & (~FEC_ALIGNMENT))) ++ ++#if 0 + /* + * Define the fixed address of the FEC hardware. + */ ++/* USE resources provided by platform_device! */ ++static unsigned int fec_hw[] = { + #if defined(CONFIG_M5272) +-#define HAVE_mii_link_interrupt +- +-static unsigned char fec_mac_default[] = { +- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ (MCF_MBAR + 0x840), ++#elif defined(CONFIG_M527x) ++ (MCF_MBAR + 0x1000), ++ (MCF_MBAR + 0x1800), ++#elif defined(CONFIG_M523x) || defined(CONFIG_M528x) ++ (MCF_MBAR + 0x1000), ++#elif defined(CONFIG_M520x) ++ (MCF_MBAR+0x30000), ++#elif defined(CONFIG_M532x) ++ (MCF_MBAR+0xfc030000), ++#elif defined(CONFIG_ARCH_MXC) ++ (IO_ADDRESS(FEC_BASE_ADDR)), ++#else ++ &(((immap_t *)IMAP_ADDR)->im_cpm.cp_fec), ++#endif + }; ++#endif + ++#if 0 + /* + * Some hardware gets it MAC address out of local flash memory. + * if this is non-zero then assume it is the address to get MAC from. + */ ++/* implemented using platform_data! */ + #if defined(CONFIG_NETtel) + #define FEC_FLASHMAC 0xf0006006 + #elif defined(CONFIG_GILBARCONAP) || defined(CONFIG_SCALES) + #define FEC_FLASHMAC 0xf0006000 ++#elif defined (CONFIG_MTD_KeyTechnology) ++#define FEC_FLASHMAC 0xffe04000 + #elif defined(CONFIG_CANCam) + #define FEC_FLASHMAC 0xf0020000 + #elif defined (CONFIG_M5272C3) + #define FEC_FLASHMAC (0xffe04000 + 4) + #elif defined(CONFIG_MOD5272) +-#define FEC_FLASHMAC 0xffc0406b ++#define FEC_FLASHMAC 0xffc0406b + #else + #define FEC_FLASHMAC 0 + #endif +-#endif /* CONFIG_M5272 */ ++#endif ++ ++#define platform_func(p, args...) ((p) ? (p)(args) : 0) + + /* Forward declarations of some structures to support different PHYs + */ +- ++#ifndef CONFIG_PHYLIB + typedef struct { + uint mii_data; + void (*funct)(uint mii_reg, struct net_device *dev); +@@ -103,6 +155,7 @@ typedef struct { + const phy_cmd_t *ack_int; + const phy_cmd_t *shutdown; + } phy_info_t; ++#endif + + /* The number of Tx and Rx buffers. These are allocated from the page + * pool. The code may assume these are power of two, so it it best +@@ -116,12 +169,13 @@ typedef struct { + #define RX_RING_SIZE (FEC_ENET_RX_FRPPG * FEC_ENET_RX_PAGES) + #define FEC_ENET_TX_FRSIZE 2048 + #define FEC_ENET_TX_FRPPG (PAGE_SIZE / FEC_ENET_TX_FRSIZE) +-#define TX_RING_SIZE 16 /* Must be power of two */ +-#define TX_RING_MOD_MASK 15 /* for this to work */ ++#define TX_RING_SIZE 16 /* Must be power of two */ ++#define TX_RING_MOD_MASK (TX_RING_SIZE - 1) /* for this to work */ + + #if (((RX_RING_SIZE + TX_RING_SIZE) * 8) > PAGE_SIZE) + #error "FEC: descriptor ring size constants too large" + #endif ++#define CBD_BUF_SIZE ((RX_RING_SIZE + TX_RING_SIZE) * sizeof(cbd_t)) + + /* Interrupt events/masks. + */ +@@ -136,6 +190,17 @@ typedef struct { + #define FEC_ENET_MII ((uint)0x00800000) /* MII interrupt */ + #define FEC_ENET_EBERR ((uint)0x00400000) /* SDMA bus error */ + ++/* MXC arch interrupt bits */ ++#define FEC_ENET_LC ((uint)0x00200000) /* Late collision */ ++#define FEC_ENET_RL ((uint)0x00100000) /* Collision retry limit exceeded */ ++#define FEC_ENET_UN ((uint)0x00080000) /* TX Fifo underrun */ ++ ++#ifndef CONFIG_ARCH_MXC ++#define FEC_ENET_MASK ((uint)0xffc00000) ++#else ++#define FEC_ENET_MASK ((uint)0xfff80000) ++#endif ++ + /* The FEC stores dest/src/type, data, and checksum for receive packets. + */ + #define PKT_MAXBUF_SIZE 1518 +@@ -150,7 +215,7 @@ typedef struct { + */ + #if defined(CONFIG_M523x) || defined(CONFIG_M527x) || defined(CONFIG_M528x) || \ + defined(CONFIG_M520x) || defined(CONFIG_M532x) || defined(CONFIG_ARCH_MXC) +-#define OPT_FRAME_SIZE (PKT_MAXBUF_SIZE << 16) ++#define OPT_FRAME_SIZE (RCR_MAX_FL_set(PKT_MAXBUF_SIZE)) + #else + #define OPT_FRAME_SIZE 0 + #endif +@@ -165,31 +230,45 @@ typedef struct { + */ + struct fec_enet_private { + /* Hardware registers of the FEC device */ +- volatile fec_t *hwp; +- +- struct net_device *netdev; +- +- struct clk *clk; ++ void __iomem *reg_base; ++ void __iomem *mib_base; ++ struct resource *res_mem1; ++ struct resource *res_mem2; ++ int etn_irq; ++ int mii_irq; ++#ifndef CONFIG_PHYLIB ++ struct timer_list *phy_timer; ++#else ++ struct mii_bus *mii; ++ int mii_complete; ++#endif ++ u32 msg_enable; + + /* The saved address of a sent-in-place packet/buffer, for skfree(). */ +- unsigned char *tx_bounce[TX_RING_SIZE]; ++ void *tx_bounce[TX_RING_SIZE]; + struct sk_buff* tx_skbuff[TX_RING_SIZE]; ++ struct sk_buff* rx_skbuff[RX_RING_SIZE]; + ushort skb_cur; + ushort skb_dirty; + + /* CPM dual port RAM relative addresses. + */ +- dma_addr_t bd_dma; ++ struct device *dma_dev; /* pointer to (platform_)device for dma_sync*() functions */ ++ void *cbd_mem_base; /* save the virtual base address of rx&tx buffer descriptor */ ++ dma_addr_t cbd_phys_base; /* physical address of buffer descriptor memory for access by FEC HW */ ++ + cbd_t *rx_bd_base; /* Address of Rx and Tx buffers. */ + cbd_t *tx_bd_base; +- cbd_t *cur_rx, *cur_tx; /* The next free ring entry */ +- cbd_t *dirty_tx; /* The ring entries to be free()ed. */ ++ cbd_t *cur_rx, *cur_tx; /* The next free ring entry */ ++ cbd_t *dirty_tx; /* The ring entries to be free()ed. */ ++ struct net_device_stats stats; + uint tx_full; +- /* hold while accessing the HW like ringbuffer for tx/rx but not MAC */ +- spinlock_t hw_lock; +- /* hold while accessing the mii_list_t() elements */ +- spinlock_t mii_lock; ++ spinlock_t lock; + ++#ifdef CONFIG_PHYLIB ++ struct phy_device *phy; ++ uint phy_speed; ++#else + uint phy_id; + uint phy_id_done; + uint phy_status; +@@ -199,28 +278,41 @@ struct fec_enet_private { + + uint sequence_done; + uint mii_phy_task_queued; +- ++#endif + uint phy_addr; + +- int index; +- int opened; +- int link; +- int old_link; +- int full_duplex; ++ unsigned int opened:1; ++ unsigned int phy_int_enabled:1; ++ unsigned int linkstatus:1; ++#ifndef CONFIG_PHYLIB ++ unsigned int old_linkstatus:1; ++#endif ++ unsigned int full_duplex:1; ++ ++ struct clk *clk; + }; + +-static int fec_enet_open(struct net_device *dev); +-static int fec_enet_start_xmit(struct sk_buff *skb, struct net_device *dev); +-static void fec_enet_mii(struct net_device *dev); +-static irqreturn_t fec_enet_interrupt(int irq, void * dev_id); ++#ifdef CONFIG_PHYLIB ++static int fec_connect_phy(struct net_device *dev, struct fec_enet_private *fep); ++#else ++static irqreturn_t mii_link_interrupt(int irq, void *dev_id); ++#endif ++static void fec_restart(struct net_device *dev, int duplex); + static void fec_enet_tx(struct net_device *dev); + static void fec_enet_rx(struct net_device *dev); +-static int fec_enet_close(struct net_device *dev); +-static void set_multicast_list(struct net_device *dev); +-static void fec_restart(struct net_device *dev, int duplex); ++static void fec_enet_mii(struct net_device *dev); + static void fec_stop(struct net_device *dev); +-static void fec_set_mac_address(struct net_device *dev); ++static void _fec_set_mac_address(struct net_device *dev); + ++/* ++ * fec_copy_threshold controls the copy when receiving ethernet frame. ++ * If ethernet header is aligned on a 4byte boundary, the ip header and ++ * higher level header will not be aligned. ++ * The reason is, that an ethernet header is 14bytes long. ++ * And the max size of tcp & ip header is 128bytes. Normally it is 40bytes. ++ * So I set the default value between 128 to 256. ++ */ ++static int fec_copy_threshold = 192; + + /* MII processing. We keep this as simple as possible. Requests are + * placed on the list (if there is room). When the request is finished +@@ -232,14 +324,16 @@ typedef struct mii_list { + struct mii_list *mii_next; + } mii_list_t; + ++#ifndef CONFIG_PHYLIB + #define NMII 20 + static mii_list_t mii_cmds[NMII]; + static mii_list_t *mii_free; + static mii_list_t *mii_head; + static mii_list_t *mii_tail; + +-static int mii_queue(struct net_device *dev, int request, +- void (*func)(uint, struct net_device *)); ++static int mii_queue(struct net_device *dev, int request, ++ void (*func)(uint, struct net_device *)); ++#endif + + /* Make MII read/write commands for the FEC. + */ +@@ -284,87 +378,233 @@ 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 */ + ++#ifndef DEBUG ++static inline unsigned long fec_reg_read(struct fec_enet_private *fep, unsigned int reg) ++{ ++ return readl(fep->reg_base + reg); ++} ++ ++static inline void fec_reg_write(struct fec_enet_private *fep, unsigned int reg, unsigned long val) ++{ ++ writel(val, fep->reg_base + reg); ++} ++#else ++#define fec_reg_read(fep, reg) __fec_reg_read(fep, reg, __FUNCTION__, #reg) ++#define fec_reg_write(fep, reg, val) __fec_reg_write(fep, reg, val, __FUNCTION__, #reg) ++ ++static inline unsigned long __fec_reg_read(struct fec_enet_private *fep, unsigned int reg, ++ const char *func, const char *reg_name) ++{ ++ unsigned long val = readl(fep->reg_base + reg); ++ DBG(3, "%s: Read %08lx from %s(%03x)\n", func, val, reg_name, reg); ++ return val; ++} ++ ++static inline void __fec_reg_write(struct fec_enet_private *fep, unsigned int reg, ++ unsigned long val, const char *func, const char *reg_name) ++{ ++ DBG(3, "%s: Writing %08lx to %s(%03x)\n", func, val, reg_name, reg); ++ writel(val, fep->reg_base + reg); ++} ++#endif ++ ++static inline void fec_enet_cbd_get(struct fec_enet_private *fep) ++{ ++ DBG(2, "%s: Requesting cbd area: %08lx\n", __FUNCTION__, ++ (unsigned long)fep->cbd_phys_base); ++ dma_sync_single_for_cpu(fep->dma_dev, fep->cbd_phys_base, ++ CBD_BUF_SIZE, DMA_BIDIRECTIONAL); ++} ++ ++static inline void fec_enet_cbd_put(struct fec_enet_private *fep) ++{ ++ DBG(2, "%s: Flushing changes to cbd area\n", __FUNCTION__); ++ dma_sync_single_for_device(fep->dma_dev, fep->cbd_phys_base, ++ CBD_BUF_SIZE, DMA_BIDIRECTIONAL); ++} ++ ++static inline void fec_enet_rxbuf_get(struct fec_enet_private *fep, cbd_t *bdp, ushort len) ++{ ++ DBG(2, "%s: Requesting RX buffer %08lx(%u)\n", __FUNCTION__, ++ (unsigned long)bdp->cbd_bufaddr, len); ++ dma_sync_single_for_cpu(fep->dma_dev, bdp->cbd_bufaddr, ++ len, DMA_FROM_DEVICE); ++} ++ ++static inline void fec_enet_rxbuf_put(struct fec_enet_private *fep, cbd_t *bdp, ushort len) ++{ ++ DBG(2, "%s: Releasing RX buffer %08lx(%u)\n", __FUNCTION__, (ulong)bdp->cbd_bufaddr, len); ++ dma_sync_single_for_device(fep->dma_dev, bdp->cbd_bufaddr, len, DMA_FROM_DEVICE); ++} ++ ++static inline void fec_enet_rxbuf_map(struct fec_enet_private *fep, cbd_t *bdp, ++ void *buf, ushort len) ++{ ++ BUG_ON(!dma_mapping_error(fep->dma_dev, bdp->cbd_bufaddr)); ++ bdp->cbd_bufaddr = dma_map_single(fep->dma_dev, buf, ++ len, DMA_FROM_DEVICE); ++ DBG(2, "%s: RX buffer %p(%u) mapped to %08lx\n", __FUNCTION__, ++ buf, len, (unsigned long)bdp->cbd_bufaddr); ++} ++ ++static inline void fec_enet_rxbuf_unmap(struct fec_enet_private *fep, cbd_t *bdp, ushort len) ++{ ++ DBG(2, "%s: Unmapping RX buffer %08lx(%u)\n", __FUNCTION__, ++ (unsigned long)bdp->cbd_bufaddr, len); ++ BUG_ON(dma_mapping_error(fep->dma_dev, bdp->cbd_bufaddr)); ++ dma_unmap_single(fep->dma_dev, bdp->cbd_bufaddr, ++ len, DMA_FROM_DEVICE); ++ bdp->cbd_bufaddr = ~0; ++} ++ ++static inline void fec_enet_txbuf_map(struct fec_enet_private *fep, cbd_t *bdp, ++ void *buf, ushort len) ++{ ++ BUG_ON(!dma_mapping_error(fep->dma_dev, bdp->cbd_bufaddr)); ++ bdp->cbd_bufaddr = dma_map_single(fep->dma_dev, buf, ++ len, DMA_TO_DEVICE); ++ DBG(2, "%s: TX buffer %p(%u) mapped to %08lx\n", __FUNCTION__, ++ buf, len, (unsigned long)bdp->cbd_bufaddr); ++} ++ ++static inline void fec_enet_txbuf_unmap(struct fec_enet_private *fep, cbd_t *bdp, ushort len) ++{ ++ DBG(2, "%s: Unmapping TX buffer %08lx(%u)\n", __FUNCTION__, ++ (unsigned long)bdp->cbd_bufaddr, len); ++ BUG_ON(dma_mapping_error(fep->dma_dev, bdp->cbd_bufaddr)); ++ dma_unmap_single(fep->dma_dev, bdp->cbd_bufaddr, ++ len, DMA_TO_DEVICE); ++ bdp->cbd_bufaddr = ~0; ++} ++ ++static inline void fec_enet_txbuf_get(struct fec_enet_private *fep, cbd_t *bdp, ushort len) ++{ ++ DBG(2, "%s: Requesting TX buffer %08lx(%u)\n", __FUNCTION__, ++ (unsigned long)bdp->cbd_bufaddr, len); ++ dma_sync_single_for_cpu(fep->dma_dev, bdp->cbd_bufaddr, ++ len, DMA_TO_DEVICE); ++} ++ ++static inline void fec_enet_txbuf_put(struct fec_enet_private *fep, cbd_t *bdp, ushort len) ++{ ++ DBG(2, "%s: Releasing TX buffer %08lx(%u)\n", __FUNCTION__, ++ (unsigned long)bdp->cbd_bufaddr, len); ++ 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) + { +- struct fec_enet_private *fep; +- volatile fec_t *fecp; +- volatile cbd_t *bdp; +- unsigned short status; ++ struct fec_enet_private *fep = netdev_priv(dev); ++ cbd_t *bdp; ++ unsigned short status; + unsigned long flags; + +- fep = netdev_priv(dev); +- fecp = (volatile fec_t*)dev->base_addr; +- +- if (!fep->link) { ++ if (!fep->linkstatus) { ++ DBG(0, "%s: Cannot send packet; link is down\n", __FUNCTION__); + /* Link is down or autonegotiation is in progress. */ + return 1; + } + +- 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 */ + bdp = fep->cur_tx; + + status = bdp->cbd_sc; +-#ifndef final_version ++#ifdef DEBUG + if (status & BD_ENET_TX_READY) { + /* Ooops. All transmit buffers are full. Bail out. + * This should not happen, since dev->tbusy should be set. + */ + printk("%s: tx queue full!.\n", dev->name); +- spin_unlock_irqrestore(&fep->hw_lock, flags); ++ fec_enet_cbd_put(fep); ++ spin_unlock_irqrestore(&fep->lock, flags); + return 1; + } + #endif +- + /* Clear all of the status flags. + */ + status &= ~BD_ENET_TX_STATS; + + /* Set buffer length and buffer pointer. + */ +- 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 + * 4-byte boundaries. Use bounce buffers to copy data + * and get it aligned. Ugh. + */ +- if (bdp->cbd_bufaddr & FEC_ALIGNMENT) { ++ if (unlikely((bdp->cbd_bufaddr) & FEC_ALIGNMENT)) { + unsigned int index; + index = bdp - fep->tx_bd_base; +- memcpy(fep->tx_bounce[index], (void *)skb->data, skb->len); +- bdp->cbd_bufaddr = __pa(fep->tx_bounce[index]); ++ memcpy(fep->tx_bounce[index], skb->data, skb->len); ++ fec_enet_txbuf_map(fep, bdp, fep->tx_bounce[index], skb->len); ++ } else { ++ fec_enet_txbuf_map(fep, bdp, skb->data, skb->len); + } + + /* Save skb pointer. + */ + fep->tx_skbuff[fep->skb_cur] = skb; + +- dev->stats.tx_bytes += skb->len; +- fep->skb_cur = (fep->skb_cur+1) & TX_RING_MOD_MASK; +- +- /* Push the data cache so the CPM does not get stale memory +- * data. +- */ +- dma_sync_single(NULL, bdp->cbd_bufaddr, +- bdp->cbd_datlen, DMA_TO_DEVICE); ++ fep->stats.tx_bytes += skb->len; ++ fep->skb_cur = (fep->skb_cur + 1) & TX_RING_MOD_MASK; + + /* Send it on its way. Tell FEC it's ready, interrupt when done, + * it's the last BD of the frame, and to put the CRC on the end. + */ +- + status |= (BD_ENET_TX_READY | BD_ENET_TX_INTR + | BD_ENET_TX_LAST | BD_ENET_TX_TC); + bdp->cbd_sc = status; + + dev->trans_start = jiffies; + +- /* Trigger transmission start */ +- fecp->fec_x_des_active = 0; +- + /* 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, + + if (bdp == fep->dirty_tx) { + fep->tx_full = 1; ++ DBG(0, "TX ring full, stopping netif queue\n"); + netif_stop_queue(dev); + } + +- 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; + } +@@ -390,101 +640,126 @@ fec_timeout(struct net_device *dev) + { + struct fec_enet_private *fep = netdev_priv(dev); + +- printk("%s: transmit timed out.\n", dev->name); +- dev->stats.tx_errors++; +-#ifndef final_version ++ printk(KERN_WARNING "%s: transmit timed out.\n", dev->name); ++ fep->stats.tx_errors++; ++#ifdef DEBUG + { +- int i; +- cbd_t *bdp; ++ int i; ++ cbd_t *bdp; + +- printk("Ring data dump: cur_tx %lx%s, dirty_tx %lx cur_rx: %lx\n", +- (unsigned long)fep->cur_tx, fep->tx_full ? " (full)" : "", +- (unsigned long)fep->dirty_tx, +- (unsigned long)fep->cur_rx); ++ fec_enet_cbd_get(fep); + +- bdp = fep->tx_bd_base; +- printk(" tx: %u buffers\n", TX_RING_SIZE); +- for (i = 0 ; i < TX_RING_SIZE; i++) { +- printk(" %08x: %04x %04x %08x\n", +- (uint) bdp, +- bdp->cbd_sc, +- bdp->cbd_datlen, +- (int) bdp->cbd_bufaddr); +- bdp++; +- } ++ printk(KERN_DEBUG "%s: Ring data dump: cur_tx %p%s, dirty_tx %p cur_rx: %p\n", ++ __FUNCTION__, ++ fep->cur_tx, fep->tx_full ? " (full)" : "", ++ fep->dirty_tx, ++ fep->cur_rx); + +- bdp = fep->rx_bd_base; +- printk(" rx: %lu buffers\n", (unsigned long) RX_RING_SIZE); +- for (i = 0 ; i < RX_RING_SIZE; i++) { +- printk(" %08x: %04x %04x %08x\n", +- (uint) bdp, +- bdp->cbd_sc, +- bdp->cbd_datlen, +- (int) bdp->cbd_bufaddr); +- bdp++; +- } ++ bdp = fep->tx_bd_base; ++ printk(" tx: %u buffers\n", TX_RING_SIZE); ++ for (i = 0; i < TX_RING_SIZE; i++) { ++ printk(" %p: %04x %04x %08x\n", ++ bdp, ++ bdp->cbd_sc, ++ bdp->cbd_datlen, ++ bdp->cbd_bufaddr); ++ bdp++; ++ } ++ ++ bdp = fep->rx_bd_base; ++ printk(" rx: %lu buffers\n", RX_RING_SIZE); ++ for (i = 0; i < RX_RING_SIZE; i++) { ++ printk(" %p: %04x %04x %08x\n", ++ bdp, ++ bdp->cbd_sc, ++ bdp->cbd_datlen, ++ bdp->cbd_bufaddr); ++ bdp++; ++ } ++ fec_enet_cbd_put(fep); + } + #endif + fec_restart(dev, fep->full_duplex); +- netif_wake_queue(dev); ++ DBG(0, "%s: Scheduling netif queue\n", __FUNCTION__); ++ //netif_schedule(dev); + } + + /* The interrupt handler. + * This is called from the MPC core interrupt. + */ + static irqreturn_t +-fec_enet_interrupt(int irq, void * dev_id) ++fec_enet_interrupt(int irq, void *dev_id) + { +- struct net_device *dev = dev_id; +- volatile fec_t *fecp; +- uint int_events; +- irqreturn_t ret = IRQ_NONE; +- +- fecp = (volatile fec_t*)dev->base_addr; ++ struct net_device *dev = dev_id; ++ struct fec_enet_private *fep = netdev_priv(dev); ++ uint int_events; ++ int handled = 0; ++ unsigned int eimr = fec_reg_read(fep, FEC_EIMR); + ++ DBG(2, "%s: %08lx:%08lx\n", __FUNCTION__, ++ fec_reg_read(fep, FEC_EIR), fec_reg_read(fep, FEC_EIMR)); + /* Get the interrupt events that caused us to be here. + */ +- do { +- int_events = fecp->fec_ievent; +- fecp->fec_ievent = int_events; ++ while ((int_events = fec_reg_read(fep, FEC_EIR) & FEC_ENET_MASK) != 0) { ++ if (int_events & ~eimr) { ++ printk(KERN_WARNING "%s: masked interrupt condition: %08x\n", ++ __FUNCTION__, int_events & ~eimr); ++ } ++ ++ fec_reg_write(fep, FEC_EIR, int_events); + + /* Handle receive event in its own function. + */ +- if (int_events & FEC_ENET_RXF) { +- ret = IRQ_HANDLED; ++ if (int_events & (FEC_ENET_RXF | FEC_ENET_RXB)) { ++ DBG(2, "%s: Handling RX Interrupt\n", __FUNCTION__); ++ handled = 1; + fec_enet_rx(dev); + } + ++ if (int_events & FEC_ENET_UN) { ++ printk(KERN_WARNING "TX fifo underrun"); ++ } + /* Transmit OK, or non-fatal error. Update the buffer + descriptors. FEC handles all errors, we just discover + them as part of the transmit process. + */ +- if (int_events & FEC_ENET_TXF) { +- ret = IRQ_HANDLED; ++ if (int_events & (FEC_ENET_TXF | FEC_ENET_TXB)) { ++ DBG(2, "%s: Handling TX Interrupt\n", __FUNCTION__); ++ handled = 1; + fec_enet_tx(dev); + } + +- if (int_events & FEC_ENET_MII) { +- ret = IRQ_HANDLED; ++ if (int_events & (FEC_ENET_MII | FEC_ENET_HBERR)) { ++ DBG(2, "%s: Handling MII Interrupt\n", __FUNCTION__); ++ handled = 1; + fec_enet_mii(dev); + } +- +- } while (int_events); +- +- return ret; ++ } ++ return IRQ_RETVAL(handled); + } + ++static void fec_free_skb(struct fec_enet_private *fep, cbd_t *bdp, struct sk_buff **pskb) ++{ ++ struct sk_buff *skb = *pskb; ++ if (!dma_mapping_error(fep->dma_dev, bdp->cbd_bufaddr)) { ++ fec_enet_txbuf_unmap(fep, bdp, skb->len); ++ } ++ dev_kfree_skb_any(skb); ++ *pskb = NULL; ++} + + static void + fec_enet_tx(struct net_device *dev) + { +- struct fec_enet_private *fep; +- volatile cbd_t *bdp; ++ struct fec_enet_private *fep = netdev_priv(dev); ++ cbd_t *bdp; + unsigned short status; +- struct sk_buff *skb; ++ struct sk_buff *skb; + +- fep = netdev_priv(dev); +- 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) + if (status & (BD_ENET_TX_HB | BD_ENET_TX_LC | + BD_ENET_TX_RL | BD_ENET_TX_UN | + BD_ENET_TX_CSL)) { +- dev->stats.tx_errors++; ++ fep->stats.tx_errors++; + if (status & BD_ENET_TX_HB) /* No heartbeat */ +- dev->stats.tx_heartbeat_errors++; ++ fep->stats.tx_heartbeat_errors++; + if (status & BD_ENET_TX_LC) /* Late collision */ +- dev->stats.tx_window_errors++; ++ fep->stats.tx_window_errors++; + if (status & BD_ENET_TX_RL) /* Retrans limit */ +- dev->stats.tx_aborted_errors++; ++ fep->stats.tx_aborted_errors++; + if (status & BD_ENET_TX_UN) /* Underrun */ +- dev->stats.tx_fifo_errors++; ++ fep->stats.tx_fifo_errors++; + if (status & BD_ENET_TX_CSL) /* Carrier lost */ +- dev->stats.tx_carrier_errors++; ++ fep->stats.tx_carrier_errors++; + } else { +- dev->stats.tx_packets++; ++ fep->stats.tx_packets++; + } + +-#ifndef final_version ++#ifdef DEBUG + 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) + * 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); +- fep->tx_skbuff[fep->skb_dirty] = NULL; ++ fec_free_skb(fep, bdp, &fep->tx_skbuff[fep->skb_dirty]); + 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) + */ + if (fep->tx_full) { + fep->tx_full = 0; +- if (netif_queue_stopped(dev)) ++ if (netif_queue_stopped(dev)) { ++ DBG(0, "%s: Waking up netif queue\n", __FUNCTION__); + netif_wake_queue(dev); ++ } + } + } +- fep->dirty_tx = (cbd_t *)bdp; +- spin_unlock_irq(&fep->hw_lock); ++ fec_enet_cbd_put(fep); ++ fep->dirty_tx = bdp; ++ spin_unlock(&fep->lock); + } + + +@@ -555,22 +834,22 @@ fec_enet_tx(struct net_device *dev) + static void + fec_enet_rx(struct net_device *dev) + { +- struct fec_enet_private *fep; +- volatile fec_t *fecp; +- volatile cbd_t *bdp; ++ struct fec_enet_private *fep = netdev_priv(dev); ++ cbd_t *bdp; + unsigned short status; +- struct sk_buff *skb; +- ushort pkt_len; +- __u8 *data; ++ struct sk_buff *skb; ++ ushort pkt_len; ++ int rx_index; + + #ifdef CONFIG_M532x ++ /* This is probably nonsense ++ Proper use of dma-mapping functions should make this obsolete ++ */ + flush_cache_all(); + #endif +- +- fep = netdev_priv(dev); +- fecp = (volatile fec_t*)dev->base_addr; +- +- spin_lock_irq(&fep->hw_lock); ++ /* reserve the dual port memory area for our use */ ++ //WARN_ON(fec_reg_read(fep, FEC_RDAR) & RDAR_BUSY); ++ fec_enet_cbd_get(fep); + + /* 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) + bdp = fep->cur_rx; + + while (!((status = bdp->cbd_sc) & BD_ENET_RX_EMPTY)) { +- +-#ifndef final_version ++ rx_index = bdp - fep->rx_bd_base; ++#ifdef DEBUG + /* Since we have allocated space to hold a complete frame, + * the last indicator should be set. + */ +- if ((status & BD_ENET_RX_LAST) == 0) +- printk("FEC ENET: rcv is not +last\n"); ++ WARN_ON(!(status & BD_ENET_RX_LAST)); + #endif + +- if (!fep->opened) ++ if (WARN_ON(!fep->opened)) { ++ DBG(0, "%s: Driver not opened; ignoring packet\n", __FUNCTION__); ++#if 0 + goto rx_processing_done; +- ++#endif ++ } + /* Check for errors. */ + if (status & (BD_ENET_RX_LG | BD_ENET_RX_SH | BD_ENET_RX_NO | + BD_ENET_RX_CR | BD_ENET_RX_OV)) { +- dev->stats.rx_errors++; ++ fep->stats.rx_errors++; + if (status & (BD_ENET_RX_LG | BD_ENET_RX_SH)) { + /* Frame too long or too short. */ +- dev->stats.rx_length_errors++; ++ fep->stats.rx_length_errors++; + } + if (status & BD_ENET_RX_NO) /* Frame alignment */ +- dev->stats.rx_frame_errors++; ++ fep->stats.rx_frame_errors++; + if (status & BD_ENET_RX_CR) /* CRC Error */ +- dev->stats.rx_crc_errors++; ++ fep->stats.rx_crc_errors++; + if (status & BD_ENET_RX_OV) /* FIFO overrun */ +- dev->stats.rx_fifo_errors++; ++ fep->stats.rx_fifo_errors++; + } + + /* Report late collisions as a frame error. +@@ -611,39 +892,91 @@ 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) { +- dev->stats.rx_errors++; +- dev->stats.rx_frame_errors++; ++ 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 + /* Process the incoming frame. + */ +- dev->stats.rx_packets++; ++ fep->stats.rx_packets++; + pkt_len = bdp->cbd_datlen; +- dev->stats.rx_bytes += pkt_len; +- data = (__u8*)__va(bdp->cbd_bufaddr); +- +- dma_sync_single(NULL, (unsigned long)__pa(data), +- pkt_len - 4, DMA_FROM_DEVICE); ++ fep->stats.rx_bytes += pkt_len; + + /* This does 16 byte alignment, exactly what we need. + * The packet length includes FCS, but we don't want to + * include that when passing upstream as it messes up + * bridging applications. + */ +- skb = dev_alloc_skb(pkt_len-4); ++ if ((pkt_len - 4) < fec_copy_threshold) { ++ skb = dev_alloc_skb(pkt_len); ++ } else { ++ skb = dev_alloc_skb(FEC_ENET_RX_FRSIZE); ++ } + + if (skb == NULL) { + printk("%s: Memory squeeze, dropping packet.\n", dev->name); +- dev->stats.rx_dropped++; ++ fep->stats.rx_dropped++; + } else { +- skb_put(skb,pkt_len-4); /* Make room */ +- skb_copy_to_linear_data(skb, data, pkt_len-4); +- skb->protocol=eth_type_trans(skb,dev); ++ if ((pkt_len - 4) < fec_copy_threshold) { ++ /* skip 2 bytes, so IP header is on a 4 bytes boundary */ ++ skb_reserve(skb, 2); ++ skb_put(skb, pkt_len - 4); /* Make room */ ++ fec_enet_rxbuf_get(fep, bdp, pkt_len - 4); ++ skb_copy_to_linear_data(skb, ++ fep->rx_skbuff[rx_index]->data, ++ pkt_len - 4); ++ fec_enet_rxbuf_put(fep, bdp, pkt_len - 4); ++ } else { ++ struct sk_buff *pskb = fep->rx_skbuff[rx_index]; ++ ++ /* unmap the skb we are going to hand down to the network layer */ ++ fec_enet_rxbuf_unmap(fep, bdp, FEC_ENET_RX_FRSIZE); ++ ++ /* init the newly allocated skb */ ++ fep->rx_skbuff[rx_index] = skb; ++ skb->data = FEC_ADDR_ALIGNMENT(skb->data); ++ /* map the newly allocated skb's data buffer for DMA */ ++ fec_enet_rxbuf_map(fep, bdp, skb->data, FEC_ENET_RX_FRSIZE); ++ ++ skb_put(pskb, pkt_len - 4); /* Make room */ ++ skb = pskb; ++ } ++ skb->dev = dev; ++ skb->protocol = eth_type_trans(skb, dev); + netif_rx(skb); + } + 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 + status |= BD_ENET_RX_EMPTY; + bdp->cbd_sc = status; + ++ /* release the dual port memory area for use by the FEC hardware */ ++ fec_enet_cbd_put(fep); ++ + /* Update BD pointer to next entry. + */ + if (status & BD_ENET_RX_WRAP) +@@ -665,10 +1001,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. + */ +- fecp->fec_r_des_active = 0; ++ fec_reg_write(fep, FEC_RDAR, DONT_CARE); + #endif + } /* while (!((status = bdp->cbd_sc) & BD_ENET_RX_EMPTY)) */ +- fep->cur_rx = (cbd_t *)bdp; ++ fep->cur_rx = bdp; + + #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 + * our way back to the interrupt return only to come right back + * here. + */ +- fecp->fec_r_des_active = 0; ++ fec_reg_write(fep, FEC_RDAR, DONT_CARE); + #endif +- +- spin_unlock_irq(&fep->hw_lock); + } + +- ++#ifdef CONFIG_PHYLIB + /* called from interrupt context */ ++static void fec_enet_mii(struct net_device *dev) ++{ ++ struct fec_enet_private *fep = netdev_priv(dev); ++ fep->mii_complete = 1; ++} ++#else + static void + fec_enet_mii(struct net_device *dev) + { +- struct fec_enet_private *fep; +- volatile fec_t *ep; ++ struct fec_enet_private *fep = netdev_priv(dev); + mii_list_t *mip; + uint mii_reg; + +- fep = netdev_priv(dev); +- spin_lock_irq(&fep->mii_lock); ++ mii_reg = fec_reg_read(fep, FEC_MMFR); + +- ep = fep->hwp; +- mii_reg = ep->fec_mii_data; ++ spin_lock(&fep->lock); + + if ((mip = mii_head) == NULL) { + printk("MII and no head!\n"); +@@ -713,27 +1050,27 @@ fec_enet_mii(struct net_device *dev) + mii_free = mip; + + if ((mip = mii_head) != NULL) +- ep->fec_mii_data = mip->mii_regval; ++ fec_reg_write(fep, FEC_MMFR, mip->mii_regval); + + unlock: +- spin_unlock_irq(&fep->mii_lock); ++ spin_unlock(&fep->lock); + } + + static int + mii_queue(struct net_device *dev, int regval, void (*func)(uint, struct net_device *)) + { +- struct fec_enet_private *fep; ++ struct fec_enet_private *fep = netdev_priv(dev); + unsigned long flags; + mii_list_t *mip; + int retval; + ++ retval = 0; ++ ++ spin_lock_irqsave(&fep->lock,flags); ++ + /* Add PHY address to register command. + */ +- fep = netdev_priv(dev); +- spin_lock_irqsave(&fep->mii_lock, flags); +- + regval |= fep->phy_addr << 23; +- retval = 0; + + if ((mip = mii_free) != NULL) { + mii_free = mip->mii_next; +@@ -745,32 +1082,32 @@ mii_queue(struct net_device *dev, int re + mii_tail = mip; + } else { + mii_head = mii_tail = mip; +- fep->hwp->fec_mii_data = regval; ++ fec_reg_write(fep, FEC_MMFR, regval); + } + } else { + retval = 1; + } + +- spin_unlock_irqrestore(&fep->mii_lock, flags); +- return retval; ++ spin_unlock_irqrestore(&fep->lock,flags); ++ ++ return(retval); + } + + static void mii_do_cmd(struct net_device *dev, const phy_cmd_t *c) + { +- if(!c) +- return; ++ int k; + +- for (; c->mii_data != mk_mii_end; c++) +- mii_queue(dev, c->mii_data, c->funct); ++ for (k = 0; c != NULL && c[k].mii_data != mk_mii_end; k++) { ++ mii_queue(dev, c[k].mii_data, c[k].funct); ++ } + } + + static void mii_parse_sr(uint mii_reg, struct net_device *dev) + { + struct fec_enet_private *fep = netdev_priv(dev); +- volatile uint *s = &(fep->phy_status); + uint status; + +- status = *s & ~(PHY_STAT_LINK | PHY_STAT_FAULT | PHY_STAT_ANC); ++ status = fep->phy_status & ~(PHY_STAT_LINK | PHY_STAT_FAULT | PHY_STAT_ANC); + + if (mii_reg & 0x0004) + status |= PHY_STAT_LINK; +@@ -778,31 +1115,30 @@ static void mii_parse_sr(uint mii_reg, s + status |= PHY_STAT_FAULT; + if (mii_reg & 0x0020) + status |= PHY_STAT_ANC; +- *s = status; ++ ++ fep->phy_status = status; + } + + static void mii_parse_cr(uint mii_reg, struct net_device *dev) + { + struct fec_enet_private *fep = netdev_priv(dev); +- volatile uint *s = &(fep->phy_status); + uint status; + +- status = *s & ~(PHY_CONF_ANE | PHY_CONF_LOOP); ++ status = fep->phy_status & ~(PHY_CONF_ANE | PHY_CONF_LOOP); + + if (mii_reg & 0x1000) + status |= PHY_CONF_ANE; + if (mii_reg & 0x4000) + status |= PHY_CONF_LOOP; +- *s = status; ++ fep->phy_status = status; + } + + static void mii_parse_anar(uint mii_reg, struct net_device *dev) + { + struct fec_enet_private *fep = netdev_priv(dev); +- volatile uint *s = &(fep->phy_status); + uint status; + +- status = *s & ~(PHY_CONF_SPMASK); ++ status = fep->phy_status & ~(PHY_CONF_SPMASK); + + if (mii_reg & 0x0020) + status |= PHY_CONF_10HDX; +@@ -812,7 +1148,7 @@ static void mii_parse_anar(uint mii_reg, + status |= PHY_CONF_100HDX; + if (mii_reg & 0x00100) + status |= PHY_CONF_100FDX; +- *s = status; ++ fep->phy_status = status; + } + + /* ------------------------------------------------------------------------- */ +@@ -827,10 +1163,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); +- volatile uint *s = &(fep->phy_status); + uint status; + +- status = *s & ~(PHY_STAT_SPMASK); ++ status = fep->phy_status & ~(PHY_STAT_SPMASK); + if (mii_reg & 0x0800) { + if (mii_reg & 0x1000) + status |= PHY_STAT_100FDX; +@@ -842,7 +1177,7 @@ static void mii_parse_lxt970_csr(uint mi + else + status |= PHY_STAT_10HDX; + } +- *s = status; ++ fep->phy_status = status; + } + + static phy_cmd_t const phy_cmd_lxt970_config[] = { +@@ -898,16 +1233,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); +- volatile uint *s = &(fep->phy_status); + uint status; + +- status = *s & ~(PHY_STAT_SPMASK | PHY_STAT_LINK | PHY_STAT_ANC); ++ status = fep->phy_status & ~(PHY_STAT_SPMASK | PHY_STAT_LINK | PHY_STAT_ANC); + + if (mii_reg & 0x0400) { +- fep->link = 1; ++ fep->linkstatus = 1; + status |= PHY_STAT_LINK; + } else { +- fep->link = 0; ++ fep->linkstatus = 0; + } + if (mii_reg & 0x0080) + status |= PHY_STAT_ANC; +@@ -925,7 +1259,7 @@ static void mii_parse_lxt971_sr2(uint mi + if (mii_reg & 0x0008) + status |= PHY_STAT_FAULT; + +- *s = status; ++ fep->phy_status = status; + } + + static phy_cmd_t const phy_cmd_lxt971_config[] = { +@@ -982,10 +1316,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); +- volatile uint *s = &(fep->phy_status); + uint status; + +- status = *s & ~(PHY_STAT_SPMASK); ++ status = fep->phy_status & ~(PHY_STAT_SPMASK); + + switch((mii_reg >> 2) & 7) { + case 1: status |= PHY_STAT_10HDX; break; +@@ -994,7 +1327,7 @@ static void mii_parse_qs6612_pcr(uint mi + case 6: status |= PHY_STAT_100FDX; break; + } + +- *s = status; ++ fep->phy_status = status; + } + + static phy_cmd_t const phy_cmd_qs6612_config[] = { +@@ -1052,10 +1385,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); +- volatile uint *s = &(fep->phy_status); + uint status; + +- status = *s & ~(PHY_STAT_SPMASK | PHY_STAT_ANC); ++ status = fep->phy_status & ~(PHY_STAT_SPMASK | PHY_STAT_ANC); + + if (mii_reg & 0x0080) + status |= PHY_STAT_ANC; +@@ -1064,7 +1396,7 @@ static void mii_parse_am79c874_dr(uint m + else + status |= ((mii_reg & 0x0800) ? PHY_STAT_10FDX : PHY_STAT_10HDX); + +- *s = status; ++ fep->phy_status = status; + } + + static phy_cmd_t const phy_cmd_am79c874_config[] = { +@@ -1107,7 +1439,7 @@ static phy_info_t const phy_info_am79c87 + /* register definitions for the 8721 */ + + #define MII_KS8721BL_RXERCR 21 +-#define MII_KS8721BL_ICSR 27 ++#define MII_KS8721BL_ICSR 22 + #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 + static void mii_parse_dp8384x_sr2(uint mii_reg, struct net_device *dev) + { + struct fec_enet_private *fep = netdev_priv(dev); +- volatile uint *s = &(fep->phy_status); + +- *s &= ~(PHY_STAT_SPMASK | PHY_STAT_LINK | PHY_STAT_ANC); ++ fep->phy_status &= ~(PHY_STAT_SPMASK | PHY_STAT_LINK | PHY_STAT_ANC); + + /* Link up */ + if (mii_reg & 0x0001) { +- fep->link = 1; +- *s |= PHY_STAT_LINK; ++ fep->linkstatus = 1; ++ fep->phy_status |= PHY_STAT_LINK; + } else +- fep->link = 0; ++ fep->linkstatus = 0; + /* Status of link */ + if (mii_reg & 0x0010) /* Autonegotioation complete */ +- *s |= PHY_STAT_ANC; ++ fep->phy_status |= PHY_STAT_ANC; + if (mii_reg & 0x0002) { /* 10MBps? */ + if (mii_reg & 0x0004) /* Full Duplex? */ +- *s |= PHY_STAT_10FDX; ++ fep->phy_status |= PHY_STAT_10FDX; + else +- *s |= PHY_STAT_10HDX; ++ fep->phy_status |= PHY_STAT_10HDX; + } else { /* 100 Mbps? */ + if (mii_reg & 0x0004) /* Full Duplex? */ +- *s |= PHY_STAT_100FDX; ++ fep->phy_status |= PHY_STAT_100FDX; + else +- *s |= PHY_STAT_100HDX; ++ fep->phy_status |= PHY_STAT_100HDX; + } + if (mii_reg & 0x0008) +- *s |= PHY_STAT_FAULT; ++ fep->phy_status |= PHY_STAT_FAULT; + } + + static phy_info_t phy_info_dp83848= { +@@ -1211,92 +1542,362 @@ static phy_info_t const * const phy_info + &phy_info_dp83848, + NULL + }; +- +-/* ------------------------------------------------------------------------- */ +-#ifdef HAVE_mii_link_interrupt +-static irqreturn_t +-mii_link_interrupt(int irq, void * dev_id); ++#endif + + /* +- * This is specific to the MII interrupt setup of the M5272EVB. ++ * do some initializtion based architecture of this chip ++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; +-} +-#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) ++ 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__, ++ fep->linkstatus, phydev->link, fep->full_duplex ? "full" : "half", ++ phydev->duplex ? "full" : "half"); ++ if (phydev->link) { ++ fec_restart(dev, phydev->duplex); ++ } else { ++ fec_stop(dev); ++ } ++ if (fep->linkstatus != phydev->link && netif_msg_link(fep)) { ++ phy_print_status(phydev); ++ } ++ fep->linkstatus = phydev->link; ++#if 0 ++ int i; ++ for (i = 0; i < 32; i++) { ++ DBG(0, "%s: PHY reg[%02x]=%04x\n", __FUNCTION__, i, ++ fec_mii_read(fep->mii, fep->phy_addr, i)); ++ } ++#endif ++ } ++} ++#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; ++ 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; ++ } ++ fec_restart(dev, duplex); ++ 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]; ++ 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 fec_phy_timer(unsigned long data) + { ++ struct net_device *dev = (struct net_device *)data; + struct fec_enet_private *fep = netdev_priv(dev); +- volatile uint *s = &(fep->phy_status); ++ 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 ++ ++/* ++ * 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); ++ ++ fep->etn_irq = platform_get_irq(pdev, 0); ++ fep->mii_irq = platform_get_irq(pdev, 1); ++ ++ /* Setup interrupt handlers. */ ++ ret = request_irq(fep->etn_irq, fec_enet_interrupt, 0, "fec", dev); ++ if (ret != 0) { ++ printk(KERN_ERR "FEC: Could not allocate FEC IRQ(%d)!\n", fep->etn_irq); ++ return ret; ++ } ++#ifndef CONFIG_PHYLIB ++ if (fep->mii_irq >= 0) { ++ /* TODO: disable now due to CPLD issue */ ++ ret = request_irq(fep->mii_irq, mii_link_interrupt, 0, "fec(MII)", dev); ++ if (ret != 0) { ++ printk(KERN_ERR "FEC: Could not allocate FEC(MII) IRQ(%d)!\n", ++ fep->mii_irq); ++ free_irq(fep->etn_irq, dev); ++ return ret; ++ } ++ /* ++ * 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. ++ */ ++ fep->phy_int_enabled = 1; ++ } else { ++ fep->phy_timer = kzalloc(sizeof(struct timer_list), GFP_KERNEL); ++ if (fep->phy_timer == NULL) { ++ free_irq(fep->etn_irq, dev); ++ return -ENOMEM; ++ } ++ init_timer(fep->phy_timer); ++ fep->phy_timer->function = fec_phy_timer; ++ fep->phy_timer->data = (unsigned long)dev; ++ fec_link_change(dev); ++ } ++#endif ++ ++ return 0; ++} ++ ++static void fec_release_intrs(struct net_device *dev) ++{ ++ struct fec_enet_private *fep = netdev_priv(dev); ++ ++ free_irq(fep->etn_irq, dev); ++#ifndef CONFIG_PHYLIB ++ if (fep->mii_irq >= 0) { ++ free_irq(fep->mii_irq, dev); ++ } ++#endif ++} ++ ++#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 ++ ++#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) ++ ++#ifndef DEBUG ++static inline unsigned long fec_reg_read16(struct fec_enet_private *fep, unsigned int reg) ++{ ++ return readw(fep->reg_base + reg); ++} ++ ++static inline void fec_reg_write(struct fec_enet_private *fep, unsigned int reg, unsigned long val) ++{ ++ writew(val, fep->reg_base + reg); ++} ++#else ++#define fec_reg_read16(fep, reg) __fec_reg_read16(fep, reg, __FUNCTION__, #reg) ++#define fec_reg_write16(fep, reg, val) __fec_reg_write16(fep, reg, val, __FUNCTION__, #reg) ++ ++static inline u16 __fec_reg_read16(struct fec_enet_private *fep, unsigned int reg, ++ const char *func, const char *reg_name) ++{ ++ u16 val = readw(fep->reg_base + reg); ++ DBG(0, "%s: Read %04x from %s(%03x)\n", func, val, reg_name, reg); ++ return val; ++} ++ ++static inline void __fec_reg_write16(struct fec_enet_private *fep, unsigned int reg, ++ u16 val, const char *func, const char *reg_name) ++{ ++ DBG(0, "%s: Writing %04x to %s(%03x)\n", func, val, reg_name, reg); ++ writew(val, fep->reg_base + reg); ++} ++#endif ++ ++static void fec_localhw_setup(struct net_device *dev) ++{ ++ struct fec_enet_private *fep = netdev_priv(dev); ++ int loops; ++ const int max_loops = 10000; ++ ++ /* ++ * Set up the MII gasket for RMII mode ++ */ ++ dev_dbg(&dev->dev, "enable RMII gasket\n"); ++ ++ /* disable the gasket and wait */ ++ fec_reg_write16(fep, FEC_MIIGSK_ENR, 0); ++ DBG(0, "%s: Waiting for RMII gasket idle\n", __FUNCTION__); ++ while (fec_reg_read16(fep, FEC_MIIGSK_ENR) & FEC_MIIGSK_ENR_READY) ++ udelay(1); ++ DBG(0, "%s: RMII gasket idle\n", __FUNCTION__); ++ ++ /* 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); ++ ++#if 1 ++ DBG(0, "%s: Waiting for RMII gasket ready\n", __FUNCTION__); ++ for (loops = 0; loops < max_loops; loops++) { ++ if (readw(fep->reg_base + FEC_MIIGSK_ENR) & FEC_MIIGSK_ENR_READY) ++ break; ++ udelay(1); ++ } ++ if (fec_reg_read16(fep, FEC_MIIGSK_ENR) & FEC_MIIGSK_ENR_READY) { ++ DBG(0, "%s: RMII gasket ready after %u loops\n", __FUNCTION__, loops); ++ } else { ++ DBG(0, "%s: RMII gasket NOT ready after %u loops\n", __FUNCTION__, loops); ++ } ++#endif ++} ++#else ++static inline void fec_localhw_setup(struct net_device *dev) ++{ ++} ++#endif ++ ++static int fec_set_mii(struct net_device *dev, struct fec_enet_private *fep) ++{ ++ unsigned long rate; ++ struct clk *clk; ++ ++ DBG(0, "%s: \n", __FUNCTION__); ++ ++ fec_reg_write(fep, FEC_RCR, OPT_FRAME_SIZE | RCR_MII_MODE); ++ fec_reg_write(fep, FEC_TCR, 0x00); ++ ++ /* ++ * Set MII speed to 2.5 MHz ++ */ ++ clk = clk_get(fep->dma_dev, NULL); ++ if (!IS_ERR(clk)) { ++ rate = clk_get_rate(clk); ++ clk_put(clk); ++ } else { ++ printk(KERN_ERR "Failed to get fec clock: %ld\n", PTR_ERR(clk)); ++ return PTR_ERR(clk); ++ } ++ fep->phy_speed = ((((rate + 4999999) / 2500000) / 2) & 0x3F) << 1; ++ fec_reg_write(fep, FEC_MSCR, fep->phy_speed); ++ DBG(0, "%s: clkdiv set to %u for MII clock %u at base clock %lu\n", ++ __FUNCTION__, fep->phy_speed >> 1, 2500000, rate); ++ DBG(0, "%s: actual MII clock is: %lu\n", __FUNCTION__, rate / (fep->phy_speed)); ++ ++ return 0; ++} ++ ++static const unsigned char default_mac[ETH_ALEN] = { ++ 0x00, 0x04, 0x9f, 0x00, 0x74, 0x4a, ++}; ++ ++#define FEC_IIM_BASE IO_ADDRESS(IIM_BASE_ADDR) ++static void fec_get_mac(struct net_device *dev) ++{ ++#if 1 ++ // keep bootloader assigned MAC address ++ struct fec_enet_private *fep = netdev_priv(dev); ++ unsigned long eth_addr = fec_reg_read(fep, FEC_PALR); ++ dev->dev_addr[0] = eth_addr >> 24; ++ dev->dev_addr[1] = eth_addr >> 16; ++ dev->dev_addr[2] = eth_addr >> 8; ++ dev->dev_addr[3] = eth_addr >> 0; ++ eth_addr = fec_reg_read(fep, FEC_PAUR); ++ dev->dev_addr[5] = eth_addr >> 16; ++ dev->dev_addr[4] = eth_addr >> 24; ++#else ++ int i; ++ unsigned long fec_mac_base = FEC_IIM_BASE + MXC_IIMKEY0; ++ ++ if (cpu_is_mx27_rev(CHIP_REV_2_0) > 0) { ++ fec_mac_base = FEC_IIM_BASE + MXC_IIMMAC; ++ } ++ ++ DBG(0, "%s: Reading MAC address from %08lx\n", __FUNCTION__, fec_mac_base); ++ for (i = 0; i < ETH_ALEN; i++) { ++ dev->dev_addr[ETH_ALEN - 1 - i] = __raw_readb(fec_mac_base + i * 4); ++ } ++ //memcpy(dev->dev_addr, default_mac, ETH_ALEN); ++#endif ++} ++ ++#ifdef CONFIG_PHYLIB ++static inline void fec_enable_phy_intr(struct fec_enet_private *fep) ++{ ++} ++static inline void fec_disable_phy_intr(struct fec_enet_private *fep) ++{ ++} ++static inline void fec_phy_ack_intr(struct fec_enet_private *fep) ++{ ++} ++#else ++static inline void fec_enable_phy_intr(struct fec_enet_private *fep) ++{ ++ if (!fep->phy_int_enabled) { ++ fep->phy_int_enabled = 1; ++ enable_irq(fep->mii_irq); ++ } ++} ++ ++static inline void fec_disable_phy_intr(struct fec_enet_private *fep) ++{ ++ if (fep->phy_int_enabled) { ++ disable_irq(fep->mii_irq); ++ fep->phy_int_enabled = 0; ++ } ++} ++ ++static inline void fec_phy_ack_intr(struct fec_enet_private *fep) ++{ ++ if (fep->phy_int_enabled) { ++ disable_irq(fep->mii_irq); ++ fep->phy_int_enabled = 0; ++ } ++} ++#endif ++ ++/* ------------------------------------------------------------------------- */ ++ ++#ifndef CONFIG_PHYLIB ++static void mii_display_status(struct net_device *dev) ++{ ++ struct fec_enet_private *fep = netdev_priv(dev); ++ ++ if (!fep->linkstatus && !fep->old_linkstatus) { ++ /* Link is still down - don't print anything */ + return; + } + + printk("%s: status: ", dev->name); + +- if (!fep->link) { ++ if (!fep->linkstatus) { + printk("link down"); + } else { + printk("link up"); + +- switch(*s & PHY_STAT_SPMASK) { ++ 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) ++ if (fep->phy_status & PHY_STAT_ANC) + printk(", auto-negotiation complete"); + } + +- if (*s & PHY_STAT_FAULT) ++ if (fep->phy_status & PHY_STAT_FAULT) + printk(", remote fault"); + + printk(".\n"); + } + +-static void mii_display_config(struct work_struct *work) ++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; + + /* +@@ -1326,7 +1926,7 @@ static void mii_display_config(struct wo + ** the workqueue. It is thus safe to allow to reuse it. + */ + fep->mii_phy_task_queued = 0; +- printk("%s: config: auto-negotiation ", dev->name); ++ //printk("%s: config: auto-negotiation ", dev->name); + + if (status & PHY_CONF_ANE) + printk("on"); +@@ -1351,11 +1951,21 @@ static void mii_display_config(struct wo + + fep->sequence_done = 1; + } ++#endif + +-static void mii_relink(struct work_struct *work) ++#ifndef CONFIG_PHYLIB ++static inline void *priv_netdev(struct fec_enet_private *fep) + { +- struct fec_enet_private *fep = container_of(work, struct fec_enet_private, phy_task); +- struct net_device *dev = fep->netdev; ++ /* ugly hack, stolen from include linux/netdevice.h */ ++ return (char *)fep - ((sizeof(struct net_device) ++ + NETDEV_ALIGN_CONST) ++ & ~NETDEV_ALIGN_CONST); ++} ++ ++static void mii_relink(struct work_struct *w) ++{ ++ struct fec_enet_private *fep = container_of(w, struct fec_enet_private, phy_task); ++ struct net_device *dev = priv_netdev(fep); + int duplex; + + /* +@@ -1363,23 +1973,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; +- fep->link = (fep->phy_status & PHY_STAT_LINK) ? 1 : 0; ++ fep->linkstatus = (fep->phy_status & PHY_STAT_LINK) ? 1 : 0; + mii_display_status(dev); +- fep->old_link = fep->link; ++ fep->old_linkstatus = fep->linkstatus; + +- if (fep->link) { ++ if (fep->linkstatus) { + duplex = 0; +- if (fep->phy_status +- & (PHY_STAT_100FDX | PHY_STAT_10FDX)) ++ if (fep->phy_status & (PHY_STAT_100FDX | PHY_STAT_10FDX)) { + duplex = 1; ++ } + fec_restart(dev, duplex); +- } else ++ } else { + fec_stop(dev); +- +-#if 0 +- enable_irq(fep->mii_irq); +-#endif +- ++ } + } + + /* mii_queue_relink is called in interrupt context from mii_link_interrupt */ +@@ -1429,15 +2035,14 @@ phy_cmd_t const phy_cmd_config[] = { + static void + mii_discover_phy3(uint mii_reg, struct net_device *dev) + { +- struct fec_enet_private *fep; ++ struct fec_enet_private *fep = netdev_priv(dev); + int i; + +- fep = netdev_priv(dev); + fep->phy_id |= (mii_reg & 0xffff); + printk("fec: PHY @ 0x%x, ID 0x%08x", fep->phy_addr, fep->phy_id); + +- for(i = 0; phy_info[i]; i++) { +- if(phy_info[i]->id == (fep->phy_id >> 4)) ++ for (i = 0; phy_info[i]; i++) { ++ if (phy_info[i]->id == (fep->phy_id >> 4)) + break; + } + +@@ -1456,13 +2061,9 @@ mii_discover_phy3(uint mii_reg, struct n + static void + mii_discover_phy(uint mii_reg, struct net_device *dev) + { +- struct fec_enet_private *fep; +- volatile fec_t *fecp; ++ struct fec_enet_private *fep = netdev_priv(dev); + uint phytype; + +- fep = netdev_priv(dev); +- fecp = fep->hwp; +- + 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 + */ + fep->phy_id = phytype << 16; + mii_queue(dev, mk_mii_read(MII_REG_PHYIR2), +- mii_discover_phy3); ++ mii_discover_phy3); + } else { + fep->phy_addr++; + mii_queue(dev, mk_mii_read(MII_REG_PHYIR1), +- mii_discover_phy); ++ mii_discover_phy); + } + } else { + printk("FEC: No PHY device found.\n"); + /* Disable external MII interface */ +- fecp->fec_mii_speed = fep->phy_speed = 0; +-#ifdef HAVE_mii_link_interrupt +- fec_disable_phy_intr(); +-#endif ++ fec_disable_phy_intr(fep); ++ fec_reg_write(fep, FEC_MSCR, 0); + } + } ++#endif + +-/* This interrupt occurs when the PHY detects a link change. +-*/ +-#ifdef HAVE_mii_link_interrupt ++#ifndef CONFIG_PHYLIB + static irqreturn_t +-mii_link_interrupt(int irq, void * dev_id) ++mii_link_interrupt(int irq, void *dev_id) + { +- struct net_device *dev = dev_id; ++ struct net_device *dev = dev_id; + struct fec_enet_private *fep = netdev_priv(dev); + +- fec_phy_ack_intr(); ++ DBG(0, "%s: \n", __FUNCTION__); + +-#if 0 +- disable_irq(fep->mii_irq); /* disable now, enable later */ +-#endif ++ fec_phy_ack_intr(fep); + +- mii_do_cmd(dev, fep->phy->ack_int); +- mii_do_cmd(dev, phy_cmd_relink); /* restart and display status */ ++ /* ++ * Some board will trigger phy interrupt before phy enable. ++ * And at that moment , fep->phy is not initialized. ++ */ ++ if (fep->phy) { ++ mii_do_cmd(dev, fep->phy->ack_int); ++ mii_do_cmd(dev, phy_cmd_relink); /* restart and display status */ ++ } + + return IRQ_HANDLED; + } +@@ -1511,16 +2113,31 @@ mii_link_interrupt(int irq, void * dev_i + static int + fec_enet_open(struct net_device *dev) + { ++ int ret = 0; + struct fec_enet_private *fep = netdev_priv(dev); + + /* I should reset the ring buffers here, but I don't yet know + * a simple way to do that. + */ +- fec_set_mac_address(dev); ++ DBG(0, "%s: \n", __FUNCTION__); ++ _fec_set_mac_address(dev); + +- fep->sequence_done = 0; +- fep->link = 0; ++#ifdef CONFIG_PHYLIB ++ fec_restart(dev, 0); + ++ ret = fec_connect_phy(dev, fep); ++ if (ret != 0) { ++ DBG(0, "%s: Failed to connect to PHY: %d\n", __FUNCTION__, ret); ++ return ret; ++ } ++ phy_start(fep->phy); ++ ++ fep->linkstatus = fep->phy->link; ++ //fec_restart(dev, 0); ++ DBG(0, "%s: Link status is: %d\n", __FUNCTION__, fep->linkstatus); ++#else ++ fep->linkstatus = 0; ++ fep->sequence_done = 0; + 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) + * based on this device does not implement a PHY interrupt, + * so we are never notified of link change. + */ +- fep->link = 1; ++ fep->linkstatus = 1; + } else { +- fep->link = 1; /* lets just try it and see */ ++ fep->linkstatus = 1; /* lets just try it and see */ + /* no phy, go full duplex, it's most likely a hub chip */ + fec_restart(dev, 1); + } +- +- netif_start_queue(dev); ++ fep->old_linkstatus = fep->linkstatus; ++#endif + fep->opened = 1; +- return 0; /* Success */ ++#if 1 ++ /* enable receiver */ ++ fec_reg_write(fep, FEC_RDAR, DONT_CARE); ++#endif ++ return ret; + } + + static int +@@ -1559,15 +2180,46 @@ fec_enet_close(struct net_device *dev) + { + struct fec_enet_private *fep = netdev_priv(dev); + +- /* Don't know what to do yet. +- */ ++ DBG(0, "%s: \n", __FUNCTION__); ++ + fep->opened = 0; +- netif_stop_queue(dev); +- fec_stop(dev); ++ if (fep->linkstatus) { ++ fec_stop(dev); ++ } ++#ifdef CONFIG_PHYLIB ++ if (fep->phy) { ++ DBG(0, "%s: Stopping PHY %p\n", __FUNCTION__, fep->phy); ++ phy_stop(fep->phy); + ++ DBG(0, "%s: Disconnecting PHY %p\n", __FUNCTION__, fep->phy); ++ phy_disconnect(fep->phy); ++ fep->phy = NULL; ++ } ++#endif ++#if 1 ++ /* Whack a reset. We should wait for this. ++ */ ++ fec_reg_write(fep, FEC_ECR, FEC_ECR_RESET); ++ udelay(10); ++ ++ /* Mask and clear outstanding MII command interrupts. ++ */ ++ fec_reg_write(fep, FEC_EIMR, 0); ++ fec_reg_write(fep, FEC_EIR, FEC_ENET_MII); ++ fec_disable_phy_intr(fep); ++ /* Switch off MII */ ++ fec_reg_write(fep, FEC_MSCR, 0); ++#endif + return 0; + } + ++static struct net_device_stats *fec_enet_get_stats(struct net_device *dev) ++{ ++ struct fec_enet_private *fep = netdev_priv(dev); ++ ++ return &fep->stats; ++} ++ + /* 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) + + static void set_multicast_list(struct net_device *dev) + { +- struct fec_enet_private *fep; +- volatile fec_t *ep; ++ struct fec_enet_private *fep = netdev_priv(dev); + struct dev_mc_list *dmi; + unsigned int i, j, bit, data, crc; + unsigned char hash; + +- fep = netdev_priv(dev); +- ep = fep->hwp; +- +- if (dev->flags&IFF_PROMISC) { +- ep->fec_r_cntrl |= 0x0008; ++ if (dev->flags & IFF_PROMISC) { ++ fec_reg_write(fep, FEC_RCR, fec_reg_read(fep, FEC_RCR) | RCR_PROM); + } else { + +- ep->fec_r_cntrl &= ~0x0008; ++ fec_reg_write(fep, FEC_RCR, fec_reg_read(fep, FEC_RCR) & ~RCR_PROM); + + if (dev->flags & IFF_ALLMULTI) { + /* Catch all multicast addresses, so set the + * filter to all 1's. + */ +- ep->fec_grp_hash_table_high = 0xffffffff; +- ep->fec_grp_hash_table_low = 0xffffffff; ++ fec_reg_write(fep, FEC_IAUR, ~0); ++ fec_reg_write(fep, FEC_IALR, ~0); + } else { + /* Clear filter and add the addresses in hash register. + */ +- ep->fec_grp_hash_table_high = 0; +- ep->fec_grp_hash_table_low = 0; ++ fec_reg_write(fep, FEC_IAUR, 0); ++ fec_reg_write(fep, FEC_IALR, 0); + + dmi = dev->mc_list; + +- for (j = 0; j < dev->mc_count; j++, dmi = dmi->next) +- { ++ for (j = 0; j < dev->mc_count; j++, dmi = dmi->next) { + /* Only support group multicast for now. + */ + if (!(dmi->dmi_addr[0] & 1)) +@@ -1621,13 +2268,11 @@ static void set_multicast_list(struct ne + + /* calculate crc32 value of mac address + */ +- crc = 0xffffffff; ++ crc = ~0; + +- for (i = 0; i < dmi->dmi_addrlen; i++) +- { ++ for (i = 0; i < dmi->dmi_addrlen; i++) { + data = dmi->dmi_addr[i]; +- for (bit = 0; bit < 8; bit++, data >>= 1) +- { ++ for (bit = 0; bit < 8; bit++, data >>= 1) { + crc = (crc >> 1) ^ + (((crc ^ data) & 1) ? CRC32_POLY : 0); + } +@@ -1639,9 +2284,13 @@ static void set_multicast_list(struct ne + hash = (crc >> (32 - HASH_BITS)) & 0x3f; + + if (hash > 31) +- ep->fec_grp_hash_table_high |= 1 << (hash - 32); ++ fec_reg_write(fep, FEC_IAUR, ++ fec_reg_read(fep, FEC_IAUR) | ++ (1 << (hash - 32))); + else +- ep->fec_grp_hash_table_low |= 1 << hash; ++ fec_reg_write(fep, FEC_IALR, ++ fec_reg_read(fep, FEC_IALR) | ++ (1 << hash)); + } + } + } +@@ -1650,106 +2299,272 @@ static void set_multicast_list(struct ne + /* Set a MAC change in hardware. + */ + static void +-fec_set_mac_address(struct net_device *dev) ++_fec_set_mac_address(struct net_device *dev) + { +- volatile fec_t *fecp; +- +- fecp = ((struct fec_enet_private *)netdev_priv(dev))->hwp; ++ struct fec_enet_private *fep = netdev_priv(dev); + + /* Set station address. */ +- fecp->fec_addr_low = dev->dev_addr[3] | (dev->dev_addr[2] << 8) | +- (dev->dev_addr[1] << 16) | (dev->dev_addr[0] << 24); +- fecp->fec_addr_high = (dev->dev_addr[5] << 16) | +- (dev->dev_addr[4] << 24); ++ fec_reg_write(fep, FEC_PALR, dev->dev_addr[3] | (dev->dev_addr[2] << 8) | ++ (dev->dev_addr[1] << 16) | (dev->dev_addr[0] << 24)); ++ 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) ++{ ++ struct sockaddr *addr = _addr; ++ ++ if (!is_valid_ether_addr((const char *)&addr->sa_data)) { ++ printk(KERN_WARNING "Bad ethernet address: %02x:%02x:%02x:%02x:%02x:%02x\n", ++ addr->sa_data[0], addr->sa_data[1], addr->sa_data[2], addr->sa_data[3], ++ addr->sa_data[4], addr->sa_data[5]); ++ return -EINVAL; ++ } ++ printk(KERN_DEBUG "Setting MAC address to %02x:%02x:%02x:%02x:%02x:%02x\n", ++ addr->sa_data[0], addr->sa_data[1], addr->sa_data[2], addr->sa_data[3], ++ addr->sa_data[4], addr->sa_data[5]); ++ ++ memcpy(&dev->dev_addr, &addr->sa_data, ETH_ALEN); + ++ _fec_set_mac_address(dev); ++ ++ return 0; + } + +- /* +- * XXX: We need to clean up on failure exits here. +- * +- * index is only used in legacy code +- */ +-int __init fec_enet_init(struct net_device *dev, int index) ++static void fec_enet_free_buffers(struct fec_enet_private *fep) ++{ ++ cbd_t *bdp = fep->rx_bd_base; ++ int i; ++ ++ DBG(0, "%s: Freeing TX bounce buffers %p\n", __FUNCTION__, fep->tx_bounce[0]); ++ kfree(fep->tx_bounce[0]); ++ memset(fep->tx_bounce, 0, TX_RING_SIZE * sizeof(void*)); ++ for (i = 0; i < RX_RING_SIZE; i++, bdp++) { ++ if (fep->rx_skbuff[i] != NULL) { ++ DBG(0, "%s: Freeing RX skb %p\n", __FUNCTION__, fep->rx_skbuff[i]); ++ fec_enet_rxbuf_unmap(fep, bdp, FEC_ENET_RX_FRSIZE); ++ kfree_skb(fep->rx_skbuff[i]); ++ fep->rx_skbuff[i] = NULL; ++ } ++ } ++} ++ ++#ifdef CONFIG_PHYLIB ++/* called by the generic PHY layer in interrupt context */ ++static int phy_regs[32] = { [0 ... ARRAY_SIZE(phy_regs) - 1] = -1}; ++static int fec_mii_read(struct mii_bus *bus, int phy_id, int regnum) + { ++ int ret; ++ struct net_device *dev = bus->priv; + struct fec_enet_private *fep = netdev_priv(dev); +- unsigned long mem_addr; +- volatile cbd_t *bdp; +- cbd_t *cbd_base; +- volatile fec_t *fecp; +- int i, j; ++ unsigned long regval = mk_mii_read(regnum) | phy_id << 23; ++ unsigned long flags; ++ int loops = 0; + +- /* Allocate memory for buffer descriptors. +- */ +- mem_addr = (unsigned long)dma_alloc_coherent(NULL, PAGE_SIZE, +- &fep->bd_dma, GFP_KERNEL); +- if (mem_addr == 0) { +- printk("FEC: allocate descriptor memory failed?\n"); ++ DBG(1, "%s: \n", __FUNCTION__); ++#if 0 ++ DBG(0, "%s: ECR: %08lx\n", __FUNCTION__, fec_reg_read(fep, FEC_ECR)); ++ DBG(0, "%s: EIR: %08lx\n", __FUNCTION__, fec_reg_read(fep, FEC_EIR)); ++ DBG(0, "%s: EIMR: %08lx\n", __FUNCTION__, fec_reg_read(fep, FEC_EIMR)); ++ DBG(0, "%s: RCR: %08lx\n", __FUNCTION__, fec_reg_read(fep, FEC_RCR)); ++ DBG(0, "%s: TCR: %08lx\n", __FUNCTION__, fec_reg_read(fep, FEC_TCR)); ++#endif ++ spin_lock_irqsave(&fep->lock, flags); ++ fep->mii_complete = 0; ++ fec_reg_write(fep, FEC_MMFR, regval); ++ spin_unlock_irqrestore(&fep->lock, flags); ++ ++ while (!fep->mii_complete) { ++ if (loops++ == 1000) { ++ DBG(1, "%s: Waiting for MII completion\n", __FUNCTION__); ++ } ++ cpu_relax(); ++ } ++ if (loops >= 1000) { ++ DBG(1, "%s: MII transaction completed\n", __FUNCTION__); ++ } ++ ret = fec_reg_read(fep, FEC_MMFR); ++ if (ret < 0) { ++ DBG(0, "%s: Failed to read PHY[%02x] reg %02x: %d\n", __FUNCTION__, ++ phy_id, regnum, ret); ++ return ret; ++ } ++ ret &= 0xffff; ++ if (phy_regs[regnum] != ret) { ++ DBG(1, "%s: Read %04x from PHY[%02x] reg %02x\n", __FUNCTION__, ++ ret, phy_id, regnum); ++ phy_regs[regnum] = ret; ++ } ++ return ret; ++} ++ ++static int fec_mii_write(struct mii_bus *bus, int phy_id, int regnum, u16 val) ++{ ++ struct net_device *dev = bus->priv; ++ struct fec_enet_private *fep = netdev_priv(dev); ++ unsigned long regval = mk_mii_write(regnum, val) | phy_id << 23; ++ unsigned long flags; ++ ++ DBG(0, "%s: \n", __FUNCTION__); ++ ++ spin_lock_irqsave(&fep->lock, flags); ++ fep->mii_complete = 0; ++ fec_reg_write(fep, FEC_MMFR, regval); ++ spin_unlock_irqrestore(&fep->lock, flags); ++ ++ while (!fep->mii_complete) { ++ cpu_relax(); ++ } ++ DBG(1, "%s: Wrote %04x to PHY[%02x] reg %02x\n", __FUNCTION__, val, phy_id, regnum); ++ return 0; ++} ++ ++static int fec_mii_reset(struct mii_bus *bus) ++{ ++ DBG(0, "%s: \n", __FUNCTION__); ++ memset(phy_regs, -1, sizeof(phy_regs)); ++ return 0; ++} ++ ++static int fec_init_phy(struct net_device *dev, struct fec_enet_private *fep) ++{ ++ int ret; ++ int i; ++ struct mii_bus *mii; ++ ++ mii = mdiobus_alloc(); ++ if (mii == NULL) { + return -ENOMEM; + } ++ mii->name = "fec mii"; ++ mii->read = fec_mii_read; ++ mii->write = fec_mii_write; ++ mii->reset = fec_mii_reset; ++ mii->priv = dev; ++ snprintf(mii->id, MII_BUS_ID_SIZE, "%x", 0); ++ mii->irq = kmalloc(sizeof(int) * PHY_MAX_ADDR, GFP_KERNEL); ++ for (i = 0; i < PHY_MAX_ADDR; i++) { ++ mii->irq[i] = fep->mii_irq >= 0 ? fep->mii_irq : PHY_POLL; ++ } ++ ++ ret = mdiobus_register(mii); ++ if (ret != 0) { ++ DBG(0, "%s: Failed to register MII bus: %d\n", __FUNCTION__, ret); ++ kfree(mii->irq); ++ mdiobus_free(mii); ++ return ret; ++ } ++ fep->phy_addr = -1; ++ DBG(0, "%s: MII bus registered\n", __FUNCTION__); ++ for (i = 0; i < PHY_MAX_ADDR; i++) { ++ if (mii->phy_map[i] != NULL) { ++ fep->phy_addr = i; ++ break; ++ } ++ } ++ if (fep->phy_addr == -1) { ++ DBG(0, "%s: No PHY found\n", __FUNCTION__); ++ return -ENODEV; ++ } ++ DBG(0, "%s: Using PHY at addr %02x\n", __FUNCTION__, fep->phy_addr); ++ fep->mii = mii; + +- spin_lock_init(&fep->hw_lock); +- spin_lock_init(&fep->mii_lock); ++ return 0; ++} + +- /* Create an Ethernet device instance. +- */ +- fecp = (volatile fec_t *)dev->base_addr; ++static int fec_connect_phy(struct net_device *dev, struct fec_enet_private *fep) ++{ ++ struct mii_bus *mii = fep->mii; + +- fep->index = index; +- fep->hwp = fecp; +- fep->netdev = dev; ++ DBG(0, "%s: Connecting PHY at addr %02x\n", __FUNCTION__, ++ fep->phy_addr); + +- /* Whack a reset. We should wait for this. +- */ +- fecp->fec_ecntrl = 1; +- udelay(10); ++ fep->phy = phy_connect(dev, dev_name(&mii->phy_map[fep->phy_addr]->dev), ++ fec_link_change, 0, mii->phy_map[fep->phy_addr]->interface); ++ if (IS_ERR(fep->phy)) { ++ int ret = PTR_ERR(fep->phy); ++ printk(KERN_ERR "%s: Could not attach to PHY\n", dev->name); ++ fep->phy = NULL; ++ return ret; ++ } ++ DBG(0, "%s: Registered PHY %s[%02x] IRQ %d with %s\n", __FUNCTION__, ++ dev_name(&fep->phy->dev), fep->phy_addr, fep->phy->irq, dev->name); + +- /* Set the Ethernet address */ +-#ifdef CONFIG_M5272 +- fec_get_mac(dev); ++ return 0; ++} + #else +- { +- unsigned long l; +- l = fecp->fec_addr_low; +- dev->dev_addr[0] = (unsigned char)((l & 0xFF000000) >> 24); +- dev->dev_addr[1] = (unsigned char)((l & 0x00FF0000) >> 16); +- dev->dev_addr[2] = (unsigned char)((l & 0x0000FF00) >> 8); +- dev->dev_addr[3] = (unsigned char)((l & 0x000000FF) >> 0); +- l = fecp->fec_addr_high; +- dev->dev_addr[4] = (unsigned char)((l & 0xFF000000) >> 24); +- dev->dev_addr[5] = (unsigned char)((l & 0x00FF0000) >> 16); +- } ++static int fec_init_phy(struct net_device *dev, struct fec_enet_private *fep) ++{ ++ /* Queue up command to detect the PHY and initialize the ++ * remainder of the interface. ++ */ ++ fep->phy_id_done = 0; ++ fep->phy_addr = 0; ++ mii_queue(dev, mk_mii_read(MII_REG_PHYIR1), mii_discover_phy); ++ ++ return 0; ++} + #endif + +- cbd_base = (cbd_t *)mem_addr; ++/* Initialize the FEC Ethernet on 860T (or ColdFire 5272). ++ */ ++ /* ++ * 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; ++ struct fec_enet_private *fep = netdev_priv(dev); ++ cbd_t *bdp; ++ struct sk_buff *pskb; ++ int i; ++ void *mem; ++ ++ spin_lock_init(&fep->lock); ++ ++ /* Whack a reset. We should wait for this. + */ +- fep->rx_bd_base = cbd_base; +- fep->tx_bd_base = cbd_base + RX_RING_SIZE; ++ fec_reg_write(fep, FEC_ECR, FEC_ECR_RESET); ++ udelay(10); ++ ++ /* Set the Ethernet address. If using multiple Enets on the 8xx, ++ * this needs some work to get unique addresses. ++ * ++ * This is our default MAC address unless the user changes ++ * it via eth_mac_addr (our dev->set_mac_addr handler). ++ */ ++ fec_get_mac(dev); + + fep->dirty_tx = fep->cur_tx = fep->tx_bd_base; + fep->cur_rx = fep->rx_bd_base; + + fep->skb_cur = fep->skb_dirty = 0; + +- /* Initialize the receive buffer descriptors. ++ /* allocate memory for TX bounce buffers */ ++ mem = kzalloc(TX_RING_SIZE * FEC_ENET_TX_FRSIZE, GFP_KERNEL); ++ if (mem == NULL) { ++ return -ENOMEM; ++ } ++ ++ fec_enet_cbd_get(fep); ++ ++ /* Initialize the transmit buffer descriptors. + */ +- bdp = fep->rx_bd_base; +- for (i=0; itx_bd_base; + +- /* Allocate a page. +- */ +- mem_addr = __get_free_page(GFP_KERNEL); +- /* XXX: missing check for allocation failure */ ++ DBG(0, "%s: Allocated %d byte of TX buffer memory @ %p\n", __FUNCTION__, ++ TX_RING_SIZE * FEC_ENET_TX_FRSIZE, mem); ++ for (i = 0; i < TX_RING_SIZE; i++) { ++ fep->tx_bounce[i] = mem; ++ DBG(0, "%s: TX bounce buffer[%d]=%p\n", __FUNCTION__, i, fep->tx_bounce[i]); ++ mem = (void *)((unsigned long)(mem + FEC_ENET_TX_FRSIZE)); + + /* Initialize the BD for every fragment in the page. + */ +- for (j=0; jcbd_sc = BD_ENET_RX_EMPTY; +- bdp->cbd_bufaddr = __pa(mem_addr); +- mem_addr += FEC_ENET_RX_FRSIZE; +- bdp++; +- } ++ bdp->cbd_bufaddr = ~0; ++ bdp++; + } + + /* Set the last buffer to wrap. +@@ -1757,87 +2572,88 @@ int __init fec_enet_init(struct net_devi + bdp--; + bdp->cbd_sc |= BD_SC_WRAP; + +- /* ...and the same for transmmit. ++ /* ...and the same for receive. + */ +- bdp = fep->tx_bd_base; +- for (i=0, j=FEC_ENET_TX_FRPPG; i= FEC_ENET_TX_FRPPG) { +- mem_addr = __get_free_page(GFP_KERNEL); +- j = 1; +- } else { +- mem_addr += FEC_ENET_TX_FRSIZE; +- j++; ++ bdp = fep->rx_bd_base; ++ for (i = 0; i < RX_RING_SIZE; i++, bdp++) { ++ pskb = __dev_alloc_skb(FEC_ENET_RX_FRSIZE, GFP_KERNEL); ++ if (pskb == NULL) { ++ DBG(0, "%s: Failed to allocate RX skb; cleaning up\n", __FUNCTION__); ++ ret = -ENOMEM; ++ goto cleanup; + } +- fep->tx_bounce[i] = (unsigned char *) mem_addr; +- +- /* Initialize the BD for every fragment in the page. +- */ +- bdp->cbd_sc = 0; +- bdp->cbd_bufaddr = 0; +- bdp++; ++ DBG(0, "%s: RX skb allocated @ %p\n", __FUNCTION__, pskb); ++ fep->rx_skbuff[i] = pskb; ++ pskb->data = FEC_ADDR_ALIGNMENT(pskb->data); ++ bdp->cbd_sc = BD_ENET_RX_EMPTY; ++ bdp->cbd_bufaddr = ~0; ++ fec_enet_rxbuf_map(fep, bdp, pskb->data, FEC_ENET_RX_FRSIZE); + } +- + /* Set the last buffer to wrap. + */ + bdp--; + bdp->cbd_sc |= BD_SC_WRAP; ++ fec_enet_cbd_put(fep); + + /* Set receive and transmit descriptor base. + */ +- fecp->fec_r_des_start = fep->bd_dma; +- fecp->fec_x_des_start = (unsigned long)fep->bd_dma + sizeof(cbd_t) +- * RX_RING_SIZE; +- +-#ifdef HAVE_mii_link_interrupt +- fec_request_mii_intr(dev); +-#endif +- +- fecp->fec_grp_hash_table_high = 0; +- fecp->fec_grp_hash_table_low = 0; +- fecp->fec_r_buff_size = PKT_MAXBLR_SIZE; +- fecp->fec_ecntrl = 2; +- fecp->fec_r_des_active = 0; +-#ifndef CONFIG_M5272 +- fecp->fec_hash_table_high = 0; +- fecp->fec_hash_table_low = 0; +-#endif ++ fec_reg_write(fep, FEC_ERDSR, fep->cbd_phys_base); ++ fec_reg_write(fep, FEC_ETDSR, fep->cbd_phys_base + RX_RING_SIZE * sizeof(cbd_t)); + ++ /* Install our interrupt handlers. This varies depending on ++ * the architecture. ++ */ ++ ret = fec_request_intrs(pdev, dev); ++ if (ret != 0) { ++ goto cleanup; ++ } ++ /* Clear and enable interrupts */ ++ fec_reg_write(fep, FEC_EIR, fec_reg_read(fep, FEC_EIR)); ++ fec_reg_write(fep, FEC_EIMR, FEC_ENET_TXF | FEC_ENET_TXB | ++ FEC_ENET_RXF | FEC_ENET_RXB | FEC_ENET_MII); ++ ++ fec_reg_write(fep, FEC_IAUR, 0); ++ fec_reg_write(fep, FEC_IALR, 0); ++ fec_reg_write(fep, FEC_EMRBR, PKT_MAXBLR_SIZE); ++ fec_reg_write(fep, FEC_ECR, FEC_ECR_ETHER_EN); ++ fec_localhw_setup(dev); ++#if 0 ++ /* do this in enet_open()! */ ++ fec_reg_write(fep, FEC_RDAR, DONT_CARE); ++#endif + /* The FEC Ethernet specific entries in the device structure. */ + dev->open = fec_enet_open; + dev->hard_start_xmit = fec_enet_start_xmit; + dev->tx_timeout = fec_timeout; + dev->watchdog_timeo = TX_TIMEOUT; + dev->stop = fec_enet_close; ++ dev->get_stats = fec_enet_get_stats; + dev->set_multicast_list = set_multicast_list; ++ dev->set_mac_address = fec_set_mac_address; + +- for (i=0; ifec_r_cntrl = OPT_FRAME_SIZE | 0x04; +- fecp->fec_x_cntrl = 0x00; +- +- /* +- * Set MII speed to 2.5 MHz +- */ +- fep->phy_speed = ((((clk_get_rate(fep->clk) / 2 + 4999999) +- / 2500000) / 2) & 0x3F) << 1; +- fecp->fec_mii_speed = fep->phy_speed; +- fec_restart(dev, 0); +- +- /* Clear and enable interrupts */ +- fecp->fec_ievent = 0xffc00000; +- fecp->fec_imask = (FEC_ENET_TXF | FEC_ENET_RXF | FEC_ENET_MII); +- +- /* Queue up command to detect the PHY and initialize the +- * remainder of the interface. +- */ +- fep->phy_id_done = 0; +- fep->phy_addr = 0; +- mii_queue(dev, mk_mii_read(MII_REG_PHYIR1), mii_discover_phy); ++ ret = fec_set_mii(dev, fep); ++ if (ret) { ++ DBG(0, "%s: Failed to initialize MII interface: %d\n", __FUNCTION__, ret); ++ goto cleanup; ++ } + ++ ret = fec_init_phy(dev, fep); ++ if (ret) { ++ DBG(0, "%s: Failed to initialize PHY: %d\n", __FUNCTION__, ret); ++ goto cleanup; ++ } + return 0; ++ cleanup: ++ fec_enet_free_buffers(fep); ++ fec_enet_cbd_put(fep); ++ return ret; + } + + /* 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 + static void + fec_restart(struct net_device *dev, int duplex) + { +- struct fec_enet_private *fep; +- volatile cbd_t *bdp; +- volatile fec_t *fecp; ++ struct fec_enet_private *fep = netdev_priv(dev); ++ cbd_t *bdp; + int i; ++ u32 rcr = OPT_FRAME_SIZE | RCR_MII_MODE; /* MII enable */ ++ u32 tcr = TCR_HBC; + +- fep = netdev_priv(dev); +- fecp = fep->hwp; +- ++ DBG(0, "%s: Restarting FEC in %s-duplex mode\n", __FUNCTION__, ++ duplex ? "full" : "half"); + /* Whack a reset. We should wait for this. +- */ +- fecp->fec_ecntrl = 1; ++ */ ++ fec_reg_write(fep, FEC_ECR, FEC_ECR_RESET); + udelay(10); + ++ /* Enable interrupts we wish to service. ++ */ ++ fec_reg_write(fep, FEC_EIMR, FEC_ENET_TXF | FEC_ENET_TXB | ++ FEC_ENET_RXF | FEC_ENET_RXB | FEC_ENET_MII); ++ + /* Clear any outstanding interrupt. +- */ +- fecp->fec_ievent = 0xffc00000; ++ * ++ */ ++ fec_reg_write(fep, FEC_EIR, FEC_ENET_MASK); ++ ++ fec_enable_phy_intr(fep); + + /* Set station address. +- */ +- fec_set_mac_address(dev); ++ */ ++ _fec_set_mac_address(dev); + + /* Reset all multicast. +- */ +- fecp->fec_grp_hash_table_high = 0; +- fecp->fec_grp_hash_table_low = 0; ++ */ ++ fec_reg_write(fep, FEC_IAUR, 0); ++ fec_reg_write(fep, FEC_IALR, 0); + + /* Set maximum receive buffer size. +- */ +- fecp->fec_r_buff_size = PKT_MAXBLR_SIZE; ++ */ ++ fec_reg_write(fep, FEC_EMRBR, PKT_MAXBLR_SIZE); + + /* Set receive and transmit descriptor base. +- */ +- fecp->fec_r_des_start = fep->bd_dma; +- fecp->fec_x_des_start = (unsigned long)fep->bd_dma + sizeof(cbd_t) +- * RX_RING_SIZE; ++ */ ++ fec_reg_write(fep, FEC_ERDSR, fep->cbd_phys_base); ++ fec_reg_write(fep, FEC_ETDSR, fep->cbd_phys_base + RX_RING_SIZE * sizeof(cbd_t)); + + fep->dirty_tx = fep->cur_tx = fep->tx_bd_base; + fep->cur_rx = fep->rx_bd_base; + + /* Reset SKB transmit buffers. +- */ ++ */ + fep->skb_cur = fep->skb_dirty = 0; +- for (i=0; i<=TX_RING_MOD_MASK; i++) { ++ bdp = fep->tx_bd_base; ++ for (i = 0; i <= TX_RING_MOD_MASK; i++) { + if (fep->tx_skbuff[i] != NULL) { +- dev_kfree_skb_any(fep->tx_skbuff[i]); +- fep->tx_skbuff[i] = NULL; ++ fec_free_skb(fep, bdp, &fep->tx_skbuff[i]); ++ bdp++; + } + } + + /* Initialize the receive buffer descriptors. +- */ ++ */ + bdp = fep->rx_bd_base; +- for (i=0; icbd_sc = BD_ENET_RX_EMPTY; +@@ -1908,246 +2731,366 @@ fec_restart(struct net_device *dev, int + } + + /* Set the last buffer to wrap. +- */ ++ */ + bdp--; + bdp->cbd_sc |= BD_SC_WRAP; + + /* ...and the same for transmmit. +- */ ++ */ + bdp = fep->tx_bd_base; +- for (i=0; icbd_sc = 0; +- bdp->cbd_bufaddr = 0; ++ bdp->cbd_bufaddr = ~0; + bdp++; + } + + /* Set the last buffer to wrap. +- */ ++ */ + bdp--; + bdp->cbd_sc |= BD_SC_WRAP; + + /* Enable MII mode. +- */ ++ */ + if (duplex) { +- fecp->fec_r_cntrl = OPT_FRAME_SIZE | 0x04;/* MII enable */ +- fecp->fec_x_cntrl = 0x04; /* FD enable */ ++ tcr |= TCR_FDEN; /* FD enable */ + } else { +- /* MII enable|No Rcv on Xmit */ +- fecp->fec_r_cntrl = OPT_FRAME_SIZE | 0x06; +- fecp->fec_x_cntrl = 0x00; ++ rcr |= RCR_DRT; /* No Rcv on Xmit */ + } ++ fec_reg_write(fep, FEC_RCR, rcr); ++ fec_reg_write(fep, FEC_TCR, tcr); + fep->full_duplex = duplex; + + /* Set MII speed. +- */ +- fecp->fec_mii_speed = fep->phy_speed; ++ */ ++ fec_reg_write(fep, FEC_MSCR, fep->phy_speed); + + /* And last, enable the transmit and receive processing. +- */ +- fecp->fec_ecntrl = 2; +- fecp->fec_r_des_active = 0; ++ */ ++ fec_reg_write(fep, FEC_ECR, FEC_ECR_ETHER_EN); ++ fec_localhw_setup(dev); ++ fec_reg_write(fep, FEC_RDAR, DONT_CARE); + +- /* Enable interrupts we wish to service. +- */ +- fecp->fec_imask = (FEC_ENET_TXF | FEC_ENET_RXF | FEC_ENET_MII); ++ DBG(0, "%s: Starting netif queue\n", __FUNCTION__); ++ netif_start_queue(dev); + } + + static void + fec_stop(struct net_device *dev) + { +- volatile fec_t *fecp; +- struct fec_enet_private *fep; ++ struct fec_enet_private *fep = netdev_priv(dev); + +- fep = netdev_priv(dev); +- fecp = fep->hwp; ++ DBG(0, "%s: Stopping netif queue\n", __FUNCTION__); ++ netif_stop_queue(dev); + + /* +- ** We cannot expect a graceful transmit stop without link !!! +- */ +- if (fep->link) +- { +- fecp->fec_x_cntrl = 0x01; /* Graceful transmit stop */ ++ * We cannot expect a graceful transmit stop without link! ++ */ ++ if (fep->linkstatus) { ++ fec_reg_write(fep, FEC_TCR, 0x01); /* Graceful transmit stop */ + udelay(10); +- if (!(fecp->fec_ievent & FEC_ENET_GRA)) +- printk("fec_stop : Graceful transmit stop did not complete !\n"); +- } +- ++ if (!(fec_reg_read(fep, FEC_EIR) & FEC_ENET_GRA)) ++ dev_warn(&dev->dev, "Graceful transmit stop did not complete!\n"); ++ } ++#if 0 + /* Whack a reset. We should wait for this. +- */ +- fecp->fec_ecntrl = 1; ++ */ ++ fec_reg_write(fep, FEC_ECR, FEC_ECR_RESET); + udelay(10); +- +- /* Clear outstanding MII command interrupts. +- */ +- fecp->fec_ievent = FEC_ENET_MII; +- +- fecp->fec_imask = FEC_ENET_MII; +- fecp->fec_mii_speed = fep->phy_speed; ++ /* Mask and clear outstanding MII command interrupts. ++ */ ++ fec_reg_write(fep, FEC_EIMR, 0); ++ fec_reg_write(fep, FEC_EIR, FEC_ENET_MII); ++ fec_enable_phy_intr(fep); ++ fec_reg_write(fep, FEC_MSCR, fep->phy_speed); ++#endif + } + +-static int __devinit +-fec_probe(struct platform_device *pdev) ++static int __devinit fec_enet_probe(struct platform_device *pdev) + { ++ int ret; + struct fec_enet_private *fep; +- struct net_device *ndev; +- int i, irq, ret = 0; +- struct resource *r; +- +- r = platform_get_resource(pdev, IORESOURCE_MEM, 0); +- if (!r) +- return -ENXIO; ++ struct net_device *dev; ++ struct fec_enet_platform_data *pdata = pdev->dev.platform_data; ++ struct resource *res_mem1; ++ struct resource *res_mem2; ++ ++ res_mem1 = platform_get_resource(pdev, IORESOURCE_MEM, 0); ++ if (res_mem1 == NULL) { ++ return -ENODEV; ++ } + +- r = request_mem_region(r->start, resource_size(r), pdev->name); +- if (!r) ++ res_mem1 = request_mem_region(res_mem1->start, ++ resource_size(res_mem1), ++ DRV_NAME); ++ if (res_mem1 == NULL) { + return -EBUSY; ++ } ++ res_mem2 = platform_get_resource(pdev, IORESOURCE_MEM, 1); ++ if (res_mem2 != NULL) { ++ res_mem2 = request_mem_region(res_mem2->start, ++ resource_size(res_mem2), ++ DRV_NAME); ++ if (res_mem2 == NULL) { ++ ret = -EBUSY; ++ goto release1; ++ } ++ } + +- /* Init network device */ +- ndev = alloc_etherdev(sizeof(struct fec_enet_private)); +- if (!ndev) +- return -ENOMEM; +- +- SET_NETDEV_DEV(ndev, &pdev->dev); +- +- /* setup board info structure */ +- fep = netdev_priv(ndev); +- memset(fep, 0, sizeof(*fep)); ++ dev = alloc_etherdev(sizeof(struct fec_enet_private)); ++ if (dev == NULL) { ++ ret = -ENOMEM; ++ goto release2; ++ } ++ platform_set_drvdata(pdev, dev); ++ fep = netdev_priv(dev); ++ fep->res_mem1 = res_mem1; ++ fep->res_mem2 = res_mem2; ++ fep->dma_dev = &pdev->dev; ++ ++ fep->reg_base = ioremap(res_mem1->start, resource_size(res_mem1)); ++ if (fep->reg_base == NULL) { ++ printk("FEC: Mapping FEC registers failed\n"); ++ ret = -ENOMEM; ++ goto free_netdev; ++ } ++ DBG(0, "%s: FEC registers @ %08lx mapped to %p\n", __FUNCTION__, ++ (unsigned long)res_mem1->start, fep->reg_base); + +- ndev->base_addr = (unsigned long)ioremap(r->start, resource_size(r)); ++ fep->mib_base = ioremap(res_mem2->start, resource_size(res_mem2)); ++ if (fep->mib_base == NULL) { ++ printk("FEC: Mapping FEC registers failed\n"); ++ ret = -ENOMEM; ++ goto unmap1; ++ } ++ DBG(0, "%s: FEC registers @ %08lx mapped to %p\n", __FUNCTION__, ++ (unsigned long)res_mem2->start, fep->mib_base); + +- if (!ndev->base_addr) { ++ /* Allocate memory for buffer descriptors. */ ++ fep->cbd_mem_base = dma_alloc_coherent(&pdev->dev, CBD_BUF_SIZE, ++ &fep->cbd_phys_base, ++ GFP_KERNEL); ++ if (fep->cbd_mem_base == NULL) { ++ printk("FEC: allocate descriptor memory failed\n"); + ret = -ENOMEM; +- goto failed_ioremap; ++ goto unmap2; + } ++ DBG(0, "%s: Allocated %lu [(%u + %lu) * %d] byte for CBD buffer @ %p[%08lx]\n", ++ __FUNCTION__, CBD_BUF_SIZE, TX_RING_SIZE, RX_RING_SIZE, ++ sizeof(cbd_t), fep->cbd_mem_base, ++ (unsigned long)fep->cbd_phys_base); + +- platform_set_drvdata(pdev, ndev); ++ /* Set receive and transmit descriptor base. ++ */ ++ fep->rx_bd_base = fep->cbd_mem_base; ++ fep->tx_bd_base = fep->rx_bd_base + RX_RING_SIZE; + +- /* This device has up to three irqs on some platforms */ +- for (i = 0; i < 3; i++) { +- irq = platform_get_irq(pdev, i); +- if (i && irq < 0) +- break; +- ret = request_irq(irq, fec_enet_interrupt, IRQF_DISABLED, pdev->name, ndev); +- if (ret) { +- while (i >= 0) { +- irq = platform_get_irq(pdev, i); +- free_irq(irq, ndev); +- i--; +- } +- goto failed_irq; +- } ++ printk("FEC ENET Driver\n"); ++ ret = platform_func(pdata->arch_init, pdev); ++ if (ret != 0) { ++ dev_err(&pdev->dev, "platform init failed: %d\n", ret); ++ goto free_dma; + } + +- fep->clk = clk_get(&pdev->dev, "fec_clk"); +- if (IS_ERR(fep->clk)) { +- ret = PTR_ERR(fep->clk); +- goto failed_clk; ++ ret = fec_enet_init(pdev, dev); ++ if (ret != 0) { ++ goto fec_disable; + } +- clk_enable(fep->clk); + +- ret = fec_enet_init(ndev, 0); +- if (ret) +- goto failed_init; ++ /* Enable most messages by default */ ++ fep->msg_enable = (NETIF_MSG_IFUP << 1) - 1; ++ ret = register_netdev(dev); ++ if (ret != 0) { ++ /* XXX: missing cleanup here */ ++ goto free_buffers; ++ } + +- ret = register_netdev(ndev); +- if (ret) +- goto failed_register; ++ printk(KERN_INFO "%s: ethernet %02x:%02x:%02x:%02x:%02x:%02x\n", dev->name, ++ dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2], ++ dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5]); + + return 0; + +-failed_register: +-failed_init: +- clk_disable(fep->clk); +- clk_put(fep->clk); +-failed_clk: +- for (i = 0; i < 3; i++) { +- irq = platform_get_irq(pdev, i); +- if (irq > 0) +- free_irq(irq, ndev); +- } +-failed_irq: +- iounmap((void __iomem *)ndev->base_addr); +-failed_ioremap: +- free_netdev(ndev); ++ free_buffers: ++ fec_enet_free_buffers(fep); ++ ++ fec_disable: ++ platform_func(pdata->arch_exit, pdev); ++ ++ free_dma: ++ dma_free_coherent(&pdev->dev, CBD_BUF_SIZE, fep->cbd_mem_base, fep->cbd_phys_base); ++ ++ unmap2: ++ if (fep->mib_base) ++ iounmap(fep->mib_base); ++ ++ unmap1: ++ iounmap(fep->reg_base); ++ ++ free_netdev: ++ free_netdev(dev); ++ ++ release2: ++ if (res_mem2 != NULL) { ++ release_resource(res_mem2); ++ } ++ ++ release1: ++ release_resource(res_mem1); + + return ret; + } + +-static int __devexit +-fec_drv_remove(struct platform_device *pdev) ++static int __devexit fec_enet_remove(struct platform_device *pdev) + { +- struct net_device *ndev = platform_get_drvdata(pdev); +- struct fec_enet_private *fep = netdev_priv(ndev); ++ struct net_device *dev = platform_get_drvdata(pdev); ++ 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); ++ mdiobus_unregister(fep->mii); ++ } ++ mdiobus_free(fep->mii); ++#endif ++ fec_release_intrs(dev); ++ ++ DBG(0, "%s: Unmapping FEC registers %p\n", __FUNCTION__, fep->reg_base); ++ iounmap(fep->reg_base); ++ if (fep->mib_base) ++ iounmap(fep->mib_base); ++ ++ fec_enet_free_buffers(fep); + +- platform_set_drvdata(pdev, NULL); ++ DBG(0, "%s: Freeing CBD buffer area %p[%08lx]\n", __FUNCTION__, ++ fep->cbd_mem_base, (unsigned long)fep->cbd_phys_base); ++ dma_free_coherent(&pdev->dev, CBD_BUF_SIZE, fep->cbd_mem_base, fep->cbd_phys_base); + +- fec_stop(ndev); +- clk_disable(fep->clk); +- clk_put(fep->clk); +- iounmap((void __iomem *)ndev->base_addr); +- unregister_netdev(ndev); +- free_netdev(ndev); ++ release_resource(fep->res_mem1); ++ if (fep->res_mem2 != NULL) { ++ release_resource(fep->res_mem2); ++ } + return 0; + } + +-static int +-fec_suspend(struct platform_device *dev, pm_message_t state) ++static void fec_enet_shutdown(struct platform_device *pdev) + { +- struct net_device *ndev = platform_get_drvdata(dev); +- struct fec_enet_private *fep; ++ struct fec_enet_platform_data *pdata = pdev->dev.platform_data; ++ ++ DBG(0, "%s: Shutting down FEC Hardware\n", __FUNCTION__); ++ platform_func(pdata->arch_exit, pdev); ++} ++ ++#ifdef CONFIG_PM ++static int fec_enet_suspend(struct platform_device *pdev, pm_message_t state) ++{ ++ int ret; ++ struct fec_enet_platform_data *pdata = pdev->dev.platform_data; ++ struct net_device *ndev = platform_get_drvdata(pdev); ++ struct fec_enet_private *fep = netdev_priv(ndev); + +- if (ndev) { +- fep = netdev_priv(ndev); +- if (netif_running(ndev)) { +- netif_device_detach(ndev); +- fec_stop(ndev); ++ if (netif_running(ndev)) { ++ DBG(0, "%s: Detaching netif\n", __FUNCTION__); ++ netif_device_detach(ndev); ++#ifdef CONFIG_PHYLIB ++ DBG(0, "%s: Disconnecting PHY %p\n", __FUNCTION__, fep->phy); ++ phy_disconnect(fep->phy); ++ fep->phy = NULL; ++#endif ++ } ++#ifndef CONFIG_PHYLIB ++ if (fep->phy_timer) { ++ ret = del_timer_sync(fep->phy_timer); ++ if (ret != 0) { ++ DBG(0, "%s: Failed to delete PHY timer: %d\n", __FUNCTION__, ret); ++ return ret; + } + } +- return 0; ++#endif ++ DBG(0, "%s: Shutting down FEC Hardware %d\n", __FUNCTION__, ++ netif_running(ndev)); ++ ret = platform_func(pdata->suspend, pdev); ++ if (ret != 0 && netif_running(ndev)) { ++ DBG(0, "%s: Failed to suspend: %d\n", __FUNCTION__, ret); ++ /* Undo suspend */ ++#ifdef CONFIG_PHYLIB ++ DBG(0, "%s: Reconnecting PHY\n", __FUNCTION__); ++ if (fec_connect_phy(ndev, fep) != 0) { ++ DBG(0, "%s: Failed to connect to PHY\n", __FUNCTION__); ++ return ret; ++ } ++ phy_start(fep->phy); ++#endif ++ fec_link_change(ndev); ++ netif_device_attach(ndev); ++ } ++ return ret; + } + +-static int +-fec_resume(struct platform_device *dev) ++static int fec_enet_resume(struct platform_device *pdev) + { +- struct net_device *ndev = platform_get_drvdata(dev); ++ int ret; ++ struct fec_enet_platform_data *pdata = pdev->dev.platform_data; ++ struct net_device *ndev = platform_get_drvdata(pdev); + +- if (ndev) { +- if (netif_running(ndev)) { +- fec_enet_init(ndev, 0); +- netif_device_attach(ndev); ++ DBG(0, "%s: Powering up FEC Hardware %d\n", __FUNCTION__, ++ netif_running(ndev)); ++ ret = platform_func(pdata->resume, pdev); ++ if (ret != 0) { ++ DBG(0, "%s: Failed to resume: %d\n", __FUNCTION__, ret); ++ return ret; ++ } ++ if (netif_running(ndev)) { ++#ifdef CONFIG_PHYLIB ++ struct fec_enet_private *fep = netdev_priv(ndev); ++ ++ DBG(0, "%s: Reconnecting PHY\n", __FUNCTION__); ++ ret = fec_connect_phy(ndev, fep); ++ if (ret != 0) { ++ DBG(0, "%s: Failed to connect to PHY: %d\n", __FUNCTION__, ret); ++ return ret; + } ++ phy_start(fep->phy); ++#endif ++ fec_link_change(ndev); ++ netif_device_attach(ndev); + } + return 0; + } ++#else ++#define fec_enet_suspend NULL ++#define fec_enet_resume NULL ++#endif + +-static struct platform_driver fec_driver = { +- .driver = { +- .name = "fec", +- .owner = THIS_MODULE, ++static struct platform_driver fec_enet_driver = { ++ .driver = { ++ .name = DRV_NAME, + }, +- .probe = fec_probe, +- .remove = __devexit_p(fec_drv_remove), +- .suspend = fec_suspend, +- .resume = fec_resume, ++ .probe = fec_enet_probe, ++ .remove = __devexit_p(fec_enet_remove), ++ .shutdown = fec_enet_shutdown, ++ .suspend = fec_enet_suspend, ++ .resume = fec_enet_resume, + }; + +-static int __init +-fec_enet_module_init(void) ++static int __init fec_enet_module_init(void) + { +- printk(KERN_INFO "FEC Ethernet Driver\n"); ++ int ret; ++ ++ ret = platform_driver_register(&fec_enet_driver); + +- return platform_driver_register(&fec_driver); ++ return ret; + } ++module_init(fec_enet_module_init); + +-static void __exit +-fec_enet_cleanup(void) ++static void __exit fec_enet_module_cleanup(void) + { +- platform_driver_unregister(&fec_driver); ++ platform_driver_unregister(&fec_enet_driver); + } +- +-module_exit(fec_enet_cleanup); +-module_init(fec_enet_module_init); ++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 18:43:03.000000000 +0200 +@@ -13,6 +13,15 @@ + #define FEC_H + /****************************************************************************/ + ++/* ++ * dummy value to write into RDAR,TDAR. FEC hardware will scan the TX/RX ++ * descriptors in memory upon any write access to those registers. ++ * The actual value written to those registers does not matter. ++*/ ++#define DONT_CARE 0 ++#define RDAR_BUSY (1 << 24) ++#define TDAR_BUSY (1 << 24) ++ + #if defined(CONFIG_M523x) || defined(CONFIG_M527x) || defined(CONFIG_M528x) || \ + defined(CONFIG_M520x) || defined(CONFIG_M532x) || defined(CONFIG_ARCH_MXC) + /* +@@ -20,6 +29,36 @@ + * registers in the same peripheral device on different models + * of the ColdFire! + */ ++// relying on structure alignment for hardware register is just evil ++#ifndef GARBAGE ++#define FEC_EIR 0x004 ++#define FEC_EIMR 0x008 ++#define FEC_RDAR 0x010 ++#define FEC_TDAR 0x014 ++#define FEC_ECR 0x024 ++#define FEC_MMFR 0x040 ++#define FEC_MSCR 0x044 ++#define FEC_MIBC 0x064 ++#define FEC_RCR 0x084 ++#define FEC_TCR 0x0c4 ++#define FEC_PALR 0x0e4 ++#define FEC_PAUR 0x0e8 ++#define FEC_OPD 0x0ec ++#define FEC_IAUR 0x118 ++#define FEC_IALR 0x11c ++#define FEC_GAUR 0x120 ++#define FEC_GALR 0x124 ++#define FEC_TFWR 0x144 ++#define FEC_FRBR 0x14c ++#define FEC_FRSR 0x150 ++#define FEC_ERDSR 0x180 ++#define FEC_ETDSR 0x184 ++#define FEC_EMRBR 0x188 ++ ++#define FEC_ECR_RESET (1 << 0) ++#define FEC_ECR_ETHER_EN (1 << 1) ++#else ++ + typedef struct fec { + unsigned long fec_reserved0; + unsigned long fec_ievent; /* Interrupt event reg */ +@@ -57,6 +96,7 @@ typedef struct fec { + unsigned long fec_x_des_start; /* Transmit descriptor ring */ + unsigned long fec_r_buff_size; /* Maximum receive buff size */ + } fec_t; ++#endif + + #else + +@@ -88,8 +128,8 @@ typedef struct fec { + unsigned long fec_reserved7[158]; + unsigned long fec_addr_low; /* Low 32bits MAC address */ + unsigned long fec_addr_high; /* High 16bits MAC address */ +- unsigned long fec_grp_hash_table_high;/* High 32bits hash table */ +- unsigned long fec_grp_hash_table_low; /* Low 32bits hash table */ ++ unsigned long fec_hash_table_high; /* High 32bits hash table */ ++ unsigned long fec_hash_table_low; /* Low 32bits hash table */ + unsigned long fec_r_des_start; /* Receive descriptor ring */ + unsigned long fec_x_des_start; /* Transmit descriptor ring */ + unsigned long fec_r_buff_size; /* Maximum receive buff size */ +@@ -103,17 +143,20 @@ typedef struct fec { + /* + * Define the buffer descriptor structure. + */ +-#ifdef CONFIG_ARCH_MXC ++/* Please see "Receive Buffer Descriptor Field Definitions" in Specification. ++ * It's LE. ++ */ ++#if defined(CONFIG_ARCH_MXC) + typedef struct bufdesc { +- unsigned short cbd_datlen; /* Data length */ +- unsigned short cbd_sc; /* Control and status info */ +- unsigned long cbd_bufaddr; /* Buffer address */ ++ unsigned short cbd_datlen; /* Data length */ ++ unsigned short cbd_sc; /* Control and status info */ ++ dma_addr_t cbd_bufaddr; /* Buffer address as seen by FEC Hardware */ + } cbd_t; + #else + typedef struct bufdesc { + unsigned short cbd_sc; /* Control and status info */ + unsigned short cbd_datlen; /* Data length */ +- unsigned long cbd_bufaddr; /* Buffer address */ ++ dma_addr_t cbd_bufaddr; /* Buffer address */ + } cbd_t; + #endif + +@@ -121,7 +164,7 @@ typedef struct bufdesc { + * The following definitions courtesy of commproc.h, which where + * Copyright (c) 1997 Dan Malek (dmalek@jlc.net). + */ +-#define BD_SC_EMPTY ((ushort)0x8000) /* Recieve is empty */ ++#define BD_SC_EMPTY ((ushort)0x8000) /* Receive is empty */ + #define BD_SC_READY ((ushort)0x8000) /* Transmit is ready */ + #define BD_SC_WRAP ((ushort)0x2000) /* Last buffer descriptor */ + #define BD_SC_INTRPT ((ushort)0x1000) /* Interrupt on change */ +@@ -168,5 +211,22 @@ typedef struct bufdesc { + #define BD_ENET_TX_STATS ((ushort)0x03ff) /* All status bits */ + + ++#define RCR_LOOP (1 << 0) ++#define RCR_DRT (1 << 1) ++#define RCR_MII_MODE (1 << 2) ++#define RCR_PROM (1 << 3) ++#define RCR_BC_REJ (1 << 4) ++#define RCR_FCE (1 << 5) ++#define RCR_MAX_FL_SHIFT 16 ++#define RCR_MAX_FL_MASK (0x7ff << (RCR_MAX_FL_SHIFT)) ++#define RCR_MAX_FL_set(n) (((n) << (RCR_MAX_FL_SHIFT)) & (RCR_MAX_FL_MASK)) ++#define RCR_MAX_FL_get(n) (((n) & (RCR_MAX_FL_MASK)) >> (RCR_MAX_FL_SHIFT)) ++ ++#define TCR_GTS (1 << 0) ++#define TCR_HBC (1 << 1) ++#define TCR_FDEN (1 << 2) ++#define TCR_TFCPAUSE (1 << 3) ++#define TCR_RFCPAUSE (1 << 4) ++ + /****************************************************************************/ + #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 18:58:52.000000000 +0200 +@@ -570,7 +570,7 @@ static int imxfb_resume(struct platform_ + #define imxfb_resume NULL + #endif + +-static int __init imxfb_init_fbinfo(struct platform_device *pdev) ++static int __devinit imxfb_init_fbinfo(struct platform_device *pdev) + { + struct imx_fb_platform_data *pdata = pdev->dev.platform_data; + struct fb_info *info = dev_get_drvdata(&pdev->dev); +@@ -636,7 +636,7 @@ static int __init imxfb_init_fbinfo(stru + return 0; + } + +-static int __init imxfb_probe(struct platform_device *pdev) ++static int __devinit imxfb_probe(struct platform_device *pdev) + { + struct imxfb_info *fbi; + struct fb_info *info; +@@ -754,7 +754,7 @@ failed_map: + failed_getclock: + iounmap(fbi->regs); + failed_ioremap: +- release_mem_region(res->start, res->end - res->start); ++ release_mem_region(res->start, resource_size(res)); + failed_req: + kfree(info->pseudo_palette); + failed_init: +@@ -763,7 +763,7 @@ failed_init: + return ret; + } + +-static int __devexit imxfb_remove(struct platform_device *pdev) ++static int imxfb_remove(struct platform_device *pdev) + { + struct imx_fb_platform_data *pdata; + struct fb_info *info = platform_get_drvdata(pdev); +@@ -785,7 +785,7 @@ static int __devexit imxfb_remove(struct + framebuffer_release(info); + + iounmap(fbi->regs); +- release_mem_region(res->start, res->end - res->start + 1); ++ release_mem_region(res->start, resource_size(res)); + clk_disable(fbi->clk); + clk_put(fbi->clk); + +@@ -794,7 +794,7 @@ static int __devexit imxfb_remove(struct + return 0; + } + +-void imxfb_shutdown(struct platform_device * dev) ++void imxfb_shutdown(struct platform_device *dev) + { + struct fb_info *info = platform_get_drvdata(dev); + struct imxfb_info *fbi = info->par; +@@ -804,7 +804,8 @@ void imxfb_shutdown(struct platform_dev + static struct platform_driver imxfb_driver = { + .suspend = imxfb_suspend, + .resume = imxfb_resume, +- .remove = __devexit_p(imxfb_remove), ++// .remove = __devexit_p(imxfb_remove), ++ .remove = imxfb_remove, + .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-03-16 12:49:03.000000000 +0100 +@@ -0,0 +1,26 @@ ++/* ++ * Copyright (C) 2007 Lothar Wassmann ++ * ++ * platform_data definitions for fec_enet device ++ * ++ * 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 ++ */ ++ ++struct fec_enet_platform_data { ++ /* callback for platform specific initialization */ ++ int (*arch_init)(struct platform_device *dev); ++ void (*arch_exit)(struct platform_device *dev); ++ 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 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"; + static int recursion_bug; +-static int new_text_line = 1; ++ static int new_text_line = 1; + static char printk_buf[1024]; + ++#ifdef CONFIG_DEBUG_LL ++extern void asmlinkage printascii(const char *); ++#endif + asmlinkage int vprintk(const char *fmt, va_list args) + { + int printed_len = 0; +@@ -687,6 +690,9 @@ asmlinkage int vprintk(const char *fmt, + sizeof(printk_buf) - printed_len, fmt, args); + + ++#ifdef CONFIG_DEBUG_LL ++ printascii(printk_buf); ++#endif + /* + * Copy the output into log_buf. If the caller didn't provide + * appropriate log level tags, we insert them here diff --git a/recipes/linux/linux-2.6.30-rc4/tx25/defconfig b/recipes/linux/linux-2.6.30-rc4/tx25/defconfig deleted file mode 100644 index 290f8df24c..0000000000 --- a/recipes/linux/linux-2.6.30-rc4/tx25/defconfig +++ /dev/null @@ -1,1211 +0,0 @@ -# -# Automatically generated make config: don't edit -# Linux kernel version: 2.6.30-rc4 -# Tue Jun 30 22:46:56 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 is not set -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=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 - -# -# 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_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 - -# -# 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=y -CONFIG_NETCONSOLE_DYNAMIC=y -CONFIG_NETPOLL=y -# CONFIG_NETPOLL_TRAP is not set -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 -# 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 is not set -# CONFIG_LOGO_LINUX_VGA16 is not set -CONFIG_LOGO_LINUX_CLUT224=y -# CONFIG_SOUND 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_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=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 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 --git a/recipes/linux/linux-2.6.30-rc4/tx25/linux-2.6.30-rc4-git.patch b/recipes/linux/linux-2.6.30-rc4/tx25/linux-2.6.30-rc4-git.patch deleted file mode 100644 index b030555df6..0000000000 --- a/recipes/linux/linux-2.6.30-rc4/tx25/linux-2.6.30-rc4-git.patch +++ /dev/null @@ -1,55110 +0,0 @@ -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 -+#ifdef __KERNEL__ - --#endif -+#include -+#include -+#include -+#include -+ -+#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 -+#include - #include - -+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. -+ * -+ * 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 -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+ -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#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 */ -+ .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. -- * -- * 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 --#include --#include --#include --#include --#include --#include -- --#include --#include --#include -- --#include --#include --#include --#include -- --#include --#include -- --#include --#include --#include -- --#include --#include --#include -- --/* 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 */ -- .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 - #include - #include -+#include - #include - #include - #include -@@ -21,98 +23,50 @@ - #include - - #include -+#include - #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 = ""; -+ -+ /* name */ -+ 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 -+#include -+ -+#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 - #include - #include -+#include -+#include -+ -+#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 -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#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 -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#include -+#include -+#include -+ -+ -+/* 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 - #include - -+#include - #include - #include - #include -@@ -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 - #include - --#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 -+ -+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 -+#include -+ -+#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 - #include --#include -+ - #include - -+#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. -+ * 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 .h, -+ * and the chip/board init code should then explicitly include -+ * .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. - * -+ * 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 - --#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 - - #include -+#include - #include - - #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. - * -+ * 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 -+#include - #include - - #include -- - #include - --/* 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. -+ * -+ * 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 -+ -+#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 - #include - -+#include - #include - #include - #include - -+#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 - #include - #include -+#include -+#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 - #include - #include -+#include -+#include -+#include - - #include - #include -@@ -24,8 +27,11 @@ - #include - #include - #include -+#include -+#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 - #include - -+#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 , 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 --#include --#include --#include --#include --#include -- --#include -- --/* -- * 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 -- * Copyright (C) 2006 Inky Lung -- * Copyright (C) 2006 Pavel Pisa, PiKRON -- * -- * 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 --#include --#include --#include --#include --#include --#include -- --#include -- --#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 -- * initial version heavily inspired by -- * linux/arch/arm/mach-pxa/dma.c -- * -- * 2005-04-17 Pavel Pisa -- * Changed to support scatter gather DMA -- * by taking Russell's code from RiscPC -- * -- * 2006-05-31 Pavel Pisa -- * Corrected error handling code. -- * -- */ -- --#undef DEBUG -- --#include --#include --#include --#include --#include -- --#include --#include --#include --#include --#include --#include -- --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 --#include --#include --#include --#include -- --#include --#include --#include -- --#include --#include --#include -- --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<> 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 -- * 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 -- -- .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 --#include --#include -- --#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 /* 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 --#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 -- --#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 -- --/* -- * 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 -- --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 -- * -- * 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 -- * Copied from the motorola bsp package and added gpio demux -- * interrupt handler -- */ -- --#include --#include --#include --#include -- --#include --#include -- --#include -- --/* -- * -- * 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 -- * -- * -- * 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 --#include -- --#include --#include -- --#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 -- * -- * 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 -- * -- * 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 --#include --#include --#include --#include --#include --#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 -- * -- * 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 --#include --#include --#include --#include --#include --#include --#include -- --#include --#include -- --#include --#include --#include --#include --#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 --#include --#include --#include --#include --#include --#include --#include --#include --#include -- --#include --#include --#include --#include -- --/* 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 - -+#include - #include - - 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 -+#include -+#include - #include -+#include - #include - #include --#include --#include - - #include - #include - #include - --#include --#include - #include --#include --#include -+#include - #include -+#include - #include -+#include -+ - #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 -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#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 - #include - #include -+#include -+#include - #include - #include - #include -@@ -33,9 +35,117 @@ - #include - #include - #include -+#include -+#include -+#include -+#include - - #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 -+ * -+ * 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 -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#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 --#include --#include --#include - #include - #include -+#include -+#include -+#include -+#include - --#include - #include -+#include -+#include -+ -+#include - #include - #include --#include --#ifdef CONFIG_I2C_IMX - #include --#endif --#include -+#include - #include --#include - #include - - #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 - #include - #include -+#include - - #include - --#include - #include --#include --#include - #include -+#include -+#include -+#include - - #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 - #include - #include - #include - #include -+#include - #include - #include -+#include - #include -+#include - - #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 - #include - #include --#include - #include - #include - #include -@@ -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 - #include - #include -+#include -+#include -+#include - - #include - #include -@@ -32,11 +35,58 @@ - #include - #include - #include -+#include -+#include -+#include -+#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 -+#include - #include -- --#include -+#include -+#include - #include - #include --#include -+#include -+#include - --#include - #include - #include - #include - #include -+#include - #include -+#include - #include - #include --#include -+#include -+#include - - #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 -+#include -+#include - #include -- -+#include - #include -+#include - --#include - #include - #include - #include -+#include -+#include - - #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 -+#include -+#include - #include -- -+#include - #include -+#include - --#include - #include -+#include - #include - #include -+#include - - #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 - #include - #include -+#include -+#include -+#include -+#include - - #include - #include -@@ -37,7 +41,9 @@ - #include - #include - #include -+#include - #include -+#include - #include - #include - #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 -+#include -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#if defined CONFIG_I2C_IMX || defined CONFIG_I2C_IMX_MODULE -+#include -+#endif -+#include -+#include -+#include -+ -+#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 - #include - --#include - #include - #include - #include - #include --#include - #include - #include - #include -@@ -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 - #include --#include - #include - #include --#include - #include - #include - #include -@@ -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 - #include - #include -+#include - - #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 - #include - #include --#include - #include - - #include -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 - #include - #include --#include - #include - - #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. - * Copyright (C) 2007 MontaVista Software, Inc. -@@ -36,8 +38,13 @@ - #include - #include - -+/* 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 - #include - #include -+#include - - #include - #include -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 - #endif -+#ifdef CONFIG_MACH_MX21ADS -+#include -+#endif - #ifdef CONFIG_MACH_PCM038 - #include - #endif -@@ -34,6 +37,12 @@ - #ifdef CONFIG_MACH_QONG - #include - #endif -+#ifdef CONFIG_MACH_PCM043 -+#include -+#endif -+#ifdef CONFIG_MACH_MX27_3DS -+#include -+#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 -+ * -+ * 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 -+ -+/* -+ * The naming convention for the pad modes is MX35_PAD___ -+ * If or refers to a GPIO, it is named -+ * GPIO__ 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, -+ * -+ * -+ * 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___ -+ * If or refers to a GPIO, it is named -+ * GPIO__ -+ * -+ */ -+ -+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 --#include -- --#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 -+ * Copyright (C) 2009 by Jan Weitzel Phytec Messtechnik 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., 51 Franklin Street, Fifth Floor, Boston, -+ * MA 02110-1301, USA. -+ */ -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+ -+#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 - #include - --#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 - #include - #include -+#include -+ -+ -+/* 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 "); -- -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 - #include - #include --#include -+ -+/* 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 -- * -- * 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 --#include --#include -- --#include -- --/* 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 -+ -+#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 , 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, ®_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 , 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 , 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] \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 \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 \n"); -- fprintf(stderr, "\t-O \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 \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 \n"); -- fprintf(stderr, "\t\tMake space for reserve map entries (relevant for \n\t\tdtb and asm output only)\n"); -- fprintf(stderr, "\t-S \n"); -- fprintf(stderr, "\t\tMake the blob at least long (extra space)\n"); -- fprintf(stderr, "\t-p \n"); -- fprintf(stderr, "\t\tAdd padding to the blob of long (extra space)\n"); -- fprintf(stderr, "\t-b \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 , 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 --#include --#include --#include --#include --#include --#include --#include --#include -- --#include --#include -- --#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 , 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("\n"); \ -- BEGIN(INITIAL); \ -- } else { \ -- DPRINT("\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); -- } -- --<*><> { -- 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; -- } -- --[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; -- } -- --[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; -- } -- --[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; -- } -- --"&/"{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; -- } -- --[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; -- } -- --"]" { -- yylloc.file = srcpos_file; -- yylloc.first_line = yylineno; -- DPRINT("/BYTESTRING\n"); -- BEGIN_DEFAULT(); -- return ']'; -- } -- --{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("\n"); -- BEGIN(BYTESTRING); -- } -- if ((yytext[0] == '{') -- || (yytext[0] == ';')) { -- DPRINT("\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 --#include --#include --#include -- --/* end standard C headers. */ -- --/* flex integer type definitions */ -- --#ifndef FLEXINT_H --#define FLEXINT_H -- --/* C99 systems have . 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 --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 , 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("\n"); \ -- BEGIN(INITIAL); \ -- } else { \ -- DPRINT("\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 --#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("\n"); -- BEGIN(BYTESTRING); -- } -- if ((yytext[0] == '{') -- || (yytext[0] == ';')) { -- DPRINT("\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 -- --#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 /* 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 /* 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 /* INFRINGES ON USER NAME SPACE */ --# elif defined _AIX --# define YYSTACK_ALLOC __alloca --# elif defined _MSC_VER --# include /* 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 /* 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 /* 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 /* 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 : ""; -- 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 , 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 -- --#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 DT_PROPNODENAME --%token DT_LITERAL --%token DT_LEGACYLITERAL --%token DT_BASE --%token DT_BYTE --%token DT_STRING --%token DT_LABEL --%token DT_REF --%token DT_INCBIN -- --%type propdata --%type propdataprefix --%type memreserve --%type memreserves --%type v0_memreserve --%type v0_memreserves --%type addr --%type celllist --%type cellbase --%type cellval --%type bytestring --%type propdef --%type proplist -- --%type devicetree --%type nodedef --%type subnode --%type subnodes --%type 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 : ""; -- 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 , 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 , 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 --#include -- --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 --#include --#include -- --#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 , 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 -- --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 , 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 --#include -- --#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 --#include -- --#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 --#include -- --#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 --#include -- --#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 ""; -- else if (errval == 0) -- return ""; -- else if (errval > -FDT_ERRTABSIZE) { -- const char *s = fdt_errtable[-errval].str; -- -- if (s) -- return s; -- } -- -- return ""; --} -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 --#include -- --#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 --#include -- --#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 --#include -- --#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 -- --#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 - - 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 '

Linux Kernel HTML Documentation

' >> $(main_idx) && \ - echo '

Kernel Version: $(KERNELVERSION)

' >> $(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 -+ -+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 -+ -+ -+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 -+ */ -+ -+/* -+ * 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 -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+/* 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 -+ * Copyright (C) 2007-2009 Arjan Opmeer - * - * 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 -+ * Copyright (C) 2007-2009 Arjan Opmeer - * - * 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 - * Copyright (c) 2001 Frederic Lepied - * Copyright (c) 2004 Panagiotis Issaris -- * Copyright (c) 2002-2008 Ping Cheng -+ * Copyright (c) 2002-2009 Ping Cheng - * - * 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 " - #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 */ - 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 handler: unexpected completion 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 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 " - #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 - #include - #include -+#include - - #include - #include -@@ -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 - #include - #include --#include - #include - #include - #include -+#include -+#include -+#include -+#include -+#include - --#include - #include - #include - #include --#include - - #include - -@@ -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 -+#include - - #include - - 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 - - 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 , 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, ®_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 , 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 , 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] \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 \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 \n"); -+ fprintf(stderr, "\t-O \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 \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 \n"); -+ fprintf(stderr, "\t\tMake space for reserve map entries (relevant for \n\t\tdtb and asm output only)\n"); -+ fprintf(stderr, "\t-S \n"); -+ fprintf(stderr, "\t\tMake the blob at least long (extra space)\n"); -+ fprintf(stderr, "\t-p \n"); -+ fprintf(stderr, "\t\tAdd padding to the blob of long (extra space)\n"); -+ fprintf(stderr, "\t-b \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 , 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 -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+ -+#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 , 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("\n"); \ -+ BEGIN(INITIAL); \ -+ } else { \ -+ DPRINT("\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); -+ } -+ -+<*><> { -+ 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; -+ } -+ -+[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; -+ } -+ -+[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; -+ } -+ -+[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; -+ } -+ -+"&/"{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; -+ } -+ -+[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; -+ } -+ -+"]" { -+ yylloc.file = srcpos_file; -+ yylloc.first_line = yylineno; -+ DPRINT("/BYTESTRING\n"); -+ BEGIN_DEFAULT(); -+ return ']'; -+ } -+ -+{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("\n"); -+ BEGIN(BYTESTRING); -+ } -+ if ((yytext[0] == '{') -+ || (yytext[0] == ';')) { -+ DPRINT("\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 -+#include -+#include -+#include -+ -+/* end standard C headers. */ -+ -+/* flex integer type definitions */ -+ -+#ifndef FLEXINT_H -+#define FLEXINT_H -+ -+/* C99 systems have . 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 -+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 , 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("\n"); \ -+ BEGIN(INITIAL); \ -+ } else { \ -+ DPRINT("\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 -+#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("\n"); -+ BEGIN(BYTESTRING); -+ } -+ if ((yytext[0] == '{') -+ || (yytext[0] == ';')) { -+ DPRINT("\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 -+ -+#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 /* 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 /* 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 /* INFRINGES ON USER NAME SPACE */ -+# elif defined _AIX -+# define YYSTACK_ALLOC __alloca -+# elif defined _MSC_VER -+# include /* 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 /* 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 /* 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 /* 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 : ""; -+ 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 , 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 -+ -+#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 DT_PROPNODENAME -+%token DT_LITERAL -+%token DT_LEGACYLITERAL -+%token DT_BASE -+%token DT_BYTE -+%token DT_STRING -+%token DT_LABEL -+%token DT_REF -+%token DT_INCBIN -+ -+%type propdata -+%type propdataprefix -+%type memreserve -+%type memreserves -+%type v0_memreserve -+%type v0_memreserves -+%type addr -+%type celllist -+%type cellbase -+%type cellval -+%type bytestring -+%type propdef -+%type proplist -+ -+%type devicetree -+%type nodedef -+%type subnode -+%type subnodes -+%type 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 : ""; -+ 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 , 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 , 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 -+#include -+ -+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 -+#include -+ -+#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 -+#include -+ -+#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 -+#include -+ -+#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 -+#include -+ -+#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 ""; -+ else if (errval == 0) -+ return ""; -+ else if (errval > -FDT_ERRTABSIZE) { -+ const char *s = fdt_errtable[-errval].str; -+ -+ if (s) -+ return s; -+ } -+ -+ return ""; -+} -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 -+#include -+ -+#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 -+#include -+ -+#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 -+#include -+#include -+ -+#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 -+#include -+ -+#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 -+ -+#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 , 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 -+ -+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 , 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 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 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-rc4/tx25/linux-2.6.30-rc4-karo.diff b/recipes/linux/linux-2.6.30-rc4/tx25/linux-2.6.30-rc4-karo.diff deleted file mode 100644 index 17765b46f6..0000000000 --- a/recipes/linux/linux-2.6.30-rc4/tx25/linux-2.6.30-rc4-karo.diff +++ /dev/null @@ -1,15337 +0,0 @@ -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-08 13:11:18.000000000 +0200 -@@ -0,0 +1,1203 @@ -+# -+# Automatically generated make config: don't edit -+# Linux kernel version: 2.6.30-rc4 -+# Fri Jun 5 21:17: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_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 is not set -+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=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 -+ -+# -+# 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_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 -+ -+# -+# 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=y -+CONFIG_NETCONSOLE_DYNAMIC=y -+CONFIG_NETPOLL=y -+# CONFIG_NETPOLL_TRAP is not set -+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 -+# 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-08 13:11:18.000000000 +0200 -@@ -0,0 +1,1203 @@ -+# -+# Automatically generated make config: don't edit -+# Linux kernel version: 2.6.30-rc4 -+# Fri Jun 5 21:17: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_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 is not set -+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=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 -+ -+# -+# 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_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 -+ -+# -+# 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=y -+CONFIG_NETCONSOLE_DYNAMIC=y -+CONFIG_NETPOLL=y -+# CONFIG_NETPOLL_TRAP is not set -+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 -+# 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/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-08 12:45:22.000000000 +0200 -@@ -6,14 +6,26 @@ choice - - config MACH_MX21 - bool "i.MX21 support" -+ select ARCH_MXC_IOMUX_V2 -+ select ARCH_MXC_HAS_NFC_V1 - help - This enables support for Freescale's MX2 based i.MX21 processor. - - config MACH_MX27 - bool "i.MX27 support" -+ select ARCH_MXC_IOMUX_V2 -+ select ARCH_MXC_HAS_NFC_V1 - 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_V1_1 -+ select PHYLIB if FEC -+ help -+ This enables support for Freescale's MX2 based i.MX25 processor. -+ - endchoice - - comment "MX2 platforms:" -@@ -39,6 +51,26 @@ config MACH_PCM038 - Include support for phyCORE-i.MX27 (aka pcm038) platform. This - includes specific configurations for the module and its peripherals. - -+config MACH_TX25 -+ bool "Support Ka-Ro electronics TX25 module" -+ depends on MACH_MX25 -+ help -+ Include support for Ka-Ro TX25 processor module -+ -+config KARO_DEBUG -+ bool "Enable Ka-Ro specific debug messages" -+ depends on MACH_TX25 || MACH_TX27 -+ help -+ Compile the architecture specific files with -DDEBUG to enable -+ additional debug messages -+ -+config MACH_STK5_BASEBOARD -+ bool "Ka-Ro Starterkit-5 (STK5) development board" -+ depends on MACH_TX27 || MACH_TX25 -+ help -+ This adds board specific devices that can be found on Ka-Ro's -+ STK5 evaluation board. -+ - choice - prompt "Baseboard" - depends on MACH_PCM038 -@@ -60,3 +92,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:59:14.000000000 +0200 -@@ -2,17 +2,31 @@ - # Makefile for the linux kernel. - # - -+ifeq ($(CONFIG_KARO_DEBUG),y) -+ EXTRA_CFLAGS += -DDEBUG -+endif -+ - # Object file lists. - --obj-y := generic.o devices.o serial.o -+obj-y := generic.o serial.o -+obj-$(CONFIG_MACH_MX25) += devices_mx25.o -+ifeq ($(CONFIG_MACH_MX25),) -+obj-y += devices.o -+endif -+ -+obj-$(CONFIG_MACH_MX21) += clock_imx21.o - --obj-$(CONFIG_MACH_MX21) += clock_imx21.o -+obj-$(CONFIG_MACH_MX25) += clock_imx25.o -+obj-$(CONFIG_MACH_MX25) += cpu_imx25.o - --obj-$(CONFIG_MACH_MX27) += cpu_imx27.o --obj-$(CONFIG_MACH_MX27) += clock_imx27.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 -+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 -+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: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 - initrd_phys-$(CONFIG_MACH_MX27) := 0xA0800000 -+ -+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:59:15.000000000 +0200 -@@ -890,7 +890,7 @@ static struct clk clko_clk = { - .con_id = n, \ - .clk = &c, \ - }, --static struct clk_lookup lookups[] __initdata = { -+static struct clk_lookup lookups[] = { - /* 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-08 12:46:51.000000000 +0200 -@@ -0,0 +1,1848 @@ -+/* -+ * Copyright 2008 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 -+ */ -+ -+/* based on mach-mx27/clock.c */ -+ -+#include -+#include -+#include -+//#include -+ -+#include -+//#include -+ -+#include -+#include -+#include -+ -+/* Register offsets */ -+#define MXC_CCM_MPCTL (IO_ADDRESS(CCM_BASE_ADDR) + 0x00) -+#define MXC_CCM_UPCTL (IO_ADDRESS(CCM_BASE_ADDR) + 0x04) -+#define MXC_CCM_CCTL (IO_ADDRESS(CCM_BASE_ADDR) + 0x08) -+#define MXC_CCM_CGCR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x0C) -+#define MXC_CCM_CGCR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x10) -+#define MXC_CCM_CGCR2 (IO_ADDRESS(CCM_BASE_ADDR) + 0x14) -+#define MXC_CCM_PCDR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x18) -+#define MXC_CCM_PCDR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x1C) -+#define MXC_CCM_PCDR2 (IO_ADDRESS(CCM_BASE_ADDR) + 0x20) -+#define MXC_CCM_PCDR3 (IO_ADDRESS(CCM_BASE_ADDR) + 0x24) -+#define MXC_CCM_RCSR (IO_ADDRESS(CCM_BASE_ADDR) + 0x28) -+#define MXC_CCM_CRDR (IO_ADDRESS(CCM_BASE_ADDR) + 0x2C) -+#define MXC_CCM_DCVR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x30) -+#define MXC_CCM_DCVR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x34) -+#define MXC_CCM_DCVR2 (IO_ADDRESS(CCM_BASE_ADDR) + 0x38) -+#define MXC_CCM_DCVR3 (IO_ADDRESS(CCM_BASE_ADDR) + 0x3C) -+#define MXC_CCM_LTR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x40) -+#define MXC_CCM_LTR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x44) -+#define MXC_CCM_LTR2 (IO_ADDRESS(CCM_BASE_ADDR) + 0x48) -+#define MXC_CCM_LTR3 (IO_ADDRESS(CCM_BASE_ADDR) + 0x4C) -+#define MXC_CCM_LTBR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x50) -+#define MXC_CCM_LTBR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x54) -+#define MXC_CCM_PMCR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x58) -+#define MXC_CCM_PMCR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x5C) -+#define MXC_CCM_PMCR2 (IO_ADDRESS(CCM_BASE_ADDR) + 0x60) -+#define MXC_CCM_MCR (IO_ADDRESS(CCM_BASE_ADDR) + 0x64) -+ -+#define MXC_CCM_MPCTL_BRMO (1 << 31) -+#define MXC_CCM_MPCTL_PD_OFFSET 26 -+#define MXC_CCM_MPCTL_PD_MASK (0xf << 26) -+#define MXC_CCM_MPCTL_MFD_OFFSET 16 -+#define MXC_CCM_MPCTL_MFD_MASK (0x3ff << 16) -+#define MXC_CCM_MPCTL_MFI_OFFSET 10 -+#define MXC_CCM_MPCTL_MFI_MASK (0xf << 10) -+#define MXC_CCM_MPCTL_MFN_OFFSET 0 -+#define MXC_CCM_MPCTL_MFN_MASK 0x3ff -+#define MXC_CCM_MPCTL_LF (1 << 15) -+ -+#define MXC_CCM_UPCTL_BRMO (1 << 31) -+#define MXC_CCM_UPCTL_PD_OFFSET 26 -+#define MXC_CCM_UPCTL_PD_MASK (0xf << 26) -+#define MXC_CCM_UPCTL_MFD_OFFSET 16 -+#define MXC_CCM_UPCTL_MFD_MASK (0x3ff << 16) -+#define MXC_CCM_UPCTL_MFI_OFFSET 10 -+#define MXC_CCM_UPCTL_MFI_MASK (0xf << 10) -+#define MXC_CCM_UPCTL_MFN_OFFSET 0 -+#define MXC_CCM_UPCTL_MFN_MASK 0x3ff -+#define MXC_CCM_UPCTL_LF (1 << 15) -+ -+#define MXC_CCM_CCTL_ARM_OFFSET 30 -+#define MXC_CCM_CCTL_ARM_MASK (0x3 << 30) -+#define MXC_CCM_CCTL_AHB_OFFSET 28 -+#define MXC_CCM_CCTL_AHB_MASK (0x3 << 28) -+#define MXC_CCM_CCTL_MPLL_RST (1 << 27) -+#define MXC_CCM_CCTL_UPLL_RST (1 << 26) -+#define MXC_CCM_CCTL_LP_CTL_OFFSET 24 -+#define MXC_CCM_CCTL_LP_CTL_MASK (0x3 << 24) -+#define MXC_CCM_CCTL_LP_MODE_RUN (0x0 << 24) -+#define MXC_CCM_CCTL_LP_MODE_WAIT (0x1 << 24) -+#define MXC_CCM_CCTL_LP_MODE_DOZE (0x2 << 24) -+#define MXC_CCM_CCTL_LP_MODE_STOP (0x3 << 24) -+#define MXC_CCM_CCTL_UPLL_DISABLE (1 << 23) -+#define MXC_CCM_CCTL_MPLL_BYPASS (1 << 22) -+#define MXC_CCM_CCTL_USB_DIV_OFFSET 16 -+#define MXC_CCM_CCTL_USB_DIV_MASK (0x3 << 16) -+#define MXC_CCM_CCTL_CG_CTRL (1 << 15) -+#define MXC_CCM_CCTL_ARM_SRC (1 << 14) -+ -+#define MXC_CCM_CGCR0_HCLK_ATA_OFFSET (16 + 0) -+#define MXC_CCM_CGCR0_HCLK_BROM_OFFSET (16 + 1) -+#define MXC_CCM_CGCR0_HCLK_CSI_OFFSET (16 + 2) -+#define MXC_CCM_CGCR0_HCLK_EMI_OFFSET (16 + 3) -+#define MXC_CCM_CGCR0_HCLK_ESAI_OFFSET (16 + 4) -+#define MXC_CCM_CGCR0_HCLK_ESDHC1_OFFSET (16 + 5) -+#define MXC_CCM_CGCR0_HCLK_ESDHC2_OFFSET (16 + 6) -+#define MXC_CCM_CGCR0_HCLK_FEC_OFFSET (16 + 7) -+#define MXC_CCM_CGCR0_HCLK_LCDC_OFFSET (16 + 8) -+#define MXC_CCM_CGCR0_HCLK_RTIC_OFFSET (16 + 9) -+#define MXC_CCM_CGCR0_HCLK_SDMA_OFFSET (16 + 10) -+#define MXC_CCM_CGCR0_HCLK_SLCDC_OFFSET (16 + 11) -+#define MXC_CCM_CGCR0_HCLK_USBOTG_OFFSET (16 + 12) -+ -+#define MXC_CCM_CGCR0_PER_CSI_OFFSET 0 -+#define MXC_CCM_CGCR0_PER_EPIT_OFFSET 1 -+#define MXC_CCM_CGCR0_PER_ESAI_OFFSET 2 -+#define MXC_CCM_CGCR0_PER_ESDHC1_OFFSET 3 -+#define MXC_CCM_CGCR0_PER_ESDHC2_OFFSET 4 -+#define MXC_CCM_CGCR0_PER_GPT_OFFSET 5 -+#define MXC_CCM_CGCR0_PER_I2C_OFFSET 6 -+#define MXC_CCM_CGCR0_PER_LCDC_OFFSET 7 -+#define MXC_CCM_CGCR0_PER_NFC_OFFSET 8 -+#define MXC_CCM_CGCR0_PER_OWIRE_OFFSET 9 -+#define MXC_CCM_CGCR0_PER_PWM_OFFSET 10 -+#define MXC_CCM_CGCR0_PER_SIM1_OFFSET 11 -+#define MXC_CCM_CGCR0_PER_SIM2_OFFSET 12 -+#define MXC_CCM_CGCR0_PER_SSI1_OFFSET 13 -+#define MXC_CCM_CGCR0_PER_SSI2_OFFSET 14 -+#define MXC_CCM_CGCR0_PER_UART_OFFSET 15 -+ -+#define MXC_CCM_CGCR1_AUDMUX_OFFSET 0 -+#define MXC_CCM_CGCR1_ATA_OFFSET 1 -+#define MXC_CCM_CGCR1_CAN1_OFFSET 2 -+#define MXC_CCM_CGCR1_CAN2_OFFSET 3 -+#define MXC_CCM_CGCR1_CSI_OFFSET 4 -+#define MXC_CCM_CGCR1_CSPI1_OFFSET 5 -+#define MXC_CCM_CGCR1_CSPI2_OFFSET 6 -+#define MXC_CCM_CGCR1_CSPI3_OFFSET 7 -+#define MXC_CCM_CGCR1_DRYICE_OFFSET 8 -+#define MXC_CCM_CGCR1_ECT_OFFSET 9 -+#define MXC_CCM_CGCR1_EPIT1_OFFSET 10 -+#define MXC_CCM_CGCR1_EPIT2_OFFSET 11 -+#define MXC_CCM_CGCR1_ESAI_OFFSET 12 -+#define MXC_CCM_CGCR1_ESDHC1_OFFSET 13 -+#define MXC_CCM_CGCR1_ESDHC2_OFFSET 14 -+#define MXC_CCM_CGCR1_FEC_OFFSET 15 -+#define MXC_CCM_CGCR1_GPIO1_OFFSET 16 -+#define MXC_CCM_CGCR1_GPIO2_OFFSET 17 -+#define MXC_CCM_CGCR1_GPIO3_OFFSET 18 -+#define MXC_CCM_CGCR1_GPT1_OFFSET 19 -+#define MXC_CCM_CGCR1_GPT2_OFFSET 20 -+#define MXC_CCM_CGCR1_GPT3_OFFSET 21 -+#define MXC_CCM_CGCR1_GPT4_OFFSET 22 -+#define MXC_CCM_CGCR1_I2C1_OFFSET 23 -+#define MXC_CCM_CGCR1_I2C2_OFFSET 24 -+#define MXC_CCM_CGCR1_I2C3_OFFSET 25 -+#define MXC_CCM_CGCR1_IIM_OFFSET 26 -+#define MXC_CCM_CGCR1_IOMUXC_OFFSET 27 -+#define MXC_CCM_CGCR1_KPP_OFFSET 28 -+#define MXC_CCM_CGCR1_LCDC_OFFSET 29 -+#define MXC_CCM_CGCR1_OWIRE_OFFSET 30 -+#define MXC_CCM_CGCR1_PWM1_OFFSET 31 -+ -+#define MXC_CCM_CGCR2_PWM2_OFFSET (32 - 32) -+#define MXC_CCM_CGCR2_PWM3_OFFSET (33 - 32) -+#define MXC_CCM_CGCR2_PWM4_OFFSET (34 - 32) -+#define MXC_CCM_CGCR2_RNGB_OFFSET (35 - 32) -+#define MXC_CCM_CGCR2_RTIC_OFFSET (36 - 32) -+#define MXC_CCM_CGCR2_SCC_OFFSET (37 - 32) -+#define MXC_CCM_CGCR2_SDMA_OFFSET (38 - 32) -+#define MXC_CCM_CGCR2_SIM1_OFFSET (39 - 32) -+#define MXC_CCM_CGCR2_SIM2_OFFSET (40 - 32) -+#define MXC_CCM_CGCR2_SLCDC_OFFSET (41 - 32) -+#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_UART1_OFFSET (46 - 32) -+#define MXC_CCM_CGCR2_UART2_OFFSET (47 - 32) -+#define MXC_CCM_CGCR2_UART3_OFFSET (48 - 32) -+#define MXC_CCM_CGCR2_UART4_OFFSET (49 - 32) -+#define MXC_CCM_CGCR2_UART5_OFFSET (50 - 32) -+#define MXC_CCM_CGCR2_WDOG_OFFSET (51 - 32) -+ -+#define MXC_CCM_PCDR1_PERDIV1_MASK 0x3f -+ -+#define MXC_CCM_MCR_USB_XTAL_MUX_OFFSET 31 -+#define MXC_CCM_MCR_CLKO_EN_OFFSET 30 -+#define MXC_CCM_MCR_CLKO_DIV_OFFSET 24 -+#define MXC_CCM_MCR_CLKO_DIV_MASK (0x3F << 24) -+#define MXC_CCM_MCR_CLKO_SEL_OFFSET 20 -+#define MXC_CCM_MCR_CLKO_SEL_MASK (0xF << 20) -+#define MXC_CCM_MCR_ESAI_CLK_MUX_OFFSET 19 -+#define MXC_CCM_MCR_SSI2_CLK_MUX_OFFSET 18 -+#define MXC_CCM_MCR_SSI1_CLK_MUX_OFFSET 17 -+#define MXC_CCM_MCR_USB_CLK_MUX_OFFSET 16 -+ -+#define MXC_CCM_MCR_PER_CLK_MUX_MASK (0xFFFF << 0) -+ -+#define OSC24M_CLK_FREQ 24000000 /* 24MHz reference clk */ -+#define OSC32K_CLK_FREQ 32768 /* 32.768kHz oscillator in */ -+ -+static struct clk mpll_clk; -+static struct clk upll_clk; -+static struct clk ahb_clk; -+static struct clk upll_24610k_clk; -+ -+static int _clk_enable(struct clk *clk) -+{ -+ unsigned long reg; -+ -+ if (!clk->enable_reg) -+ return 0; -+ -+ reg = __raw_readl(clk->enable_reg); -+ reg |= 1 << clk->enable_shift; -+ __raw_writel(reg, clk->enable_reg); -+ -+ return 0; -+} -+ -+static void _clk_disable(struct clk *clk) -+{ -+ unsigned long reg; -+ -+ if (!clk->enable_reg) -+ return; -+ -+ reg = __raw_readl(clk->enable_reg); -+ reg &= ~(1 << clk->enable_shift); -+ __raw_writel(reg, clk->enable_reg); -+} -+ -+static int _clk_upll_enable(struct clk *clk) -+{ -+ unsigned long reg; -+ -+ reg = __raw_readl(MXC_CCM_CCTL); -+ reg &= ~MXC_CCM_CCTL_UPLL_DISABLE; -+ __raw_writel(reg, MXC_CCM_CCTL); -+ -+ while (!(__raw_readl(MXC_CCM_UPCTL) & MXC_CCM_UPCTL_LF)) -+ cpu_relax(); -+ -+ return 0; -+} -+ -+static void _clk_upll_disable(struct clk *clk) -+{ -+ unsigned long reg; -+ -+ reg = __raw_readl(MXC_CCM_CCTL); -+ reg |= MXC_CCM_CCTL_UPLL_DISABLE; -+ __raw_writel(reg, MXC_CCM_CCTL); -+} -+ -+static int _perclk_enable(struct clk *clk) -+{ -+ unsigned long reg; -+ -+ reg = __raw_readl(MXC_CCM_CGCR0); -+ reg |= 1 << clk->id; -+ __raw_writel(reg, MXC_CCM_CGCR0); -+ -+ return 0; -+} -+ -+static void _perclk_disable(struct clk *clk) -+{ -+ unsigned long reg; -+ -+ reg = __raw_readl(MXC_CCM_CGCR0); -+ reg &= ~(1 << clk->id); -+ __raw_writel(reg, MXC_CCM_CGCR0); -+} -+ -+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) */ -+ signed long mfn; /* Multiplication Factor (Integer part) */ -+ signed long mfd; /* Multiplication Factor (Denominator Part) */ -+ signed long tmp; -+ unsigned long ref_freq = clk_get_rate(clk->parent); -+ -+ 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; -+ 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); -+ -+ mfn = (mfn + ((mfn < 0) ? 1024 : 0)) & 0x3ff; -+ pd--; -+ mfd--; -+ -+ /* Change the Pll value */ -+ reg = (mfi << MXC_CCM_MPCTL_MFI_OFFSET) | -+ (mfn << MXC_CCM_MPCTL_MFN_OFFSET) | -+ (mfd << MXC_CCM_MPCTL_MFD_OFFSET) | -+ (pd << MXC_CCM_MPCTL_PD_OFFSET); -+ -+ if (clk == &mpll_clk) { -+ printk(KERN_DEBUG "Changing MPCTL from %08x to %08lx\n", -+ __raw_readl(MXC_CCM_MPCTL), reg); -+ } else if (clk == &upll_clk) { -+ printk(KERN_DEBUG "Changing UPCTL from %08x to %08lx\n", -+ __raw_readl(MXC_CCM_UPCTL), reg); -+ } -+ if (clk == &mpll_clk) -+ __raw_writel(reg, MXC_CCM_MPCTL); -+ else if (clk == &upll_clk) -+ __raw_writel(reg, MXC_CCM_UPCTL); -+ return 0; -+} -+ -+static unsigned long _clk_pll_getrate(struct clk *clk) -+{ -+ unsigned long rate; -+ signed long mfi, mfn, mfd, pdf; -+ unsigned long ref_clk; -+ unsigned long reg; -+ -+ ref_clk = clk_get_rate(clk->parent); -+ -+ if (clk == &mpll_clk) { -+ reg = __raw_readl(MXC_CCM_MPCTL); -+ pdf = (reg & MXC_CCM_MPCTL_PD_MASK) >> MXC_CCM_MPCTL_PD_OFFSET; -+ mfd = (reg & MXC_CCM_MPCTL_MFD_MASK) >> MXC_CCM_MPCTL_MFD_OFFSET; -+ mfi = (reg & MXC_CCM_MPCTL_MFI_MASK) >> MXC_CCM_MPCTL_MFI_OFFSET; -+ mfn = (reg & MXC_CCM_MPCTL_MFN_MASK) >> MXC_CCM_MPCTL_MFN_OFFSET; -+ } else if (clk == &upll_clk) { -+ reg = __raw_readl(MXC_CCM_UPCTL); -+ pdf = (reg & MXC_CCM_UPCTL_PD_MASK) >> MXC_CCM_UPCTL_PD_OFFSET; -+ mfd = (reg & MXC_CCM_UPCTL_MFD_MASK) >> MXC_CCM_UPCTL_MFD_OFFSET; -+ mfi = (reg & MXC_CCM_UPCTL_MFI_MASK) >> MXC_CCM_UPCTL_MFI_OFFSET; -+ mfn = (reg & MXC_CCM_UPCTL_MFN_MASK) >> MXC_CCM_UPCTL_MFN_OFFSET; -+ } else { -+ BUG(); /* oops */ -+ } -+ -+ mfi = (mfi < 5) ? 5 : mfi; -+ rate = 2LL * ref_clk * mfn; -+ do_div(rate, mfd + 1); -+ rate = 2LL * ref_clk * mfi + rate; -+ do_div(rate, pdf + 1); -+ -+ return rate; -+} -+ -+static unsigned long _clk_cpu_round_rate(struct clk *clk, unsigned long rate) -+{ -+ int div = clk_get_rate(clk->parent) / rate; -+ -+ if (clk_get_rate(clk->parent) % rate) -+ div++; -+ -+ if (div > 4) -+ div = 4; -+ -+ return clk_get_rate(clk->parent) / div; -+} -+ -+static int _clk_cpu_set_rate(struct clk *clk, unsigned long rate) -+{ -+ int div, reg; -+ unsigned long cctl = __raw_readl(MXC_CCM_CCTL); -+ -+ div = clk_get_rate(clk->parent) / rate; -+ -+ if (div > 4 || div < 1 || ((clk_get_rate(clk->parent) / div) != rate)) -+ return -EINVAL; -+ div--; -+ -+ reg = (cctl & ~MXC_CCM_CCTL_ARM_MASK) | -+ (div << MXC_CCM_CCTL_ARM_OFFSET); -+ __raw_writel(reg, MXC_CCM_CCTL); -+ -+ return 0; -+} -+ -+static unsigned long _clk_cpu_getrate(struct clk *clk) -+{ -+ unsigned long div; -+ unsigned long cctl = __raw_readl(MXC_CCM_CCTL); -+ unsigned long rate; -+ -+ div = (cctl & MXC_CCM_CCTL_ARM_MASK) >> MXC_CCM_CCTL_ARM_OFFSET; -+ -+ rate = clk_get_rate(clk->parent) / (div + 1); -+ -+ if (cctl & MXC_CCM_CCTL_ARM_SRC) { -+ rate *= 3; -+ rate /= 4; -+ } -+ return rate; -+} -+ -+static unsigned long _clk_ahb_getrate(struct clk *clk) -+{ -+ unsigned long div; -+ unsigned long cctl = __raw_readl(MXC_CCM_CCTL); -+ -+ div = (cctl & MXC_CCM_CCTL_AHB_MASK) >> MXC_CCM_CCTL_AHB_OFFSET; -+ -+ return clk_get_rate(clk->parent) / (div + 1); -+} -+ -+static void __iomem *pcdr_a[4] = { -+ MXC_CCM_PCDR0, MXC_CCM_PCDR1, MXC_CCM_PCDR2, MXC_CCM_PCDR3 -+}; -+ -+static unsigned long _clk_perclkx_getrate(struct clk *clk) -+{ -+ unsigned long perclk_pdf; -+ unsigned long pcdr; -+ -+ if (clk->id < 0 || clk->id > 15) -+ return 0; -+ -+ pcdr = __raw_readl(pcdr_a[clk->id >> 2]); -+ -+ perclk_pdf = -+ (pcdr >> ((clk->id & 3) << 3)) & MXC_CCM_PCDR1_PERDIV1_MASK; -+ -+ return clk_get_rate(clk->parent) / (perclk_pdf + 1); -+} -+ -+static unsigned long _clk_perclkx_round_rate(struct clk *clk, -+ unsigned long rate) -+{ -+ unsigned long div; -+ -+ div = clk_get_rate(clk->parent) / rate; -+ if (clk_get_rate(clk->parent) % rate) -+ div++; -+ -+ if (div > 64) -+ div = 64; -+ -+ return clk_get_rate(clk->parent) / div; -+} -+ -+static int _clk_perclkx_set_rate(struct clk *clk, unsigned long rate) -+{ -+ unsigned long reg; -+ unsigned long div; -+ -+ if (clk->id < 0 || clk->id > 15) -+ 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--; -+ -+ reg = -+ __raw_readl(pcdr_a[clk->id >> 2]) & ~(MXC_CCM_PCDR1_PERDIV1_MASK << -+ ((clk->id & 3) << 3)); -+ reg |= div << ((clk->id & 3) << 3); -+ __raw_writel(reg, pcdr_a[clk->id >> 2]); -+ -+ return 0; -+} -+ -+static int _clk_perclkx_set_parent(struct clk *clk, struct clk *parent) -+{ -+ unsigned long mcr; -+ -+ if (clk->parent == parent) -+ return 0; -+ if (parent != &upll_clk && parent != &ahb_clk) -+ return -EINVAL; -+ -+ clk->parent = parent; -+ mcr = __raw_readl(MXC_CCM_MCR); -+ if (parent == &upll_clk) -+ mcr |= (1 << clk->id); -+ else -+ mcr &= ~(1 << clk->id); -+ -+ __raw_writel(mcr, MXC_CCM_MCR); -+ -+ return 0; -+} -+ -+static int _clk_perclkx_set_parent3(struct clk *clk, struct clk *parent) -+{ -+ unsigned long mcr = __raw_readl(MXC_CCM_MCR); -+ int bit; -+ -+ if (clk->parent == parent) -+ return 0; -+ if (parent != &upll_clk && parent != &ahb_clk && -+ parent != &upll_24610k_clk) -+ return -EINVAL; -+ -+ switch (clk->id) { -+ case 2: -+ bit = MXC_CCM_MCR_ESAI_CLK_MUX_OFFSET; -+ break; -+ case 13: -+ bit = MXC_CCM_MCR_SSI1_CLK_MUX_OFFSET; -+ break; -+ case 14: -+ bit = MXC_CCM_MCR_SSI2_CLK_MUX_OFFSET; -+ break; -+ default: -+ return -EINVAL; -+ } -+ -+ if (parent == &upll_24610k_clk) { -+ mcr |= bit; -+ __raw_writel(mcr, MXC_CCM_MCR); -+ clk->parent = parent; -+ } else { -+ mcr &= ~bit; -+ __raw_writel(mcr, MXC_CCM_MCR); -+ return _clk_perclkx_set_parent(clk, parent); -+ } -+ -+ return 0; -+} -+ -+static unsigned long _clk_ipg_getrate(struct clk *clk) -+{ -+ return clk_get_rate(clk->parent) / 2; /* Always AHB / 2 */ -+} -+ -+/* Top-level clocks */ -+static unsigned long ckih_rate = OSC24M_CLK_FREQ; -+ -+static unsigned long clk_ckih_get_rate(struct clk *clk) -+{ -+ return ckih_rate; -+} -+ -+static unsigned long clk_ckil_get_rate(struct clk *clk) -+{ -+ return OSC32K_CLK_FREQ; -+} -+ -+static struct clk osc24m_clk = { -+ .get_rate = clk_ckih_get_rate, -+}; -+ -+static struct clk osc32k_clk = { -+ .get_rate = clk_ckil_get_rate, -+}; -+ -+static struct clk mpll_clk = { -+ .parent = &osc24m_clk, -+ .get_rate = _clk_pll_getrate, -+ .set_rate = _clk_pll_set_rate, -+}; -+ -+static struct clk upll_clk = { -+ .parent = &osc24m_clk, -+ .get_rate = _clk_pll_getrate, -+ .set_rate = _clk_pll_set_rate, -+ .enable = _clk_upll_enable, -+ .disable = _clk_upll_disable, -+}; -+ -+static unsigned long _clk_24610k_getrate(struct clk *clk) -+{ -+ long long rate = clk_get_rate(clk->parent) * 2461LL; -+ -+ do_div(rate, 24000); -+ -+ return rate; /* Always (UPLL * 24.61 / 240) */ -+} -+ -+static struct clk upll_24610k_clk = { -+ .parent = &upll_clk, -+ .get_rate = _clk_24610k_getrate, -+}; -+ -+/* Mid-level clocks */ -+ -+static struct clk cpu_clk = { /* ARM clock */ -+ .parent = &mpll_clk, -+ .set_rate = _clk_cpu_set_rate, -+ .get_rate = _clk_cpu_getrate, -+ .round_rate = _clk_cpu_round_rate, -+}; -+ -+static struct clk ahb_clk = { /* a.k.a. HCLK */ -+ .parent = &cpu_clk, -+ .get_rate = _clk_ahb_getrate, -+}; -+ -+static struct clk ipg_clk = { -+ .parent = &ahb_clk, -+ .get_rate = _clk_ipg_getrate, -+}; -+ -+/* Bottom-level clocks */ -+ -+struct clk usbotg_clk = { -+ .id = 0, -+ .parent = &ahb_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR0, -+ .enable_shift = MXC_CCM_CGCR0_HCLK_USBOTG_OFFSET, -+ .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, -+}; -+ -+struct clk emi_clk = { -+ .id = 0, -+ .parent = &ahb_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR0, -+ .enable_shift = MXC_CCM_CGCR0_HCLK_EMI_OFFSET, -+ .disable = _clk_disable, -+}; -+ -+struct clk brom_clk = { -+ .id = 0, -+ .parent = &ahb_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR0, -+ .enable_shift = MXC_CCM_CGCR0_HCLK_BROM_OFFSET, -+ .disable = _clk_disable, -+}; -+ -+static struct clk per_clk[] = { -+ { -+ .id = 0, -+ .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, -+ .get_rate = _clk_perclkx_getrate, -+ .enable = _perclk_enable, -+ .disable = _perclk_disable, -+ }, -+ { -+ .id = 1, -+ .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, -+ .get_rate = _clk_perclkx_getrate, -+ .enable = _perclk_enable, -+ .disable = _perclk_disable, -+ }, -+ { -+ .id = 2, -+ .parent = &ahb_clk, /* can be AHB or UPLL or 24.61MHz */ -+ .round_rate = _clk_perclkx_round_rate, -+ .set_rate = _clk_perclkx_set_rate, -+ .set_parent = _clk_perclkx_set_parent3, -+ .get_rate = _clk_perclkx_getrate, -+ .enable = _perclk_enable, -+ .disable = _perclk_disable, -+ }, -+ { -+ .id = 3, -+ .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, -+ .get_rate = _clk_perclkx_getrate, -+ .enable = _perclk_enable, -+ }, -+ { -+ .id = 4, -+ .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, -+ .get_rate = _clk_perclkx_getrate, -+ .enable = _perclk_enable, -+ .disable = _perclk_disable, -+ }, -+ { -+ .id = 5, -+ .parent = &upll_clk, /* can be AHB or UPLL */ -+ .round_rate = _clk_perclkx_round_rate, -+ .set_rate = _clk_perclkx_set_rate, -+ .set_parent = _clk_perclkx_set_parent, -+ .get_rate = _clk_perclkx_getrate, -+ .enable = _perclk_enable, -+ .disable = _perclk_disable, -+ }, -+ { -+ .id = 6, -+ .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, -+ .get_rate = _clk_perclkx_getrate, -+ .enable = _perclk_enable, -+ .disable = _perclk_disable, -+ }, -+ { -+ .id = 7, -+ .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, -+ .get_rate = _clk_perclkx_getrate, -+ .enable = _perclk_enable, -+ .disable = _perclk_disable, -+ }, -+ { -+ .id = 8, -+ .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, -+ .get_rate = _clk_perclkx_getrate, -+ .enable = _perclk_enable, -+ .disable = _perclk_disable, -+ }, -+ { -+ .id = 9, -+ .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, -+ .get_rate = _clk_perclkx_getrate, -+ .enable = _perclk_enable, -+ .disable = _perclk_disable, -+ }, -+ { -+ .id = 10, -+ .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, -+ .get_rate = _clk_perclkx_getrate, -+ .enable = _perclk_enable, -+ .disable = _perclk_disable, -+ }, -+ { -+ .id = 11, -+ .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, -+ .get_rate = _clk_perclkx_getrate, -+ .enable = _perclk_enable, -+ .disable = _perclk_disable, -+ }, -+ { -+ .id = 12, -+ .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, -+ .get_rate = _clk_perclkx_getrate, -+ .enable = _perclk_enable, -+ .disable = _perclk_disable, -+ }, -+ { -+ .id = 13, -+ .parent = &ahb_clk, /* can be AHB or UPLL or 24.61MHz */ -+ .round_rate = _clk_perclkx_round_rate, -+ .set_rate = _clk_perclkx_set_rate, -+ .set_parent = _clk_perclkx_set_parent3, -+ .get_rate = _clk_perclkx_getrate, -+ .enable = _perclk_enable, -+ .disable = _perclk_disable, -+ }, -+ { -+ .id = 14, -+ .parent = &ahb_clk, /* can be AHB or UPLL or 24.61MHz */ -+ .round_rate = _clk_perclkx_round_rate, -+ .set_rate = _clk_perclkx_set_rate, -+ .set_parent = _clk_perclkx_set_parent3, -+ .get_rate = _clk_perclkx_getrate, -+ .enable = _perclk_enable, -+ .disable = _perclk_disable, -+ }, -+ { -+ .id = 15, -+ .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, -+ .get_rate = _clk_perclkx_getrate, -+ .enable = _perclk_enable, -+ .disable = _perclk_disable, -+ }, -+}; -+ -+struct clk nfc_clk = { -+ .id = 0, -+ .parent = &per_clk[8], -+}; -+ -+struct clk audmux_clk = { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_AUDMUX_OFFSET, -+ .disable = _clk_disable, -+}; -+ -+struct clk ata_clk[] = { -+ { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_ATA_OFFSET, -+ .disable = _clk_disable, -+ .secondary = &ata_clk[1], -+ }, -+ { -+ .id = 0, -+ .parent = &ahb_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR0, -+ .enable_shift = MXC_CCM_CGCR0_HCLK_ATA_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk can_clk[] = { -+ { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_CAN1_OFFSET, -+ .disable = _clk_disable, -+ }, -+ { -+ .id = 1, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_CAN2_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk csi_clk[] = { -+ { -+ .id = 0, -+ .parent = &per_clk[0], -+ .secondary = &csi_clk[1], -+ }, -+ { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_CSI_OFFSET, -+ .disable = _clk_disable, -+ .secondary = &csi_clk[2], -+ }, -+ { -+ .id = 0, -+ .parent = &ahb_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR0, -+ .enable_shift = MXC_CCM_CGCR0_HCLK_CSI_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk cspi_clk[] = { -+ { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_CSPI1_OFFSET, -+ .disable = _clk_disable, -+ }, -+ { -+ .id = 1, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_CSPI2_OFFSET, -+ .disable = _clk_disable, -+ }, -+ { -+ .id = 2, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_CSPI3_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk dryice_clk = { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_DRYICE_OFFSET, -+ .disable = _clk_disable, -+}; -+ -+struct clk ect_clk = { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_ECT_OFFSET, -+ .disable = _clk_disable, -+}; -+ -+struct clk epit1_clk[] = { -+ { -+ .id = 0, -+ .parent = &per_clk[1], -+ .secondary = &epit1_clk[1], -+ }, -+ { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_EPIT1_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk epit2_clk[] = { -+ { -+ .id = 1, -+ .parent = &per_clk[1], -+ .secondary = &epit2_clk[1], -+ }, -+ { -+ .id = 1, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_EPIT2_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk esai_clk[] = { -+ { -+ .id = 0, -+ .parent = &per_clk[2], -+ .secondary = &esai_clk[1], -+ }, -+ { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_ESAI_OFFSET, -+ .disable = _clk_disable, -+ .secondary = &esai_clk[2], -+ }, -+ { -+ .id = 0, -+ .parent = &ahb_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR0, -+ .enable_shift = MXC_CCM_CGCR0_HCLK_ESAI_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk esdhc1_clk[] = { -+ { -+ .id = 0, -+ .parent = &per_clk[3], -+ .secondary = &esdhc1_clk[1], -+ }, -+ { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_ESDHC1_OFFSET, -+ .disable = _clk_disable, -+ .secondary = &esdhc1_clk[2], -+ }, -+ { -+ .id = 0, -+ .parent = &ahb_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR0, -+ .enable_shift = MXC_CCM_CGCR0_HCLK_ESDHC1_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk esdhc2_clk[] = { -+ { -+ .id = 1, -+ .parent = &per_clk[4], -+ .secondary = &esdhc2_clk[1], -+ }, -+ { -+ .id = 1, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_ESDHC2_OFFSET, -+ .disable = _clk_disable, -+ .secondary = &esdhc2_clk[2], -+ }, -+ { -+ .id = 1, -+ .parent = &ahb_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR0, -+ .enable_shift = MXC_CCM_CGCR0_HCLK_ESDHC2_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk fec_clk[] = { -+ { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_FEC_OFFSET, -+ .disable = _clk_disable, -+ .secondary = &fec_clk[1], -+ }, -+ { -+ .id = 0, -+ .parent = &ahb_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR0, -+ .enable_shift = MXC_CCM_CGCR0_HCLK_FEC_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk gpio_clk[] = { -+ { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_GPIO1_OFFSET, -+ .disable = _clk_disable, -+ }, -+ { -+ .id = 1, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_GPIO2_OFFSET, -+ .disable = _clk_disable, -+ }, -+ { -+ .id = 2, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_GPIO3_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+static struct clk gpt1_clk[] = { -+ { -+ .id = 0, -+ .parent = &per_clk[5], -+ .secondary = &gpt1_clk[1], -+ }, -+ { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_GPT1_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+static struct clk gpt2_clk[] = { -+ { -+ .id = 1, -+ .parent = &per_clk[5], -+ .secondary = &gpt1_clk[1], -+ }, -+ { -+ .id = 1, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_GPT2_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+static struct clk gpt3_clk[] = { -+ { -+ .id = 2, -+ .parent = &per_clk[5], -+ .secondary = &gpt1_clk[1], -+ }, -+ { -+ .id = 2, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_GPT3_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+static struct clk gpt4_clk[] = { -+ { -+ .id = 3, -+ .parent = &per_clk[5], -+ .secondary = &gpt1_clk[1], -+ }, -+ { -+ .id = 3, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_GPT4_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk i2c_clk[] = { -+ { -+ .id = 0, -+ .parent = &per_clk[6], -+ }, -+ { -+ .id = 1, -+ .parent = &per_clk[6], -+ }, -+ { -+ .id = 2, -+ .parent = &per_clk[6], -+ }, -+}; -+ -+struct clk iim_clk = { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_IIM_OFFSET, -+ .disable = _clk_disable, -+}; -+ -+struct clk iomuxc_clk = { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_IOMUXC_OFFSET, -+ .disable = _clk_disable, -+}; -+ -+struct clk kpp_clk = { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_KPP_OFFSET, -+ .disable = _clk_disable, -+}; -+ -+struct clk lcdc_clk[] = { -+ { -+ .id = 0, -+ .parent = &per_clk[7], -+ .secondary = &lcdc_clk[1], -+ }, -+ { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_LCDC_OFFSET, -+ .disable = _clk_disable, -+ .secondary = &lcdc_clk[2], -+ }, -+ { -+ .id = 0, -+ .parent = &ahb_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR0, -+ .enable_shift = MXC_CCM_CGCR0_HCLK_LCDC_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk owire_clk[] = { -+ { -+ .id = 0, -+ .parent = &per_clk[9], -+ .secondary = &owire_clk[1], -+ }, -+ { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_OWIRE_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk pwm1_clk[] = { -+ { -+ .id = 0, -+ .parent = &per_clk[10], -+ .secondary = &pwm1_clk[1], -+ }, -+ { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_PWM1_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk pwm2_clk[] = { -+ { -+ .id = 1, -+ .parent = &per_clk[10], -+ .secondary = &pwm2_clk[1], -+ }, -+ { -+ .id = 1, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR2, -+ .enable_shift = MXC_CCM_CGCR2_PWM2_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk pwm3_clk[] = { -+ { -+ .id = 2, -+ .parent = &per_clk[10], -+ .secondary = &pwm3_clk[1], -+ }, -+ { -+ .id = 2, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR2, -+ .enable_shift = MXC_CCM_CGCR2_PWM3_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk pwm4_clk[] = { -+ { -+ .id = 3, -+ .parent = &per_clk[10], -+ .secondary = &pwm4_clk[1], -+ }, -+ { -+ .id = 3, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR2, -+ .enable_shift = MXC_CCM_CGCR2_PWM3_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk rngb_clk = { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR2, -+ .enable_shift = MXC_CCM_CGCR2_RNGB_OFFSET, -+ .disable = _clk_disable, -+}; -+ -+struct clk scc_clk = { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR2, -+ .enable_shift = MXC_CCM_CGCR2_SCC_OFFSET, -+ .disable = _clk_disable, -+}; -+ -+struct clk sdma_clk[] = { -+ { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR2, -+ .enable_shift = MXC_CCM_CGCR2_SDMA_OFFSET, -+ .disable = _clk_disable, -+ .secondary = &sdma_clk[1], -+ }, -+ { -+ .id = 0, -+ .parent = &ahb_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR0, -+ .enable_shift = MXC_CCM_CGCR0_HCLK_SDMA_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk sim1_clk[] = { -+ { -+ .id = 0, -+ .parent = &per_clk[11], -+ .secondary = &sim1_clk[1], -+ }, -+ { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR2, -+ .enable_shift = MXC_CCM_CGCR2_SIM1_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk sim2_clk[] = { -+ { -+ .id = 1, -+ .parent = &per_clk[12], -+ .secondary = &sim2_clk[1], -+ }, -+ { -+ .id = 1, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR2, -+ .enable_shift = MXC_CCM_CGCR2_SIM2_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk slcdc_clk[] = { -+ { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR2, -+ .enable_shift = MXC_CCM_CGCR2_SLCDC_OFFSET, -+ .disable = _clk_disable, -+ .secondary = &slcdc_clk[1], -+ }, -+ { -+ .id = 0, -+ .parent = &ahb_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR0, -+ .enable_shift = MXC_CCM_CGCR0_HCLK_SLCDC_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk spba_clk = { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR2, -+ .enable_shift = MXC_CCM_CGCR2_SPBA_OFFSET, -+ .disable = _clk_disable, -+}; -+ -+struct clk ssi1_clk[] = { -+ { -+ .id = 0, -+ .parent = &per_clk[13], -+ .secondary = &ssi1_clk[1], -+ }, -+ { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR2, -+ .enable_shift = MXC_CCM_CGCR2_SSI1_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk ssi2_clk[] = { -+ { -+ .id = 1, -+ .parent = &per_clk[14], -+ .secondary = &ssi2_clk[1], -+ }, -+ { -+ .id = 1, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR2, -+ .enable_shift = MXC_CCM_CGCR2_SSI2_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk tchscrn_clk = { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR2, -+ .enable_shift = MXC_CCM_CGCR2_TCHSCRN_OFFSET, -+ .disable = _clk_disable, -+}; -+ -+struct clk uart1_clk[] = { -+ { -+ .id = 0, -+ .parent = &per_clk[15], -+ .secondary = &uart1_clk[1], -+ }, -+ { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR2, -+ .enable_shift = MXC_CCM_CGCR2_UART1_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk uart2_clk[] = { -+ { -+ .id = 1, -+ .parent = &per_clk[15], -+ .secondary = &uart2_clk[1], -+ }, -+ { -+ .id = 1, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR2, -+ .enable_shift = MXC_CCM_CGCR2_UART2_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk uart3_clk[] = { -+ { -+ .id = 2, -+ .parent = &per_clk[15], -+ .secondary = &uart3_clk[1], -+ }, -+ { -+ .id = 2, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR2, -+ .enable_shift = MXC_CCM_CGCR2_UART3_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk uart4_clk[] = { -+ { -+ .id = 3, -+ .parent = &per_clk[15], -+ .secondary = &uart4_clk[1], -+ }, -+ { -+ .id = 3, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR2, -+ .enable_shift = MXC_CCM_CGCR2_UART4_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk uart5_clk[] = { -+ { -+ .id = 4, -+ .parent = &per_clk[15], -+ .secondary = &uart5_clk[1], -+ }, -+ { -+ .id = 4, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR2, -+ .enable_shift = MXC_CCM_CGCR2_UART5_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk wdog_clk = { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR2, -+ .enable_shift = MXC_CCM_CGCR2_WDOG_OFFSET, -+ .disable = _clk_disable, -+}; -+ -+static unsigned long _clk_usb_round_rate(struct clk *clk, unsigned long rate) -+{ -+ unsigned long div; -+ -+ div = clk_get_rate(clk->parent) / rate; -+ if (clk_get_rate(clk->parent) % rate) -+ div++; -+ -+ if (div > 64) -+ return -EINVAL; -+ -+ return clk_get_rate(clk->parent) / div; -+} -+ -+static int _clk_usb_set_rate(struct clk *clk, unsigned long rate) -+{ -+ unsigned long reg; -+ unsigned long div; -+ -+ div = clk_get_rate(clk->parent) / rate; -+ -+ if (clk_get_rate(clk->parent) / div != rate) -+ return -EINVAL; -+ if (div > 64) -+ return -EINVAL; -+ -+ reg = __raw_readl(MXC_CCM_CCTL) & ~MXC_CCM_CCTL_USB_DIV_MASK; -+ reg |= (div - 1) << MXC_CCM_CCTL_USB_DIV_OFFSET; -+ __raw_writel(reg, MXC_CCM_MCR); -+ -+ return 0; -+} -+ -+static unsigned long _clk_usb_getrate(struct clk *clk) -+{ -+ unsigned long 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); -+} -+ -+static int _clk_usb_set_parent(struct clk *clk, struct clk *parent) -+{ -+ unsigned long mcr; -+ -+ if (clk->parent == parent) -+ return 0; -+ if (parent != &upll_clk && parent != &ahb_clk) -+ return -EINVAL; -+ -+ clk->parent = parent; -+ mcr = __raw_readl(MXC_CCM_MCR); -+ if (parent == &ahb_clk) -+ mcr |= (1 << MXC_CCM_MCR_USB_CLK_MUX_OFFSET); -+ else -+ mcr &= ~(1 << MXC_CCM_MCR_USB_CLK_MUX_OFFSET); -+ -+ __raw_writel(mcr, MXC_CCM_MCR); -+ -+ return 0; -+} -+ -+static struct clk usb_clk = { -+ .parent = &upll_clk, -+ .get_rate = _clk_usb_getrate, -+ .set_rate = _clk_usb_set_rate, -+ .round_rate = _clk_usb_round_rate, -+ .set_parent = _clk_usb_set_parent, -+}; -+ -+/* CLKO */ -+ -+static unsigned long _clk_clko_round_rate(struct clk *clk, unsigned long rate) -+{ -+ unsigned long div; -+ -+ div = clk_get_rate(clk->parent) / rate; -+ if (clk_get_rate(clk->parent) % rate) -+ div++; -+ -+ if (div > 64) -+ return -EINVAL; -+ -+ return clk_get_rate(clk->parent) / div; -+} -+ -+static int _clk_clko_set_rate(struct clk *clk, unsigned long rate) -+{ -+ unsigned long reg; -+ unsigned long div; -+ -+ div = clk_get_rate(clk->parent) / rate; -+ -+ if ((clk_get_rate(clk->parent) / div) != rate) -+ return -EINVAL; -+ if (div > 64) -+ return -EINVAL; -+ -+ reg = __raw_readl(MXC_CCM_MCR) & ~MXC_CCM_MCR_CLKO_DIV_MASK; -+ reg |= (div - 1) << MXC_CCM_MCR_CLKO_DIV_OFFSET; -+ __raw_writel(reg, MXC_CCM_MCR); -+ -+ return 0; -+} -+ -+static unsigned long _clk_clko_getrate(struct clk *clk) -+{ -+ unsigned long div = __raw_readl(MXC_CCM_MCR); -+ -+ div &= MXC_CCM_MCR_CLKO_DIV_MASK; -+ div >>= MXC_CCM_MCR_CLKO_DIV_OFFSET; -+ -+ return clk_get_rate(clk->parent) / (div + 1); -+} -+ -+static struct clk *clko_sources[] = { -+ &osc32k_clk, /* 0x0 */ -+ &osc24m_clk, /* 0x1 */ -+ &cpu_clk, /* 0x2 */ -+ &ahb_clk, /* 0x3 */ -+ &ipg_clk, /* 0x4 */ -+ NULL, /* 0x5 */ -+ NULL, /* 0x6 */ -+ NULL, /* 0x7 */ -+ NULL, /* 0x8 */ -+ NULL, /* 0x9 */ -+ &per_clk[0], /* 0xA */ -+ &per_clk[2], /* 0xB */ -+ &per_clk[13], /* 0xC */ -+ &per_clk[14], /* 0xD */ -+ &usb_clk, /* 0xE */ -+ NULL, /* 0xF */ -+}; -+ -+#define NR_CLKO_SOURCES (sizeof(clko_sources) / sizeof(struct clk *)) -+ -+static int _clk_clko_set_parent(struct clk *clk, struct clk *parent) -+{ -+ unsigned long reg; -+ struct clk **src; -+ int i; -+ -+ if (clk->parent == parent) -+ return 0; -+ for (i = 0, src = clko_sources; i < NR_CLKO_SOURCES; i++, src++) -+ if (*src == parent) -+ break; -+ -+ if (i == NR_CLKO_SOURCES) -+ return -EINVAL; -+ -+ clk->parent = parent; -+ -+ reg = __raw_readl(MXC_CCM_MCR) & ~MXC_CCM_MCR_CLKO_SEL_MASK; -+ reg |= i << MXC_CCM_MCR_CLKO_SEL_OFFSET; -+ __raw_writel(reg, MXC_CCM_MCR); -+ -+ return 0; -+} -+ -+static struct clk clko_clk = { -+ .set_rate = _clk_clko_set_rate, -+ .round_rate = _clk_clko_round_rate, -+ .set_parent = _clk_clko_set_parent, -+ .get_rate = _clk_clko_getrate, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_MCR, -+ .enable_shift = MXC_CCM_MCR_CLKO_EN_OFFSET, -+ .disable = _clk_disable, -+}; -+ -+#define _REGISTER_CLOCK(d, n, c) \ -+ { \ -+ .dev_id = d, \ -+ .con_id = n, \ -+ .clk = &c, \ -+ }, -+ -+static struct clk_lookup lookups[] = { -+ _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(NULL, "csi", csi_clk[0]) -+ _REGISTER_CLOCK(NULL, "cspi.0", cspi_clk[0]) -+ _REGISTER_CLOCK(NULL, "cspi.1", cspi_clk[1]) -+ _REGISTER_CLOCK(NULL, "cspi.2", cspi_clk[2]) -+ _REGISTER_CLOCK(NULL, "dryice", dryice_clk) -+ _REGISTER_CLOCK(NULL, "ect", ect_clk) -+ _REGISTER_CLOCK(NULL, "epit1", epit1_clk[0]) -+ _REGISTER_CLOCK(NULL, "epit2", epit2_clk[0]) -+ _REGISTER_CLOCK(NULL, "esai", esai_clk[0]) -+ _REGISTER_CLOCK("mxc-mmc.0", NULL, esdhc1_clk[0]) -+ _REGISTER_CLOCK("mxc-mmc.1", NULL, esdhc2_clk[0]) -+ _REGISTER_CLOCK("fec.0", NULL, fec_clk[0]) -+ _REGISTER_CLOCK(NULL, "gpio0", gpio_clk[0]) -+ _REGISTER_CLOCK(NULL, "gpio1", gpio_clk[1]) -+ _REGISTER_CLOCK(NULL, "gpio2", gpio_clk[2]) -+ _REGISTER_CLOCK(NULL, "gpt1", gpt1_clk[0]) -+ _REGISTER_CLOCK(NULL, "gpt2", gpt2_clk[0]) -+ _REGISTER_CLOCK(NULL, "gpt3", gpt3_clk[0]) -+ _REGISTER_CLOCK(NULL, "gpt4", gpt4_clk[0]) -+ _REGISTER_CLOCK("imx-i2c.0", NULL, i2c_clk[0]) -+ _REGISTER_CLOCK("imx-i2c.1", NULL, i2c_clk[1]) -+ _REGISTER_CLOCK("imx-i2c.2", NULL, i2c_clk[2]) -+ _REGISTER_CLOCK(NULL, "iim", iim_clk) -+ _REGISTER_CLOCK(NULL, "iomuxc", iomuxc_clk) -+ _REGISTER_CLOCK(NULL, "kpp", kpp_clk) -+ _REGISTER_CLOCK("imx-fb.0", NULL, lcdc_clk[0]) -+ _REGISTER_CLOCK(NULL, "owire", owire_clk[0]) -+ _REGISTER_CLOCK("mxc_pwm.0", NULL, pwm1_clk[0]) -+ _REGISTER_CLOCK("mxc_pwm.1", NULL, pwm2_clk[0]) -+ _REGISTER_CLOCK("mxc_pwm.2", NULL, pwm3_clk[0]) -+ _REGISTER_CLOCK("mxc_pwm.3", NULL, pwm4_clk[0]) -+ _REGISTER_CLOCK(NULL, "rngb", rngb_clk) -+ _REGISTER_CLOCK(NULL, "scc", scc_clk) -+ _REGISTER_CLOCK(NULL, "sdma", sdma_clk[0]) -+ _REGISTER_CLOCK(NULL, "sim1", sim1_clk[0]) -+ _REGISTER_CLOCK(NULL, "sim2", sim2_clk[0]) -+ _REGISTER_CLOCK(NULL, "slcdc", slcdc_clk[0]) -+ _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("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("imx-wdt.0", NULL, wdog_clk) -+ _REGISTER_CLOCK(NULL, "usb", usb_clk) -+ _REGISTER_CLOCK(NULL, "clko", clko_clk) -+ _REGISTER_CLOCK(NULL, "brom", brom_clk) -+}; -+ -+int __init mx25_clocks_init(unsigned long fref) -+{ -+ int i; -+ -+ 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 : ""); -+ clkdev_add(&lookups[i]); -+ } -+ -+ ckih_rate = fref; -+#ifndef CONFIG_DEBUG_LL -+ /* Turn off all possible clocks */ -+ __raw_writel((1 << MXC_CCM_CGCR0_HCLK_EMI_OFFSET), MXC_CCM_CGCR0); -+ -+ __raw_writel((1 << MXC_CCM_CGCR1_GPT1_OFFSET) | -+ (1 << MXC_CCM_CGCR1_IIM_OFFSET), MXC_CCM_CGCR1); -+ __raw_writel(1 << MXC_CCM_CGCR2_SCC_OFFSET, MXC_CCM_CGCR2); -+#endif -+#if 1 -+ /* Set all perclk sources to upll */ -+ for (i = 0; i < ARRAY_SIZE(per_clk); i++) { -+ int ret; -+ unsigned long rate = per_clk[i].get_rate(&per_clk[i]); -+ -+#ifdef CONFIG_DEBUG_LL -+ if (i == 15) { -+ printk(KERN_DEBUG "skipping per_clk[%d] rate=%lu\n", i, rate); -+ continue; -+ } -+#endif -+ { -+ unsigned long new_rate; -+ -+ 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); -+ clk_set_rate(&per_clk[8], clk_get_rate(&ahb_clk) / 6); -+ -+ /* This will propagate to all children and init all the clock rates */ -+#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)); -+ -+ pr_info("CPU: %lu.%03luMHz\n", -+ clk_get_rate(&cpu_clk) / 1000000, clk_get_rate(&cpu_clk) / 1000 % 1000); -+ pr_info("AHB: %lu.%03luMHz\n", -+ clk_get_rate(&ahb_clk) / 1000000, clk_get_rate(&ahb_clk) / 1000 % 1000); -+ pr_info("MPLL: %lu.%03luMHz\n", -+ clk_get_rate(&mpll_clk) / 1000000, clk_get_rate(&mpll_clk) / 1000 % 1000); -+ pr_info("UPLL: %lu.%03luMHz\n", -+ clk_get_rate(&upll_clk) / 1000000, clk_get_rate(&upll_clk) / 1000 % 1000); -+ 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]); -+ 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:59:15.000000000 +0200 -@@ -621,7 +621,7 @@ DEFINE_CLOCK1(csi_clk, 0, 0, 0, - .clk = &c, \ - }, - --static struct clk_lookup lookups[] __initdata = { -+static struct clk_lookup lookups[] = { - _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:59:17.000000000 +0200 -@@ -0,0 +1,65 @@ -+/* -+ * arch/arm/mach-mx2/cpu_mx25.c -+ * -+ * Copyright 2009 Lothar Wassmann -+ * derived from: cpu_mx27.c -+ * Copyright 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., 51 Franklin Street, Fifth Floor, Boston, -+ * MA 02110-1301, USA. -+ */ -+ -+/* -+ * i.MX25 specific CPU detection code -+ */ -+ -+#include -+#include -+ -+#include -+ -+static int cpu_silicon_rev = -1; -+static int cpu_partnumber; -+ -+#define IIM_PREV_REG IO_ADDRESS(IIM_BASE_ADDR + 0x20) -+#define IIM_SREV_REG IO_ADDRESS(IIM_BASE_ADDR + 0x24) -+ -+static void query_silicon_parameter(void) -+{ -+ cpu_partnumber = __raw_readl(IIM_PREV_REG) >> 3; -+ cpu_silicon_rev = __raw_readl(IIM_SREV_REG); -+ -+ printk(KERN_DEBUG "CPU rev: 0x%02x chip_rev: 0x%02x\n", -+ cpu_partnumber, cpu_silicon_rev); -+ if (WARN_ON(cpu_partnumber != 0x1f)) { -+ printk(KERN_WARNING "Unsupported CPU rev: 0x%02x\n", cpu_partnumber); -+ } -+} -+ -+/* -+ * Returns: -+ * the silicon revision of the cpu -+ * -EINVAL - not a mx25 -+ */ -+int mx25_revision(void) -+{ -+ if (cpu_silicon_rev == -1) -+ query_silicon_parameter(); -+ -+ if (cpu_partnumber != 0x1f) -+ return -EINVAL; -+ -+ 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:59:17.000000000 +0200 -@@ -0,0 +1,190 @@ -+/* -+ * Copyright 2008 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 __ARCH_ARM_MACH_MX25_CRM_REGS_H__ -+#define __ARCH_ARM_MACH_MX25_CRM_REGS_H__ -+ -+#include -+ -+/* Register offsets */ -+#define MXC_CCM_MPCTL (IO_ADDRESS(CCM_BASE_ADDR) + 0x00) -+#define MXC_CCM_UPCTL (IO_ADDRESS(CCM_BASE_ADDR) + 0x04) -+#define MXC_CCM_CCTL (IO_ADDRESS(CCM_BASE_ADDR) + 0x08) -+#define MXC_CCM_CGCR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x0C) -+#define MXC_CCM_CGCR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x10) -+#define MXC_CCM_CGCR2 (IO_ADDRESS(CCM_BASE_ADDR) + 0x14) -+#define MXC_CCM_PCDR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x18) -+#define MXC_CCM_PCDR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x1C) -+#define MXC_CCM_PCDR2 (IO_ADDRESS(CCM_BASE_ADDR) + 0x20) -+#define MXC_CCM_PCDR3 (IO_ADDRESS(CCM_BASE_ADDR) + 0x24) -+#define MXC_CCM_RCSR (IO_ADDRESS(CCM_BASE_ADDR) + 0x28) -+#define MXC_CCM_CRDR (IO_ADDRESS(CCM_BASE_ADDR) + 0x2C) -+#define MXC_CCM_DCVR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x30) -+#define MXC_CCM_DCVR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x34) -+#define MXC_CCM_DCVR2 (IO_ADDRESS(CCM_BASE_ADDR) + 0x38) -+#define MXC_CCM_DCVR3 (IO_ADDRESS(CCM_BASE_ADDR) + 0x3C) -+#define MXC_CCM_LTR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x40) -+#define MXC_CCM_LTR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x44) -+#define MXC_CCM_LTR2 (IO_ADDRESS(CCM_BASE_ADDR) + 0x48) -+#define MXC_CCM_LTR3 (IO_ADDRESS(CCM_BASE_ADDR) + 0x4C) -+#define MXC_CCM_LTBR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x50) -+#define MXC_CCM_LTBR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x54) -+#define MXC_CCM_PMCR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x58) -+#define MXC_CCM_PMCR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x5C) -+#define MXC_CCM_PMCR2 (IO_ADDRESS(CCM_BASE_ADDR) + 0x60) -+#define MXC_CCM_MCR (IO_ADDRESS(CCM_BASE_ADDR) + 0x64) -+ -+#define MXC_CCM_MPCTL_BRMO (1 << 31) -+#define MXC_CCM_MPCTL_PD_OFFSET 26 -+#define MXC_CCM_MPCTL_PD_MASK (0xf << 26) -+#define MXC_CCM_MPCTL_MFD_OFFSET 16 -+#define MXC_CCM_MPCTL_MFD_MASK (0x3ff << 16) -+#define MXC_CCM_MPCTL_MFI_OFFSET 10 -+#define MXC_CCM_MPCTL_MFI_MASK (0xf << 10) -+#define MXC_CCM_MPCTL_MFN_OFFSET 0 -+#define MXC_CCM_MPCTL_MFN_MASK 0x3ff -+#define MXC_CCM_MPCTL_LF (1 << 15) -+ -+#define MXC_CCM_UPCTL_BRMO (1 << 31) -+#define MXC_CCM_UPCTL_PD_OFFSET 26 -+#define MXC_CCM_UPCTL_PD_MASK (0xf << 26) -+#define MXC_CCM_UPCTL_MFD_OFFSET 16 -+#define MXC_CCM_UPCTL_MFD_MASK (0x3ff << 16) -+#define MXC_CCM_UPCTL_MFI_OFFSET 10 -+#define MXC_CCM_UPCTL_MFI_MASK (0xf << 10) -+#define MXC_CCM_UPCTL_MFN_OFFSET 0 -+#define MXC_CCM_UPCTL_MFN_MASK 0x3ff -+#define MXC_CCM_UPCTL_LF (1 << 15) -+ -+#define MXC_CCM_CCTL_ARM_OFFSET 30 -+#define MXC_CCM_CCTL_ARM_MASK (0x3 << 30) -+#define MXC_CCM_CCTL_AHB_OFFSET 28 -+#define MXC_CCM_CCTL_AHB_MASK (0x3 << 28) -+#define MXC_CCM_CCTL_MPLL_RST (1 << 27) -+#define MXC_CCM_CCTL_UPLL_RST (1 << 26) -+#define MXC_CCM_CCTL_LP_CTL_OFFSET 24 -+#define MXC_CCM_CCTL_LP_CTL_MASK (0x3 << 24) -+#define MXC_CCM_CCTL_LP_MODE_RUN (0x0 << 24) -+#define MXC_CCM_CCTL_LP_MODE_WAIT (0x1 << 24) -+#define MXC_CCM_CCTL_LP_MODE_DOZE (0x2 << 24) -+#define MXC_CCM_CCTL_LP_MODE_STOP (0x3 << 24) -+#define MXC_CCM_CCTL_UPLL_DISABLE (1 << 23) -+#define MXC_CCM_CCTL_MPLL_BYPASS (1 << 22) -+#define MXC_CCM_CCTL_USB_DIV_OFFSET 16 -+#define MXC_CCM_CCTL_USB_DIV_MASK (0x3 << 16) -+#define MXC_CCM_CCTL_CG_CTRL (1 << 15) -+#define MXC_CCM_CCTL_ARM_SRC (1 << 14) -+ -+#define MXC_CCM_CGCR0_HCLK_ATA_OFFSET 16 -+#define MXC_CCM_CGCR0_HCLK_BROM_OFFSET 17 -+#define MXC_CCM_CGCR0_HCLK_CSI_OFFSET 18 -+#define MXC_CCM_CGCR0_HCLK_EMI_OFFSET 19 -+#define MXC_CCM_CGCR0_HCLK_ESAI_OFFSET 20 -+#define MXC_CCM_CGCR0_HCLK_ESDHC1_OFFSET 21 -+#define MXC_CCM_CGCR0_HCLK_ESDHC2_OFFSET 22 -+#define MXC_CCM_CGCR0_HCLK_FEC_OFFSET 23 -+#define MXC_CCM_CGCR0_HCLK_LCDC_OFFSET 24 -+#define MXC_CCM_CGCR0_HCLK_RTIC_OFFSET 25 -+#define MXC_CCM_CGCR0_HCLK_SDMA_OFFSET 26 -+#define MXC_CCM_CGCR0_HCLK_SLCDC_OFFSET 27 -+#define MXC_CCM_CGCR0_HCLK_USBOTG_OFFSET 28 -+ -+#define MXC_CCM_CGCR0_PER_CSI_OFFSET 0 -+#define MXC_CCM_CGCR0_PER_EPIT_OFFSET 1 -+#define MXC_CCM_CGCR0_PER_ESAI_OFFSET 2 -+#define MXC_CCM_CGCR0_PER_ESDHC1_OFFSET 3 -+#define MXC_CCM_CGCR0_PER_ESDHC2_OFFSET 4 -+#define MXC_CCM_CGCR0_PER_GPT_OFFSET 5 -+#define MXC_CCM_CGCR0_PER_I2C_OFFSET 6 -+#define MXC_CCM_CGCR0_PER_LCDC_OFFSET 7 -+#define MXC_CCM_CGCR0_PER_NFC_OFFSET 8 -+#define MXC_CCM_CGCR0_PER_OWIRE_OFFSET 9 -+#define MXC_CCM_CGCR0_PER_PWM_OFFSET 10 -+#define MXC_CCM_CGCR0_PER_SIM1_OFFSET 11 -+#define MXC_CCM_CGCR0_PER_SIM2_OFFSET 12 -+#define MXC_CCM_CGCR0_PER_SSI1_OFFSET 13 -+#define MXC_CCM_CGCR0_PER_SSI2_OFFSET 14 -+#define MXC_CCM_CGCR0_PER_UART_OFFSET 15 -+ -+#define MXC_CCM_CGCR1_AUDMUX_OFFSET 0 -+#define MXC_CCM_CGCR1_ATA_OFFSET 1 -+#define MXC_CCM_CGCR1_CAN1_OFFSET 2 -+#define MXC_CCM_CGCR1_CAN2_OFFSET 3 -+#define MXC_CCM_CGCR1_CSI_OFFSET 4 -+#define MXC_CCM_CGCR1_CSPI1_OFFSET 5 -+#define MXC_CCM_CGCR1_CSPI2_OFFSET 6 -+#define MXC_CCM_CGCR1_CSPI3_OFFSET 7 -+#define MXC_CCM_CGCR1_DRYICE_OFFSET 8 -+#define MXC_CCM_CGCR1_ECT_OFFSET 9 -+#define MXC_CCM_CGCR1_EPIT1_OFFSET 10 -+#define MXC_CCM_CGCR1_EPIT2_OFFSET 11 -+#define MXC_CCM_CGCR1_ESAI_OFFSET 12 -+#define MXC_CCM_CGCR1_ESDHC1_OFFSET 13 -+#define MXC_CCM_CGCR1_ESDHC2_OFFSET 14 -+#define MXC_CCM_CGCR1_FEC_OFFSET 15 -+#define MXC_CCM_CGCR1_GPIO1_OFFSET 16 -+#define MXC_CCM_CGCR1_GPIO2_OFFSET 17 -+#define MXC_CCM_CGCR1_GPIO3_OFFSET 18 -+#define MXC_CCM_CGCR1_GPT1_OFFSET 19 -+#define MXC_CCM_CGCR1_GPT2_OFFSET 20 -+#define MXC_CCM_CGCR1_GPT3_OFFSET 21 -+#define MXC_CCM_CGCR1_GPT4_OFFSET 22 -+#define MXC_CCM_CGCR1_I2C1_OFFSET 23 -+#define MXC_CCM_CGCR1_I2C2_OFFSET 24 -+#define MXC_CCM_CGCR1_I2C3_OFFSET 25 -+#define MXC_CCM_CGCR1_IIM_OFFSET 26 -+#define MXC_CCM_CGCR1_IOMUXC_OFFSET 27 -+#define MXC_CCM_CGCR1_KPP_OFFSET 28 -+#define MXC_CCM_CGCR1_LCDC_OFFSET 29 -+#define MXC_CCM_CGCR1_OWIRE_OFFSET 30 -+#define MXC_CCM_CGCR1_PWM1_OFFSET 31 -+ -+#define MXC_CCM_CGCR2_PWM2_OFFSET (32-32) -+#define MXC_CCM_CGCR2_PWM3_OFFSET (33-32) -+#define MXC_CCM_CGCR2_PWM4_OFFSET (34-32) -+#define MXC_CCM_CGCR2_RNGB_OFFSET (35-32) -+#define MXC_CCM_CGCR2_RTIC_OFFSET (36-32) -+#define MXC_CCM_CGCR2_SCC_OFFSET (37-32) -+#define MXC_CCM_CGCR2_SDMA_OFFSET (38-32) -+#define MXC_CCM_CGCR2_SIM1_OFFSET (39-32) -+#define MXC_CCM_CGCR2_SIM2_OFFSET (40-32) -+#define MXC_CCM_CGCR2_SLCDC_OFFSET (41-32) -+#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_UART1_OFFSET (46-32) -+#define MXC_CCM_CGCR2_UART2_OFFSET (47-32) -+#define MXC_CCM_CGCR2_UART3_OFFSET (48-32) -+#define MXC_CCM_CGCR2_UART4_OFFSET (49-32) -+#define MXC_CCM_CGCR2_UART5_OFFSET (50-32) -+#define MXC_CCM_CGCR2_WDOG_OFFSET (51-32) -+ -+#define MXC_CCM_PCDR1_PERDIV1_MASK 0x3f -+ -+#define MXC_CCM_RCSR_NF16B (1 << 14) -+ -+#define MXC_CCM_MCR_USB_XTAL_MUX_OFFSET 31 -+#define MXC_CCM_MCR_CLKO_EN_OFFSET 30 -+#define MXC_CCM_MCR_CLKO_DIV_OFFSET 24 -+#define MXC_CCM_MCR_CLKO_DIV_MASK (0x3F << 24) -+#define MXC_CCM_MCR_CLKO_SEL_OFFSET 20 -+#define MXC_CCM_MCR_CLKO_SEL_MASK (0xF << 20) -+#define MXC_CCM_MCR_ESAI_CLK_MUX_OFFSET 19 -+#define MXC_CCM_MCR_SSI2_CLK_MUX_OFFSET 18 -+#define MXC_CCM_MCR_SSI1_CLK_MUX_OFFSET 17 -+#define MXC_CCM_MCR_USB_CLK_MUX_OFFSET 16 -+ -+#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:59:16.000000000 +0200 -@@ -20,3 +20,9 @@ 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; -+#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:59:17.000000000 +0200 -@@ -0,0 +1,402 @@ -+/* -+ * Copyright 2008 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 -+ */ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#include -+#include -+ -+#include "sdma_script_code.h" -+ -+#include "karo.h" -+ -+void mx25_sdma_get_script_info(sdma_script_start_addrs * sdma_script_addr) -+{ -+ sdma_script_addr->mxc_sdma_ap_2_ap_addr = ap_2_ap_ADDR; -+ sdma_script_addr->mxc_sdma_ap_2_bp_addr = -1; -+ sdma_script_addr->mxc_sdma_bp_2_ap_addr = -1; -+ sdma_script_addr->mxc_sdma_loopback_on_dsp_side_addr = -1; -+ sdma_script_addr->mxc_sdma_mcu_interrupt_only_addr = -1; -+ -+ sdma_script_addr->mxc_sdma_firi_2_per_addr = -1; -+ sdma_script_addr->mxc_sdma_firi_2_mcu_addr = -1; -+ sdma_script_addr->mxc_sdma_per_2_firi_addr = -1; -+ sdma_script_addr->mxc_sdma_mcu_2_firi_addr = -1; -+ -+ sdma_script_addr->mxc_sdma_uart_2_per_addr = uart_2_per_ADDR; -+ sdma_script_addr->mxc_sdma_uart_2_mcu_addr = uart_2_mcu_ADDR; -+ sdma_script_addr->mxc_sdma_per_2_app_addr = per_2_app_ADDR; -+ sdma_script_addr->mxc_sdma_mcu_2_app_addr = mcu_2_app_ADDR; -+ -+ sdma_script_addr->mxc_sdma_per_2_per_addr = -1; -+ -+ sdma_script_addr->mxc_sdma_uartsh_2_per_addr = uartsh_2_per_ADDR; -+ sdma_script_addr->mxc_sdma_uartsh_2_mcu_addr = uartsh_2_mcu_ADDR; -+ sdma_script_addr->mxc_sdma_per_2_shp_addr = per_2_shp_ADDR; -+ sdma_script_addr->mxc_sdma_mcu_2_shp_addr = mcu_2_shp_ADDR; -+ -+ sdma_script_addr->mxc_sdma_ata_2_mcu_addr = ata_2_mcu_ADDR; -+ sdma_script_addr->mxc_sdma_mcu_2_ata_addr = mcu_2_ata_ADDR; -+ -+ sdma_script_addr->mxc_sdma_app_2_per_addr = app_2_per_ADDR; -+ sdma_script_addr->mxc_sdma_app_2_mcu_addr = app_2_mcu_ADDR; -+ sdma_script_addr->mxc_sdma_shp_2_per_addr = shp_2_per_ADDR; -+ sdma_script_addr->mxc_sdma_shp_2_mcu_addr = shp_2_mcu_ADDR; -+ -+ sdma_script_addr->mxc_sdma_mshc_2_mcu_addr = -1; -+ sdma_script_addr->mxc_sdma_mcu_2_mshc_addr = -1; -+ -+ sdma_script_addr->mxc_sdma_spdif_2_mcu_addr = -1; -+ sdma_script_addr->mxc_sdma_mcu_2_spdif_addr = -1; -+ -+ sdma_script_addr->mxc_sdma_asrc_2_mcu_addr = -1; -+ -+ sdma_script_addr->mxc_sdma_dptc_dvfs_addr = -1; -+ sdma_script_addr->mxc_sdma_ext_mem_2_ipu_addr = ext_mem__ipu_ram_ADDR; -+ sdma_script_addr->mxc_sdma_descrambler_addr = -1; -+ -+ sdma_script_addr->mxc_sdma_start_addr = (unsigned short *)sdma_code; -+ sdma_script_addr->mxc_sdma_ram_code_size = RAM_CODE_SIZE; -+ sdma_script_addr->mxc_sdma_ram_code_start_addr = RAM_CODE_START_ADDR; -+} -+ -+#if defined(CONFIG_MXC_WATCHDOG) || defined(CONFIG_MXC_WATCHDOG_MODULE) -+static struct resource wdt_resources[] = { -+ { -+ .start = WDOG_BASE_ADDR, -+ .end = WDOG_BASE_ADDR + 0x2f, -+ .flags = IORESOURCE_MEM, -+ }, -+}; -+ -+static struct platform_device mx25_wdt_device = { -+ .name = "mxc_wdt", -+ .id = 0, -+ .num_resources = ARRAY_SIZE(wdt_resources), -+ .resource = wdt_resources, -+}; -+ -+static void mx25_init_wdt(void) -+{ -+ (void)platform_device_register(&mx25_wdt_device); -+} -+#else -+static inline void mx25_init_wdt(void) -+{ -+} -+#endif -+ -+/* -+ * lcdc: -+ * - i.MX1: the basic controller -+ * - i.MX21: to be checked -+ * - i.MX27: like i.MX1, with slightly variations -+ */ -+static struct resource mxc_fb[] = { -+ { -+ .start = LCDC_BASE_ADDR, -+ .end = LCDC_BASE_ADDR + 0xFFF, -+ .flags = IORESOURCE_MEM, -+ }, -+ { -+ .start = MXC_INT_LCDC, -+ .end = MXC_INT_LCDC, -+ .flags = IORESOURCE_IRQ, -+ } -+}; -+ -+/* mxc lcd driver */ -+struct platform_device mxc_fb_device = { -+ .name = "imx-fb", -+ .id = 0, -+ .num_resources = ARRAY_SIZE(mxc_fb), -+ .resource = mxc_fb, -+ .dev = { -+ .coherent_dma_mask = 0xFFFFFFFF, -+ }, -+}; -+ -+/* SPI controller and device data */ -+#if defined(CONFIG_SPI_MXC) || defined(CONFIG_SPI_MXC_MODULE) -+ -+#ifdef CONFIG_SPI_MXC_SELECT1 -+/*! -+ * 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, -+ }, -+}; -+ -+/*! Platform Data for MXC CSPI1 */ -+static struct mxc_spi_master mx25_spi1_data = { -+ .maxchipselect = 4, -+ .spi_version = 7, -+}; -+ -+/*! Device Definition for MXC CSPI1 */ -+static struct platform_device mx25_spi1_device = { -+ .name = "mxc_spi", -+ .id = 0, -+ .dev = { -+ .platform_data = &mx25_spi1_data, -+ }, -+ .num_resources = ARRAY_SIZE(mx25_spi1_resources), -+ .resource = mx25_spi1_resources, -+}; -+ -+#endif /* CONFIG_SPI_MXC_SELECT1 */ -+ -+#ifdef CONFIG_SPI_MXC_SELECT2 -+/*! -+ * 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, -+ }, -+}; -+ -+/*! Platform Data for MXC CSPI2 */ -+static struct mxc_spi_master mx25_spi2_data = { -+ .maxchipselect = 4, -+ .spi_version = 7, -+}; -+ -+/*! Device Definition for MXC CSPI2 */ -+static struct platform_device mx25_spi2_device = { -+ .name = "mxc_spi", -+ .id = 1, -+ .dev = { -+ .platform_data = &mx25_spi2_data, -+ }, -+ .num_resources = ARRAY_SIZE(mx25_spi2_resources), -+ .resource = mx25_spi2_resources, -+}; -+#endif /* CONFIG_SPI_MXC_SELECT2 */ -+ -+#ifdef CONFIG_SPI_MXC_SELECT3 -+/*! -+ * 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, -+ }, -+}; -+ -+/*! Platform Data for MXC CSPI3 */ -+static struct mxc_spi_master mx25_spi3_data = { -+ .maxchipselect = 4, -+ .spi_version = 7, -+}; -+ -+/*! Device Definition for MXC CSPI3 */ -+static struct platform_device mx25_spi3_device = { -+ .name = "mxc_spi", -+ .id = 2, -+ .dev = { -+ .platform_data = &mx25_spi3_data, -+ }, -+ .num_resources = ARRAY_SIZE(mx25_spi3_resources), -+ .resource = mx25_spi3_resources, -+}; -+#endif /* CONFIG_SPI_MXC_SELECT3 */ -+ -+static inline void mx25_init_spi(void) -+{ -+ spba_take_ownership(SPBA_CSPI2, SPBA_MASTER_A); -+ spba_take_ownership(SPBA_CSPI3, SPBA_MASTER_A); -+ -+#ifdef CONFIG_SPI_MXC_SELECT1 -+ if (platform_device_register(&mx25_spi1_device) < 0) -+ printk(KERN_ERR "Error: Registering the SPI Controller_1\n"); -+#endif /* CONFIG_SPI_MXC_SELECT1 */ -+#ifdef CONFIG_SPI_MXC_SELECT2 -+ if (platform_device_register(&mx25_spi2_device) < 0) -+ printk(KERN_ERR "Error: Registering the SPI Controller_2\n"); -+#endif /* CONFIG_SPI_MXC_SELECT2 */ -+#ifdef CONFIG_SPI_MXC_SELECT3 -+ if (platform_device_register(&mx25_spi3_device) < 0) -+ printk(KERN_ERR "Error: Registering the SPI Controller_3\n"); -+#endif /* CONFIG_SPI_MXC_SELECT3 */ -+} -+#else -+static inline void mx25_init_spi(void) -+{ -+} -+#endif -+ -+/* I2C controller and device data */ -+#if defined(CONFIG_I2C_IMX) || defined(CONFIG_I2C_IMX_MODULE) -+ -+/*! -+ * 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, -+ }, -+}; -+ -+/*! -+ * 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, -+ }, -+}; -+ -+/*! -+ * 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, -+ }, -+}; -+ -+/*! Device Definition for MXC I2C1 */ -+struct platform_device mx25_i2c_device0 = { -+ .name = "imx-i2c", -+ .id = 0, -+ .num_resources = ARRAY_SIZE(mx25_i2c1_resources), -+ .resource = mx25_i2c1_resources, -+}; -+ -+struct platform_device mx25_i2c_device1 = { -+ .name = "imx-i2c", -+ .id = 1, -+ .num_resources = ARRAY_SIZE(mx25_i2c2_resources), -+ .resource = mx25_i2c2_resources, -+}; -+ -+struct platform_device mx25_i2c_device2 = { -+ .name = "imx-i2c", -+ .id = 2, -+ .num_resources = ARRAY_SIZE(mx25_i2c3_resources), -+ .resource = mx25_i2c3_resources, -+}; -+#endif -+ -+static struct mxc_gpio_port mx25_gpio_ports[] = { -+ { -+ .chip.label = "gpio-1", -+ .base = IO_ADDRESS(GPIO1_BASE_ADDR), -+ .irq = MXC_INT_GPIO1, -+ .virtual_irq_start = MXC_GPIO_IRQ_START, -+ }, -+ { -+ .chip.label = "gpio-2", -+ .base = IO_ADDRESS(GPIO2_BASE_ADDR), -+ .irq = MXC_INT_GPIO2, -+ .virtual_irq_start = MXC_GPIO_IRQ_START + 1 * 32, -+ }, -+ { -+ .chip.label = "gpio-3", -+ .base = IO_ADDRESS(GPIO3_BASE_ADDR), -+ .irq = MXC_INT_GPIO3, -+ .virtual_irq_start = MXC_GPIO_IRQ_START + 2 * 32, -+ }, -+ { -+ .chip.label = "gpio-4", -+ .base = IO_ADDRESS(GPIO4_BASE_ADDR), -+ .irq = MXC_INT_GPIO4, -+ .virtual_irq_start = MXC_GPIO_IRQ_START + 3 * 32, -+ }, -+}; -+ -+static inline void mx25_init_ssi(void) -+{ -+ /* SPBA configuration for SSI - SDMA and MCU are set */ -+ spba_take_ownership(SPBA_SSI1, SPBA_MASTER_A | SPBA_MASTER_C); -+ spba_take_ownership(SPBA_SSI2, SPBA_MASTER_A | SPBA_MASTER_C); -+} -+ -+static struct platform_device mx25_dma_device = { -+ .name = "mxc_dma", -+ .id = 0, -+}; -+ -+static inline void mx25_init_dma(void) -+{ -+ (void)platform_device_register(&mx25_dma_device); -+} -+ -+static int __init mx25_init_devices(void) -+{ -+ mx25_init_wdt(); -+ mx25_init_spi(); -+ mx25_init_dma(); -+ mx25_init_ssi(); -+ -+ return 0; -+} -+arch_initcall(mx25_init_devices); -+ -+int __init mxc_register_gpios(void) -+{ -+ 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:59:16.000000000 +0200 -@@ -26,6 +26,7 @@ - #include - - /* MX27 memory map definition */ -+#if defined(CONFIG_MACH_MX27) || defined(CONFIG_MACH_MX21) - static struct map_desc mxc_io_desc[] __initdata = { - /* - * this fixed mapping covers: -@@ -61,7 +62,7 @@ static struct map_desc mxc_io_desc[] __i - .pfn = __phys_to_pfn(X_MEMC_BASE_ADDR), - .length = X_MEMC_SIZE, - .type = MT_DEVICE -- } -+ }, - }; - - /* -@@ -82,4 +83,46 @@ void __init mx27_map_io(void) - - iotable_init(mxc_io_desc, ARRAY_SIZE(mxc_io_desc)); - } -+#endif -+ -+#ifdef CONFIG_MACH_MX25 -+static struct map_desc mx25_io_desc[] __initdata = { -+ { -+ .virtual = (unsigned long)X_MEMC_BASE_ADDR_VIRT, -+ .pfn = __phys_to_pfn(X_MEMC_BASE_ADDR), -+ .length = X_MEMC_SIZE, -+ .type = MT_DEVICE -+ }, -+ { -+ .virtual = (unsigned long)ASIC_BASE_ADDR_VIRT, -+ .pfn = __phys_to_pfn(ASIC_BASE_ADDR), -+ .length = ASIC_SIZE, -+ .type = MT_DEVICE_NONSHARED -+ }, -+ { -+ .virtual = (unsigned long)AIPS1_BASE_ADDR_VIRT, -+ .pfn = __phys_to_pfn(AIPS1_BASE_ADDR), -+ .length = AIPS1_SIZE, -+ .type = MT_DEVICE_NONSHARED -+ }, -+ { -+ .virtual = (unsigned long)AIPS2_BASE_ADDR_VIRT, -+ .pfn = __phys_to_pfn(AIPS2_BASE_ADDR), -+ .length = AIPS2_SIZE, -+ .type = MT_DEVICE_NONSHARED -+ }, -+ { -+ .virtual = (unsigned long)SPBA0_BASE_ADDR_VIRT, -+ .pfn = __phys_to_pfn(SPBA0_BASE_ADDR), -+ .length = SPBA0_SIZE, -+ .type = MT_DEVICE_NONSHARED -+ }, -+}; -+ -+void __init mx25_map_io(void) -+{ -+ mxc_set_cpu_type(MXC_CPU_MX25); - -+ 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-08 12:47:51.000000000 +0200 -@@ -0,0 +1,1122 @@ -+/* -+ * arch/arm/mach-mx2/karo-tx25.c -+ * -+ * Copyright (C) 2008 Lothar Wassmann -+ * -+ * based on: arch/arm/mach-mx27ads.c (C) 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 -+ * 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 -+ * -+ * This file adds support for the Ka-Ro electronics TX25 processor modules -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+//#include -+//#include -+#include -+#include -+#include -+#if defined(CONFIG_MTD) || defined(CONFIG_MTD_MODULE) -+#include -+#include -+#include -+#include -+#endif -+ -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+//#include -+//#include -+#include -+#include -+#include -+//#include -+//#include -+//#include -+ -+#include "crm_regs.h" -+#include "devices.h" -+#include "karo.h" -+ -+#ifdef DEBUG -+int tx25_debug = 1; -+module_param(tx25_debug, int, S_IRUGO | S_IWUSR); -+#else -+static int tx25_debug; -+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) -+{ -+ 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); -+ } -+ } -+ 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; -+} -+device_initcall(tx25_usbh2_register); -+#endif // CONFIG_USB_EHCI_MXC -+ -+//#define FEC_MII_IRQ IRQ_GPIOD(8) -+ -+#if defined(CONFIG_FEC) || defined(CONFIG_FEC_MODULE) -+static struct resource fec_resources[] = { -+ { -+ .start = FEC_BASE_ADDR, -+ .end = FEC_BASE_ADDR + 0x18f, -+ .flags = IORESOURCE_MEM, -+ }, { -+ .start = FEC_BASE_ADDR + 0x200, -+ .end = FEC_BASE_ADDR + 0x30b, -+ .flags = IORESOURCE_MEM, -+ }, { -+ .start = MXC_INT_FEC, -+ .end = MXC_INT_FEC, -+ .flags = IORESOURCE_IRQ, -+#ifdef FEC_MII_IRQ -+ }, { -+ .start = FEC_MII_IRQ, -+ .end = FEC_MII_IRQ, -+ .flags = IORESOURCE_IRQ | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, -+#endif -+ }, -+}; -+ -+/* -+ * Setup GPIO for FEC device to be active -+ * -+ */ -+static struct pad_desc karo_tx25_fec_gpios_off[] = { -+ MX25_PAD_FEC_MDC__GPIO_3_5, -+ MX25_PAD_FEC_MDIO__GPIO_3_6, -+ MX25_PAD_FEC_TDATA0__GPIO_3_7, -+ MX25_PAD_FEC_TDATA1__GPIO_3_8, -+ MX25_PAD_FEC_TX_EN__GPIO_3_9, -+ MX25_PAD_FEC_RDATA0__GPIO_3_10, -+ MX25_PAD_FEC_RDATA1__GPIO_3_11, -+ MX25_PAD_FEC_RX_DV__GPIO_3_12, -+ MX25_PAD_FEC_TX_CLK__GPIO_3_13, -+ MX25_PAD_D12__GPIO_4_8, -+ MX25_PAD_D10__GPIO_4_10, -+}; -+ -+static struct pad_desc karo_tx25_fec_pwr_gpios[] = { -+ MX25_PAD_D11__GPIO_4_9, /* FEC PHY power on pin */ -+ MX25_PAD_D13__GPIO_4_7, /* FEC reset */ -+}; -+ -+static struct pad_desc karo_tx25_fec_gpios_on[] = { -+ MX25_PAD_FEC_MDC__FEC_MDC, -+ MX25_PAD_FEC_MDIO__FEC_MDIO, -+ MX25_PAD_FEC_TDATA0__FEC_TDATA0, -+ MX25_PAD_FEC_TDATA1__FEC_TDATA1, -+ MX25_PAD_FEC_TX_EN__FEC_TX_EN, -+ MX25_PAD_FEC_RDATA0__FEC_RDATA0, -+ MX25_PAD_FEC_RDATA1__FEC_RDATA1, -+ MX25_PAD_FEC_RX_DV__FEC_RX_DV, -+ MX25_PAD_FEC_TX_CLK__FEC_TX_CLK, -+ MX25_PAD_D12__GPIO_4_8, -+ MX25_PAD_D10__GPIO_4_10, -+}; -+ -+static struct gpio_desc { -+ unsigned int gpio:7; -+ unsigned int dir:1; -+ unsigned int level:1; -+} karo_tx25_fec_strap_gpios[] = { -+ /* configure the PHY strap pins to the correct values */ -+ { GPIO_PORTC | 5, 1, 0, }, -+ { GPIO_PORTC | 6, 1, 0, }, -+ { GPIO_PORTC | 7, 1, 0, }, -+ { GPIO_PORTC | 8, 1, 0, }, -+ { GPIO_PORTC | 9, 1, 0, }, -+ { GPIO_PORTC | 10, 1, 1, }, -+ { GPIO_PORTC | 11, 1, 1, }, -+ { GPIO_PORTC | 12, 0, 1, }, -+ { GPIO_PORTC | 13, 1, 0, }, -+ -+ { GPIO_PORTD | 8, 0, 0, }, -+ { GPIO_PORTD | 10, 0, 0, }, -+ { GPIO_PORTD | 9, 1, 1, }, -+ { GPIO_PORTD | 7, 1, 0, }, -+}; -+ -+#define TX25_FEC_PWR_GPIO (GPIO_PORTD | 9) -+#define TX25_FEC_RST_GPIO (GPIO_PORTD | 7) -+ -+static int gpio_fec_active(void) -+{ -+ int ret; -+ int i; -+ -+#ifdef FEC_MII_IRQ -+ DBG(0, "%s: Using IRQ %d (GPIO %d) for MII\n", __FUNCTION__, -+ FEC_MII_IRQ, irq_to_gpio(FEC_MII_IRQ)); -+ -+ set_irq_type(FEC_MII_IRQ, IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING); -+#endif -+ ret = mxc_iomux_v3_setup_multiple_pads(karo_tx25_fec_pwr_gpios, -+ ARRAY_SIZE(karo_tx25_fec_pwr_gpios)); -+ if (ret) { -+ return ret; -+ } -+ /* -+ * If the PHY is already powered on, assume it has been -+ * correctly configured (by the boot loader) -+ */ -+ if (0 && gpio_get_value(TX25_FEC_PWR_GPIO) && -+ gpio_get_value(TX25_FEC_RST_GPIO)) { -+ ret = mxc_iomux_v3_setup_multiple_pads(karo_tx25_fec_gpios_on, -+ ARRAY_SIZE(karo_tx25_fec_gpios_on)); -+ if (ret) { -+ mxc_iomux_v3_release_multiple_pads(karo_tx25_fec_pwr_gpios, -+ ARRAY_SIZE(karo_tx25_fec_pwr_gpios)); -+ return ret; -+ } -+ } else { -+ /* switch PHY strap pins into required state */ -+ ret = mxc_iomux_v3_setup_multiple_pads(karo_tx25_fec_gpios_off, -+ ARRAY_SIZE(karo_tx25_fec_gpios_off)); -+ if (ret) { -+ mxc_iomux_v3_release_multiple_pads(karo_tx25_fec_pwr_gpios, -+ ARRAY_SIZE(karo_tx25_fec_pwr_gpios)); -+ 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]; -+ -+ ret = gpio_request(pd->gpio, "FEC"); -+ if (ret < 0) { -+ DBG(0, "%s: Failed to request GPIO%d_%d: %d\n", -+ __FUNCTION__, pd->gpio / 32 + 1, pd->gpio % 32, ret); -+ goto rel_mux; -+ } -+ if (pd->dir) { -+ gpio_direction_output(pd->gpio, -+ pd->level); -+ } else { -+ gpio_direction_input(pd->gpio); -+ } -+ } -+#ifdef DEBUG -+ for (i = 0; i < ARRAY_SIZE(karo_tx25_fec_strap_gpios); i++) { -+ struct gpio_desc *pd = &karo_tx25_fec_strap_gpios[i]; -+ int grp = pd->gpio / 32 + 1; -+ int ofs = pd->gpio % 32; -+ -+ if (pd->dir && pd->level != gpio_get_value(pd->gpio)) { -+ DBG(0, "%s: GPIO%d_%d is %d instead of %d\n", __FUNCTION__, -+ grp, ofs, gpio_get_value(pd->gpio), -+ pd->level); -+ } -+ } -+#endif -+ DBG(0, "%s: Delaying for 22ms\n", __FUNCTION__); -+ mdelay(22); -+ DBG(0, "%s: Deasserting FEC PHY reset\n", __FUNCTION__); -+ gpio_set_value(TX25_FEC_RST_GPIO, 1); -+#ifdef DEBUG -+ for (i = 0; i < ARRAY_SIZE(karo_tx25_fec_strap_gpios); i++) { -+ struct gpio_desc *pd = &karo_tx25_fec_strap_gpios[i]; -+ int grp = pd->gpio / 32 + 1; -+ int ofs = pd->gpio % 32; -+ -+ DBG(0, "%s: GPIO%d_%d is %d\n", __FUNCTION__, -+ grp, ofs, gpio_get_value(pd->gpio)); -+ } -+#endif -+ mxc_iomux_v3_release_multiple_pads(karo_tx25_fec_gpios_off, -+ ARRAY_SIZE(karo_tx25_fec_gpios_off)); -+ ret = mxc_iomux_v3_setup_multiple_pads(karo_tx25_fec_gpios_on, -+ ARRAY_SIZE(karo_tx25_fec_gpios_on)); -+ if (ret) { -+ goto rel_gpio; -+ } -+#ifdef DEBUG -+ for (i = 0; i < ARRAY_SIZE(karo_tx25_fec_strap_gpios); i++) { -+ struct gpio_desc *pd = &karo_tx25_fec_strap_gpios[i]; -+ int grp = pd->gpio / 32 + 1; -+ int ofs = pd->gpio % 32; -+ -+ DBG(0, "%s: GPIO%d_%d is %d\n", __FUNCTION__, -+ grp, ofs, gpio_get_value(pd->gpio)); -+ } -+#endif -+ } -+ return ret; -+ -+ rel_mux: -+ mxc_iomux_v3_release_multiple_pads(karo_tx25_fec_gpios_off, -+ ARRAY_SIZE(karo_tx25_fec_gpios_off)); -+ 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, -+ ARRAY_SIZE(karo_tx25_fec_pwr_gpios)); -+ return ret; -+} -+ -+/* -+ * Setup GPIO for FEC device to be inactive -+ * -+ */ -+static void gpio_fec_inactive(void) -+{ -+ int i; -+ -+ mxc_iomux_v3_release_multiple_pads(karo_tx25_fec_gpios_on, -+ ARRAY_SIZE(karo_tx25_fec_gpios_on)); -+ mxc_iomux_v3_setup_multiple_pads(karo_tx25_fec_gpios_off, -+ ARRAY_SIZE(karo_tx25_fec_gpios_off)); -+ DBG(0, "%s: Asserting FEC PHY reset\n", __FUNCTION__); -+ gpio_set_value(TX25_FEC_RST_GPIO, 0); -+ DBG(0, "%s: Switching FEC PHY power off\n", __FUNCTION__); -+ gpio_set_value(TX25_FEC_PWR_GPIO, 0); -+ -+ mxc_iomux_v3_release_multiple_pads(karo_tx25_fec_gpios_off, -+ ARRAY_SIZE(karo_tx25_fec_gpios_off)); -+ mxc_iomux_v3_release_multiple_pads(karo_tx25_fec_pwr_gpios, -+ 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); -+ } -+} -+ -+static struct clk *tx25_fec_clk; -+ -+static int tx25_fec_suspend(struct platform_device *pdev) -+{ -+ BUG_ON(tx25_fec_clk == NULL); -+ DBG(1, "%s: Switching FEC PHY off\n", __FUNCTION__); -+ gpio_fec_inactive(); -+ clk_disable(tx25_fec_clk); -+ return 0; -+} -+ -+static int tx25_fec_resume(struct platform_device *pdev) -+{ -+ BUG_ON(tx25_fec_clk == NULL); -+ DBG(1, "%s: Switching FEC PHY on\n", __FUNCTION__); -+ clk_enable(tx25_fec_clk); -+ gpio_fec_active(); -+ 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; -+ -+ DBG(0, "%s: Activating FEC GPIOs\n", __FUNCTION__); -+ dump_regs(); -+ -+ ret = gpio_fec_active(); -+ if (ret) { -+ printk(KERN_ERR "%s: could not enable FEC gpios: %d\n", __FUNCTION__, ret); -+ return ret; -+ } -+ -+ BUG_ON(tx25_fec_clk != NULL); -+ tx25_fec_clk = clk_get(&pdev->dev, NULL); -+ if (unlikely(IS_ERR(tx25_fec_clk))) { -+ printk(KERN_ERR "Failed to get fec_clk\n"); -+ return PTR_ERR(tx25_fec_clk); -+ } -+ DBG(0, "%s: Enabling FEC clock\n", __FUNCTION__); -+ clk_enable(tx25_fec_clk); -+ dump_regs(); -+ return 0; -+} -+ -+static void fec_arch_exit(struct platform_device *pdev) -+{ -+ BUG_ON(tx25_fec_clk == NULL); -+ if (unlikely(IS_ERR(tx25_fec_clk))) { -+ printk(KERN_ERR "Failed to get fec_clk\n"); -+ return; -+ } -+ DBG(0, "%s: Disabling FEC clock\n", __FUNCTION__); -+ clk_disable(tx25_fec_clk); -+ clk_put(tx25_fec_clk); -+ tx25_fec_clk = NULL; -+ DBG(0, "%s: Deactivating FEC GPIOs\n", __FUNCTION__); -+ gpio_fec_inactive(); -+} -+ -+static struct fec_enet_platform_data fec_data = { -+ .arch_init = fec_arch_init, -+ .arch_exit = fec_arch_exit, -+ .suspend = tx25_fec_suspend, -+ .resume = tx25_fec_resume, -+}; -+ -+static struct platform_device fec_device = { -+ .name = "fec", -+ .id = 0, -+ .num_resources = ARRAY_SIZE(fec_resources), -+ .resource = fec_resources, -+ .dev = { -+ .platform_data = &fec_data, -+ .coherent_dma_mask = 0xFFFFFFFF, -+ }, -+}; -+#endif -+ -+/* MTD NAND flash */ -+#if defined(CONFIG_MTD_NAND_MXC) || defined(CONFIG_MTD_NAND_MXC_MODULE) -+static struct pad_desc karo_tx25_nand_pads[] = { -+ MX25_PAD_NF_CE0__NF_CE0, -+ MX25_PAD_NFWE_B__NFWE_B, -+ MX25_PAD_NFRE_B__NFRE_B, -+ MX25_PAD_NFALE__NFALE, -+ MX25_PAD_NFCLE__NFCLE, -+ MX25_PAD_NFWP_B__NFWP_B, -+ MX25_PAD_NFRB__NFRB, -+ MX25_PAD_D7__D7, -+ MX25_PAD_D6__D6, -+ MX25_PAD_D5__D5, -+ MX25_PAD_D4__D4, -+ MX25_PAD_D3__D3, -+ MX25_PAD_D2__D2, -+ MX25_PAD_D1__D1, -+ MX25_PAD_D0__D0, -+}; -+ -+#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 int tx25_nand_init(void) -+{ -+ int ret; -+ -+ DBG(0, "%s: Configuring NAND pins\n", __FUNCTION__); -+ ret = mxc_iomux_v3_setup_multiple_pads(karo_tx25_nand_pads, -+ ARRAY_SIZE(karo_tx25_nand_pads)); -+ if (ret) { -+ return ret; -+ } -+ 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, -+}; -+ -+static int tx25_nand_init(void) -+{ -+ int ret; -+ -+ DBG(0, "%s: Configuring NAND pins\n", __FUNCTION__); -+ ret = mxc_iomux_v3_setup_multiple_pads(karo_tx25_nand_pads, -+ ARRAY_SIZE(karo_tx25_nand_pads)); -+ if (ret) { -+ return ret; -+ } -+ return 0; -+} -+arch_initcall(tx25_nand_init); -+#endif -+ -+static struct resource tx25_nand_resources[] = { -+ { -+ .start = NFC_BASE_ADDR + 0x1e00, -+ .end = NFC_BASE_ADDR + 0x1e2f, -+ .flags = IORESOURCE_MEM, -+ }, { -+ .start = NFC_BASE_ADDR, -+ .end = NFC_BASE_ADDR + 0x11ff, -+ .flags = IORESOURCE_MEM, -+ }, { -+ .start = MXC_INT_NANDFC, -+ .end = MXC_INT_NANDFC, -+ .flags = IORESOURCE_IRQ, -+ }, -+}; -+ -+static struct platform_device tx25_nand_mtd_device = { -+ .name = "mxc_nand", -+ .id = 0, -+ .num_resources = ARRAY_SIZE(tx25_nand_resources), -+ .resource = tx25_nand_resources, -+ .dev = { -+ .platform_data = &tx25_nand_data, -+ }, -+}; -+#endif -+ -+#if defined(CONFIG_VIDEO_MXC_EMMA_OUTPUT) || defined(CONFIG_VIDEO_MXC_EMMA_OUTPUT_MODULE) -+static u64 mxc_emma_dmamask = 0xffffffffUL; -+ -+static struct platform_device tx25_v4l2out_device = { -+ .name = "MXC Video Output", -+ .id = 0, -+ .dev = { -+ .dma_mask = &mxc_emma_dmamask, -+ .coherent_dma_mask = ~0UL, -+ }, -+}; -+#endif -+ -+#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, -+}; -+ -+static int karo_tx25_i2c_0_init(struct device *dev) -+{ -+ DBG(-1, "%s: \n", __FUNCTION__); -+ return mxc_iomux_v3_setup_multiple_pads(mxc_i2c0_pins, -+ ARRAY_SIZE(mxc_i2c0_pins)); -+} -+ -+static void karo_tx25_i2c_0_exit(struct device *dev) -+{ -+ DBG(-1, "%s: \n", __FUNCTION__); -+ mxc_iomux_v3_release_multiple_pads(mxc_i2c0_pins, -+ ARRAY_SIZE(mxc_i2c0_pins)); -+} -+ -+static struct imxi2c_platform_data karo_tx25_i2c_0_data = { -+ .bitrate = 100000, -+ .init = karo_tx25_i2c_0_init, -+ .exit = karo_tx25_i2c_0_exit, -+}; -+ -+static struct at24_platform_data karo_tx25_eeprom = { -+ .byte_len = 2048, -+ .page_size = 32, -+ .flags = AT24_FLAG_ADDR16 | AT24_FLAG_TAKE8ADDR, -+}; -+ -+static struct i2c_board_info karo_i2c_0_boardinfo[] __initdata = { -+ { -+ I2C_BOARD_INFO("24c16", 0x50), -+ .platform_data = &karo_tx25_eeprom, -+ .type = "24c16", -+ }, -+}; -+ -+int __init karo_i2c_init(void) -+{ -+ int ret; -+ -+ DBG(0, "%s: Registering I2C bus 0\n", __FUNCTION__); -+ ret = mxc_register_device(&mx25_i2c_device0, &karo_tx25_i2c_0_data); -+ if (ret != 0) { -+ printk(KERN_ERR "Failed to register I2C device: %d\n", ret); -+ return ret; -+ } -+ ret = i2c_register_board_info(0, karo_i2c_0_boardinfo, -+ ARRAY_SIZE(karo_i2c_0_boardinfo)); -+ if (ret != 0) { -+ printk(KERN_ERR "Failed to register I2C board info: %d\n", ret); -+ } -+ return ret; -+} -+device_initcall(karo_i2c_init); -+#endif -+#endif -+ -+struct platform_dev_list { -+ struct platform_device *pdev; -+ int flag; -+} tx25_devices[] __initdata = { -+#if defined(CONFIG_RTC_MXC) || defined(CONFIG_RTC_MXC_MODULE) -+ { .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, }, -+#endif -+#if defined(CONFIG_FEC) || defined(CONFIG_FEC_MODULE) -+ { .pdev = &fec_device, .flag = 1, }, -+#endif -+#if defined(CONFIG_SPI_MXC) || defined(CONFIG_SPI_MXC_MODULE) -+ { .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, }, -+#endif -+#if defined(CONFIG_MXC_VPU) || defined(CONFIG_MXC_VPU_MODULE) -+ { .pdev = &mxc_vpu_device, .flag = 1, }, -+#endif -+}; -+#define TX25_NUM_DEVICES ARRAY_SIZE(tx25_devices) -+ -+static __init void karo_tx25_board_init(void) -+{ -+ int i; -+ -+ DBG(0, "%s: \n", __FUNCTION__); -+ -+ dump_regs(); -+ -+ for (i = 0; i < TX25_NUM_DEVICES; i++) { -+ int ret; -+ -+ if (tx25_devices[i].pdev == NULL) continue; -+ if (!tx25_devices[i].flag) { -+ DBG(0, "%s: Skipping platform device[%d] @ %p dev %p: %s\n", -+ __FUNCTION__, i, tx25_devices[i].pdev, &tx25_devices[i].pdev->dev, -+ tx25_devices[i].pdev->name); -+ continue; -+ } -+ DBG(0, "%s: Registering platform device[%d] @ %p dev %p: %s\n", -+ __FUNCTION__, i, tx25_devices[i].pdev, &tx25_devices[i].pdev->dev, -+ tx25_devices[i].pdev->name); -+ ret = platform_device_register(tx25_devices[i].pdev); -+ if (ret) { -+ printk(KERN_WARNING "%s: Failed to register platform_device[%d]: %s: %d\n", -+ __FUNCTION__, i, tx25_devices[i].pdev->name, ret); -+ } -+ } -+ DBG(0, "%s: Done\n", __FUNCTION__); -+} -+ -+static struct pad_desc karo_tx25_gpios[] __initdata = { -+ MX25_PAD_GPIO_A__GPIO_A, -+ MX25_PAD_GPIO_B__GPIO_B, -+ MX25_PAD_GPIO_C__GPIO_C, -+ MX25_PAD_GPIO_D__GPIO_D, -+ MX25_PAD_GPIO_E__GPIO_E, -+ MX25_PAD_GPIO_F__GPIO_F, -+ MX25_PAD_CSI_D7__GPIO_1_6, -+ MX25_PAD_CSI_D8__GPIO_1_7, -+ MX25_PAD_CSI_MCLK__GPIO_1_8, -+ MX25_PAD_CSI_VSYNC__GPIO_1_9, -+ MX25_PAD_CSI_HSYNC__GPIO_1_10, -+ MX25_PAD_CSI_PIXCLK__GPIO_1_11, -+ MX25_PAD_I2C1_CLK__GPIO_1_12, -+ MX25_PAD_I2C1_DAT__GPIO_1_13, -+ MX25_PAD_CSPI1_MOSI__GPIO_1_14, -+ MX25_PAD_CSPI1_MISO__GPIO_1_15, -+ MX25_PAD_CSPI1_SS0__GPIO_1_16, -+ MX25_PAD_CSPI1_SS1__GPIO_1_17, -+ MX25_PAD_CSPI1_SCLK__GPIO_1_18, -+ MX25_PAD_LD5__GPIO_1_19, -+ MX25_PAD_LD6__GPIO_1_20, -+ MX25_PAD_LD7__GPIO_1_21, -+ MX25_PAD_HSYNC__GPIO_1_22, -+ MX25_PAD_VSYNC__GPIO_1_23, -+ MX25_PAD_LSCLK__GPIO_1_24, -+ MX25_PAD_OE_ACD__GPIO_1_25, -+ MX25_PAD_PWM__GPIO_1_26, -+ MX25_PAD_CSI_D2__GPIO_1_27, -+ MX25_PAD_CSI_D3__GPIO_1_28, -+ MX25_PAD_CSI_D4__GPIO_1_29, -+ MX25_PAD_CSI_D5__GPIO_1_30, -+ MX25_PAD_CSI_D6__GPIO_1_31, -+ -+ MX25_PAD_A14__GPIO_2_0, -+ MX25_PAD_A15__GPIO_2_1, -+ MX25_PAD_A16__GPIO_2_2, -+ MX25_PAD_A17__GPIO_2_3, -+ MX25_PAD_A18__GPIO_2_4, -+ MX25_PAD_A19__GPIO_2_5, -+ MX25_PAD_A20__GPIO_2_6, -+ MX25_PAD_A21__GPIO_2_7, -+ MX25_PAD_A22__GPIO_2_8, -+ MX25_PAD_A23__GPIO_2_9, -+ MX25_PAD_A24__GPIO_2_10, -+ MX25_PAD_A25__GPIO_2_11, -+ MX25_PAD_EB0__GPIO_2_12, -+ MX25_PAD_EB1__GPIO_2_13, -+ MX25_PAD_OE__GPIO_2_14, -+ MX25_PAD_LD0__GPIO_2_15, -+ MX25_PAD_LD1__GPIO_2_16, -+ MX25_PAD_LD2__GPIO_2_17, -+ MX25_PAD_LD3__GPIO_2_18, -+ MX25_PAD_LD4__GPIO_2_19, -+ MX25_PAD_DE_B__GPIO_2_20, -+ MX25_PAD_CLKO__GPIO_2_21, -+ MX25_PAD_CSPI1_RDY__GPIO_2_22, -+ MX25_PAD_SD1_CMD__GPIO_2_23, -+ MX25_PAD_SD1_CLK__GPIO_2_24, -+ MX25_PAD_SD1_DATA0__GPIO_2_25, -+ MX25_PAD_SD1_DATA1__GPIO_2_26, -+ MX25_PAD_SD1_DATA2__GPIO_2_27, -+ MX25_PAD_SD1_DATA3__GPIO_2_28, -+ MX25_PAD_KPP_ROW0__GPIO_2_29, -+ MX25_PAD_KPP_ROW1__GPIO_2_30, -+ MX25_PAD_KPP_ROW2__GPIO_2_31, -+ -+ MX25_PAD_KPP_ROW3__GPIO_3_0, -+ MX25_PAD_KPP_COL0__GPIO_3_1, -+ MX25_PAD_KPP_COL1__GPIO_3_2, -+ MX25_PAD_KPP_COL2__GPIO_3_3, -+ MX25_PAD_KPP_COL3__GPIO_3_4, -+ MX25_PAD_FEC_MDC__GPIO_3_5, -+ MX25_PAD_FEC_MDIO__GPIO_3_6, -+ MX25_PAD_FEC_TDATA0__GPIO_3_7, -+ MX25_PAD_FEC_TDATA1__GPIO_3_8, -+ MX25_PAD_FEC_TX_EN__GPIO_3_9, -+ MX25_PAD_FEC_RDATA0__GPIO_3_10, -+ MX25_PAD_FEC_RDATA1__GPIO_3_11, -+ MX25_PAD_FEC_RX_DV__GPIO_3_12, -+ MX25_PAD_FEC_TX_CLK__GPIO_3_13, -+ MX25_PAD_RTCK__GPIO_3_14, -+ MX25_PAD_EXT_ARMCLK__GPIO_3_15, -+ MX25_PAD_UPLL_BYPCLK__GPIO_3_16, -+ MX25_PAD_VSTBY_REQ__GPIO_3_17, -+ MX25_PAD_VSTBY_ACK__GPIO_3_18, -+ MX25_PAD_POWER_FAIL__GPIO_3_19, -+ MX25_PAD_CS4__GPIO_3_20, -+ MX25_PAD_CS5__GPIO_3_21, -+ MX25_PAD_NF_CE0__GPIO_3_22, -+ MX25_PAD_ECB__GPIO_3_23, -+ MX25_PAD_LBA__GPIO_3_24, -+ MX25_PAD_RW__GPIO_3_25, -+ MX25_PAD_NFWE_B__GPIO_3_26, -+ MX25_PAD_NFRE_B__GPIO_3_27, -+ MX25_PAD_NFALE__GPIO_3_28, -+ MX25_PAD_NFCLE__GPIO_3_29, -+ MX25_PAD_NFWP_B__GPIO_3_30, -+ MX25_PAD_NFRB__GPIO_3_31, -+ -+ MX25_PAD_A10__GPIO_4_0, -+ MX25_PAD_A13__GPIO_4_1, -+ MX25_PAD_CS0__GPIO_4_2, -+ MX25_PAD_CS1__GPIO_4_3, -+ MX25_PAD_BCLK__GPIO_4_4, -+ MX25_PAD_D15__GPIO_4_5, -+ MX25_PAD_D14__GPIO_4_6, -+ MX25_PAD_D13__GPIO_4_7, -+ MX25_PAD_D12__GPIO_4_8, -+ MX25_PAD_D11__GPIO_4_9, -+ MX25_PAD_D10__GPIO_4_10, -+ MX25_PAD_D9__GPIO_4_11, -+ MX25_PAD_D8__GPIO_4_12, -+ MX25_PAD_D7__GPIO_4_13, -+ MX25_PAD_D6__GPIO_4_14, -+ MX25_PAD_D5__GPIO_4_15, -+ MX25_PAD_D4__GPIO_4_16, -+ MX25_PAD_D3__GPIO_4_17, -+ MX25_PAD_D2__GPIO_4_18, -+ MX25_PAD_D1__GPIO_4_19, -+ MX25_PAD_D0__GPIO_4_20, -+ MX25_PAD_CSI_D9__GPIO_4_21, -+ MX25_PAD_UART1_RXD__GPIO_4_22, -+ MX25_PAD_UART1_TXD__GPIO_4_23, -+ MX25_PAD_UART1_RTS__GPIO_4_24, -+ MX25_PAD_UART1_CTS__GPIO_4_25, -+ MX25_PAD_UART2_RXD__GPIO_4_26, -+ MX25_PAD_UART2_TXD__GPIO_4_27, -+ MX25_PAD_UART2_RTS__GPIO_4_28, -+ MX25_PAD_UART2_CTS__GPIO_4_29, -+ MX25_PAD_BOOT_MODE0__GPIO_4_30, -+ MX25_PAD_BOOT_MODE1__GPIO_4_31, -+}; -+ -+static int __init karo_tx25_setup_gpios(void) -+{ -+ 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 -+ DBG(0, "%s: PAD[%d] %s set up as GPIO\n", __FUNCTION__, i, pd->name); -+#else -+ DBG(0, "%s: PAD[%d] set up as GPIO\n", __FUNCTION__, i); -+#endif -+ count++; -+ mxc_iomux_v3_release_pad(pd); -+ } else { -+#ifdef IOMUX_DEBUG -+ DBG(0, "%s: PAD[%d] %s skipped\n", __FUNCTION__, i, pd->name); -+#else -+ DBG(0, "%s: PAD[%d] skipped\n", __FUNCTION__, i); -+#endif -+ } -+ } -+ 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; -+} -+late_initcall(karo_tx25_setup_gpios); -+ -+static void __init karo_tx25_map_io(void) -+{ -+ mx25_map_io(); -+} -+ -+static void __init karo_tx25_fixup(struct machine_desc *desc, struct tag *tags, -+ char **cmdline, struct meminfo *mi) -+{ -+} -+ -+static void __init karo_tx25_timer_init(void) -+{ -+ DBG(0, "%s: \n", __FUNCTION__); -+ mx25_clocks_init(24000000); -+ DBG(0, "%s: Done\n", __FUNCTION__); -+} -+ -+struct sys_timer karo_tx25_timer = { -+ .init = karo_tx25_timer_init, -+}; -+ -+static int __init karo_mod_type_setup(char *line) -+{ -+ get_option(&line, &karo_mod_type); -+ DBG(0, "%s: Module type set to 0x%02x by kernel cmd line\n", __FUNCTION__, karo_mod_type); -+ -+ return 1; -+} -+__setup("module_type=", karo_mod_type_setup); -+ -+static int __init karo_board_type_setup(char *line) -+{ -+ get_option(&line, &karo_board_type); -+ DBG(0, "%s: Board type set to 0x%02x by kernel cmd line\n", __FUNCTION__, karo_board_type); -+ -+ return 1; -+} -+__setup("board_type=", karo_board_type_setup); -+ -+MACHINE_START(TX25, "Ka-Ro electronics TX25 module (Freescale i.MX25)") -+ /* Maintainer: */ -+ .phys_io = AIPS1_BASE_ADDR, -+ .io_pg_offst = ((unsigned long)AIPS1_BASE_ADDR_VIRT >> 18) & 0xfffc, -+ .fixup = karo_tx25_fixup, -+ .map_io = karo_tx25_map_io, -+ .init_irq = mxc_init_irq, -+ .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:59:18.000000000 +0200 -@@ -0,0 +1,99 @@ -+/* -+ * arch/arm/mach-mx2/karo.h -+ * -+ * Copyright (C) 2009 Lothar Wassmann -+ * -+ * 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 -+ * -+ * This file provides platform specific definitions for the -+ * Ka-Ro electronics TX25 processor modules -+ */ -+ -+#include -+#include "crm_regs_mx25.h" -+ -+enum { -+ BOARD_KARO_STK5, -+}; -+ -+extern int karo_board_type; -+extern int karo_mod_type; -+ -+#ifdef DEBUG -+extern int tx25_debug; -+#define dbg_lvl(n) ((n) < tx25_debug) -+#define DBG(lvl, fmt...) do { if (dbg_lvl(lvl)) printk(KERN_DEBUG fmt); } while (0) -+#else -+#define dbg_lvl(n) 0 -+#define DBG(lvl, fmt...) do { } while (0) -+#endif -+ -+static inline int karo_get_board_type(void) -+{ -+ return karo_board_type; -+} -+ -+static inline int karo_get_module_type(void) -+{ -+ return karo_mod_type; -+} -+ -+#define SHOW_REG(reg) DBG(0, "%s[%08lx]=%08x\n", #reg, MXC_PHYS_ADDRESS(reg), __raw_readl(reg)) -+ -+#define SHOW_GPIO_REG(port, reg) \ -+ DBG(0, "GPIO%d_%s[%08lx]=%08x\n", port, #reg, \ -+ GPIO_BASE_ADDR(port) + GPIO_##reg, \ -+ __raw_readl(IO_ADDRESS(GPIO_BASE_ADDR(port) + GPIO_##reg))) -+ -+static inline void dump_regs(void) -+{ -+ int i; -+ -+ SHOW_REG(MXC_CCM_MPCTL); -+ SHOW_REG(MXC_CCM_UPCTL); -+ SHOW_REG(MXC_CCM_CCTL); -+ SHOW_REG(MXC_CCM_RCSR); -+ SHOW_REG(MXC_CCM_CRDR); -+ SHOW_REG(MXC_CCM_PCDR0); -+ SHOW_REG(MXC_CCM_PCDR1); -+ SHOW_REG(MXC_CCM_PCDR2); -+ SHOW_REG(MXC_CCM_PCDR3); -+ SHOW_REG(MXC_CCM_CGCR0); -+ SHOW_REG(MXC_CCM_CGCR1); -+ SHOW_REG(MXC_CCM_CGCR2); -+ SHOW_REG(MXC_CCM_MCR); -+ SHOW_REG(MXC_CCM_PMCR0); -+ SHOW_REG(MXC_CCM_PMCR1); -+ SHOW_REG(MXC_CCM_PMCR2); -+ SHOW_REG(MXC_CCM_LTBR0); -+ SHOW_REG(MXC_CCM_LTBR1); -+ SHOW_REG(MXC_CCM_LTR0); -+ SHOW_REG(MXC_CCM_LTR1); -+ SHOW_REG(MXC_CCM_LTR2); -+ SHOW_REG(MXC_CCM_LTR3); -+ SHOW_REG(MXC_CCM_DCVR0); -+ SHOW_REG(MXC_CCM_DCVR1); -+ SHOW_REG(MXC_CCM_DCVR2); -+ SHOW_REG(MXC_CCM_DCVR3); -+ -+ for (i = 1; i <= 4; i++) { -+ SHOW_GPIO_REG(i, DR); -+ SHOW_GPIO_REG(i, GDIR); -+ SHOW_GPIO_REG(i, PSR); -+ SHOW_GPIO_REG(i, ICR1); -+ SHOW_GPIO_REG(i, ICR2); -+ SHOW_GPIO_REG(i, IMR); -+ 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:59:18.000000000 +0200 -@@ -0,0 +1,159 @@ -+ -+/* -+ * Copyright 2008 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 -+ */ -+ -+/*! -+ * @file sdma_script_code.h -+ * @brief This file contains functions of SDMA scripts code initialization -+ * -+ * The file was generated automatically. Based on sdma scripts library. -+ * -+ * @ingroup SDMA -+ */ -+/************************************************************************ -+ -+ SDMA RELEASE LABEL: "SS15_SENNA" -+ -+************************************************************************/ -+ -+#ifndef SDMA_SCRIPT_CODE_H -+#define SDMA_SCRIPT_CODE_H -+ -+/*! -+ * SDMA ROM scripts start addresses and sizes -+ */ -+#define start_ADDR 0 -+#define start_SIZE 22 -+ -+#define core_ADDR 80 -+#define core_SIZE 233 -+ -+#define common_ADDR 313 -+#define common_SIZE 416 -+ -+#define ap_2_ap_ADDR 729 -+#define ap_2_ap_SIZE 41 -+ -+#define app_2_mcu_ADDR 770 -+#define app_2_mcu_SIZE 64 -+ -+#define mcu_2_app_ADDR 834 -+#define mcu_2_app_SIZE 70 -+ -+#define uart_2_mcu_ADDR 904 -+#define uart_2_mcu_SIZE 75 -+ -+#define shp_2_mcu_ADDR 979 -+#define shp_2_mcu_SIZE 69 -+ -+#define mcu_2_shp_ADDR 1048 -+#define mcu_2_shp_SIZE 72 -+ -+#define uartsh_2_mcu_ADDR 1120 -+#define uartsh_2_mcu_SIZE 69 -+ -+#define app_2_per_ADDR 1189 -+#define app_2_per_SIZE 66 -+ -+#define per_2_app_ADDR 1255 -+#define per_2_app_SIZE 74 -+ -+#define per_2_shp_ADDR 1329 -+#define per_2_shp_SIZE 78 -+ -+#define shp_2_per_ADDR 1407 -+#define shp_2_per_SIZE 72 -+ -+#define mcu_2_ata_ADDR 1479 -+#define mcu_2_ata_SIZE 81 -+ -+#define ata_2_mcu_ADDR 1560 -+#define ata_2_mcu_SIZE 96 -+ -+#define loop_DMAs_routines_ADDR 1656 -+#define loop_DMAs_routines_SIZE 227 -+ -+#define test_ADDR 1883 -+#define test_SIZE 63 -+ -+#define signature_ADDR 1022 -+#define signature_SIZE 1 -+ -+/*! -+ * SDMA RAM scripts start addresses and sizes -+ */ -+#define ext_mem__ipu_ram_ADDR 6144 -+#define ext_mem__ipu_ram_SIZE 123 -+ -+#define uart_2_per_ADDR 6267 -+#define uart_2_per_SIZE 73 -+ -+#define uartsh_2_per_ADDR 6340 -+#define uartsh_2_per_SIZE 67 -+ -+/*! -+ * SDMA RAM image start address and size -+ */ -+#define RAM_CODE_START_ADDR 6144 -+#define RAM_CODE_SIZE 263 -+ -+/*! -+ * Buffer that holds the SDMA RAM image -+ */ -+__attribute__ ((__aligned__(4))) -+#ifndef CONFIG_XIP_KERNEL -+const -+#endif -+static const short sdma_code[] = { -+ 0x0e70, 0x0611, 0x5616, 0xc18a, 0x7d2a, 0x5ade, 0x008e, 0xc19c, -+ 0x7c26, 0x5be0, 0x5ef0, 0x5ce8, 0x0688, 0x08ff, 0x0011, 0x28ff, -+ 0x00bc, 0x53f6, 0x05df, 0x7d0b, 0x6dc5, 0x03df, 0x7d03, 0x6bd5, -+ 0xd84f, 0x982b, 0x6b05, 0xc6d8, 0x7e27, 0x7f29, 0x982b, 0x6d01, -+ 0x03df, 0x7d05, 0x6bd5, 0xc702, 0x7e18, 0x7f1a, 0x982b, 0x6b05, -+ 0xc678, 0x7e07, 0x7f06, 0x52de, 0x53e6, 0xc1a8, 0x7dd7, 0x0200, -+ 0x9803, 0x0007, 0x6004, 0x680c, 0x53f6, 0x028e, 0x00a3, 0xc2ad, -+ 0x048b, 0x0498, 0x0454, 0x068a, 0x982b, 0x0207, 0x680c, 0x6ddf, -+ 0x0107, 0x68ff, 0x60d0, 0x9834, 0x0207, 0x68ff, 0x6d28, 0x0107, -+ 0x6004, 0x680c, 0x9834, 0x0007, 0x68ff, 0x60d0, 0x9834, 0x0288, -+ 0x03a5, 0x3b03, 0x3d03, 0x4d00, 0x7d0a, 0x0804, 0x00a5, 0x00da, -+ 0x7d1a, 0x02a0, 0x7b01, 0x65d8, 0x7eee, 0x65ff, 0x7eec, 0x0804, -+ 0x02d0, 0x7d11, 0x4b00, 0x7c0f, 0x008a, 0x3003, 0x6dcf, 0x6bdf, -+ 0x0015, 0x0015, 0x7b02, 0x65d8, 0x0000, 0x7edd, 0x63ff, 0x7edb, -+ 0x3a03, 0x6dcd, 0x6bdd, 0x008a, 0x7b02, 0x65d8, 0x0000, 0x7ed3, -+ 0x65ff, 0x7ed1, 0x0006, 0xc23a, 0x57db, 0x52f3, 0x6ad5, 0x56fb, -+ 0x028e, 0x1a94, 0x6ac3, 0x62c8, 0x0269, 0x7d1e, 0x1e94, 0x6ee3, -+ 0x62d0, 0x5aeb, 0x62c8, 0x0248, 0x6ed3, 0x6ac8, 0x2694, 0x52eb, -+ 0x6ad5, 0x6ee3, 0x62c8, 0x026e, 0x7d27, 0x6ac8, 0x7f23, 0x2501, -+ 0x4d00, 0x7d26, 0x028e, 0x1a98, 0x6ac3, 0x62c8, 0x6ec3, 0x0260, -+ 0x7df1, 0x62d0, 0xc2d1, 0x98c0, 0x6ee3, 0x008f, 0x2001, 0x00d5, -+ 0x7d01, 0x008d, 0x05a0, 0x62c8, 0x026e, 0x7d0e, 0x6ac8, 0x7f0a, -+ 0x2001, 0x7cf9, 0x6add, 0x7f06, 0x0000, 0x4d00, 0x7d09, 0xc251, -+ 0x57db, 0x987f, 0x0007, 0x6aff, 0x62d0, 0xc2d1, 0x0458, 0x0454, -+ 0x6add, 0x7ff8, 0xc261, 0x987c, 0xc230, 0xc23a, 0x57db, 0x52f3, -+ 0x6ad5, 0x56fb, 0x028e, 0x1a94, 0x5202, 0x0269, 0x7d17, 0x1e94, -+ 0x5206, 0x0248, 0x5a06, 0x2694, 0x5206, 0x026e, 0x7d26, 0x6ac8, -+ 0x7f22, 0x2501, 0x4d00, 0x7d27, 0x028e, 0x1a98, 0x5202, 0x0260, -+ 0x7df3, 0x6add, 0x7f18, 0x62d0, 0xc2d1, 0x9903, 0x008f, 0x2001, -+ 0x00d5, 0x7d01, 0x008d, 0x05a0, 0x5206, 0x026e, 0x7d0e, 0x6ac8, -+ 0x7f0a, 0x2001, 0x7cf9, 0x6add, 0x7f06, 0x0000, 0x4d00, 0x7d0b, -+ 0xc251, 0x57db, 0x98c9, 0x0007, 0x6aff, 0x6add, 0x7ffc, 0x62d0, -+ 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:59:18.000000000 +0200 -@@ -0,0 +1,1003 @@ -+/* -+ * arch/arm/mach-mx2/stk5-baseboard.c -+ * -+ * Copyright (C) 2009 Lothar Wassmann -+ * -+ * -+ * 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 -+ * -+ * This file adds support for devices found on Ka-Ro electronics -+ * Starterkit-5 (STK5) baseboard -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+//#include -+ -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+//#include -+#include -+#include -+#include -+//#include -+//#include -+#include -+ -+#include "crm_regs.h" -+#include "devices.h" -+#include "karo.h" -+ -+#if defined(CONFIG_SERIAL_IMX) || defined(CONFIG_SERIAL_IMX_MODULE) -+static struct pad_desc stk5_uart_pads[][4] = { -+ { -+ MX25_PAD_UART1_TXD__UART1_TXD, -+ MX25_PAD_UART1_RXD__UART1_RXD, -+ MX25_PAD_UART1_CTS__UART1_CTS, -+ MX25_PAD_UART1_RTS__UART1_RTS, -+ }, { -+ MX25_PAD_UART2_TXD__UART2_TXD, -+ MX25_PAD_UART2_RXD__UART2_RXD, -+ MX25_PAD_UART2_CTS__UART2_CTS, -+ MX25_PAD_UART2_RTS__UART2_RTS, -+ }, { -+ MX25_PAD_ECB__UART5_TXD_MUX, -+ MX25_PAD_LBA__UART5_RXD_MUX, -+ MX25_PAD_CS4__UART5_CTS, -+ MX25_PAD_CS5__UART5_RTS, -+#if 0 -+ }, { -+ MX25_PAD_UART4_TXD__UART4_TXD, -+ MX25_PAD_UART4_RXD__UART4_RXD, -+ MX25_PAD_UART4_CTS__UART4_CTS, -+ MX25_PAD_UART4_RTS__UART4_RTS, -+ }, { -+ MX25_PAD_UART5_TXD__UART5_TXD, -+ MX25_PAD_UART5_RXD__UART5_RXD, -+ MX25_PAD_UART5_CTS__UART5_CTS, -+ MX25_PAD_UART5_RTS__UART5_RTS, -+#endif -+ }, -+}; -+ -+static int stk5_uart_init(struct platform_device *pdev) -+{ -+ DBG(0, "%s: \n", __FUNCTION__); -+ return mxc_iomux_v3_setup_multiple_pads(stk5_uart_pads[pdev->id], -+ ARRAY_SIZE(stk5_uart_pads[pdev->id])); -+} -+ -+static void stk5_uart_exit(struct platform_device *pdev) -+{ -+ DBG(0, "%s: \n", __FUNCTION__); -+ mxc_iomux_v3_release_multiple_pads(stk5_uart_pads[pdev->id], -+ ARRAY_SIZE(stk5_uart_pads[pdev->id])); -+} -+ -+static struct imxuart_platform_data stk5_uart_ports[] = { -+ { -+ .init = stk5_uart_init, -+ .exit = stk5_uart_exit, -+ .flags = IMXUART_HAVE_RTSCTS, -+ }, { -+ .init = stk5_uart_init, -+ .exit = stk5_uart_exit, -+ .flags = IMXUART_HAVE_RTSCTS, -+ }, { -+ .init = stk5_uart_init, -+ .exit = stk5_uart_exit, -+ .flags = IMXUART_HAVE_RTSCTS, -+ }, { -+ .init = stk5_uart_init, -+ .exit = stk5_uart_exit, -+ .flags = IMXUART_HAVE_RTSCTS, -+ }, { -+ .init = stk5_uart_init, -+ .exit = stk5_uart_exit, -+ .flags = IMXUART_HAVE_RTSCTS, -+ }, { -+ .init = stk5_uart_init, -+ .exit = stk5_uart_exit, -+ .flags = IMXUART_HAVE_RTSCTS, -+ }, -+}; -+ -+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 void __init karo_stk5_serial_init(void) -+{ -+} -+#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) -+{ -+ if ((unsigned long)view & 0x400) { -+ return "USBH2"; -+ } else { -+ return "USBOTG"; -+ } -+} -+ -+static int usb3317_init(void __iomem *view) -+{ -+ int vid, pid, ret; -+ -+ 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) { -+ 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; -+ } -+ return 0; -+} -+ -+static int usb3317_set_vbus_power(void __iomem *view, int on) -+{ -+ 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); -+ } -+ } -+ 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 stk5_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 stk5_usbh2_exit(struct platform_device *pdev) -+{ -+ gpio_usbh2_inactive(); -+ return 0; -+} -+ -+static struct mxc_usbh_platform_data stk5_usbh2_data = { -+ .init = stk5_usbh2_init, -+ .exit = stk5_usbh2_exit, -+}; -+ -+static int __init karo_stk5_usbh2_register(void) -+{ -+ int ret; -+ -+ ret = mxc_register_device(&mxc_ehci2, &stk5_usbh2_data); -+ return ret; -+} -+#else -+static inline int karo_stk5_usbh2_register(void) -+{ -+ return 0; -+} -+#endif // CONFIG_USB_EHCI_MXC -+ -+#if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE) -+static struct gpio_led stk5_leds[] = { -+ { -+ .name = "GPIO-LED", -+ .default_trigger = "heartbeat", -+ .gpio = GPIO_PORTB | 7, -+ }, -+}; -+ -+static struct gpio_led_platform_data stk5_led_data = { -+ .leds = stk5_leds, -+ .num_leds = ARRAY_SIZE(stk5_leds), -+}; -+ -+static struct platform_device stk5_led_device = { -+ .name = "leds-gpio", -+ .id = -1, -+ .dev = { -+ .platform_data = &stk5_led_data, -+ }, -+}; -+#endif -+ -+#if defined(CONFIG_KEYBOARD_MXC) || defined(CONFIG_KEYBOARD_MXC_MODULE) -+/*! -+ * This array is used for mapping mx25 ADS keypad scancodes to input keyboard -+ * keycodes. -+ */ -+static u16 stk5_kpd_keycodes[] = { -+ KEY_POWER, -+}; -+ -+static struct keypad_data stk5_keypad = { -+ .rowmax = 1, -+ .colmax = 1, -+ .irq = MXC_INT_KPP, -+ .learning = 0, -+ //.delay = 2, /* unused in the driver! */ -+ .matrix = stk5_kpd_keycodes, -+}; -+ -+static struct resource stk5_kpp_resources[] = { -+ { -+ .start = MXC_INT_KPP, -+ .end = MXC_INT_KPP, -+ .flags = IORESOURCE_IRQ, -+ }, -+}; -+ -+/* stk5 keypad driver */ -+static struct platform_device stk5_keypad_device = { -+ .name = "mxc_keypad", -+ .id = 0, -+ .num_resources = ARRAY_SIZE(stk5_kpp_resources), -+ .resource = stk5_kpp_resources, -+ .dev = { -+ .platform_data = &stk5_keypad, -+ }, -+}; -+#endif -+ -+#if defined(CONFIG_FB_IMX) || defined(CONFIG_FB_IMX_MODULE) -+/* -+ * Setup GPIO for LCDC device to be active -+ * -+ */ -+static struct pad_desc mx25_lcdc_gpios[] = { -+#if 0 -+ MXC_PIN(A, 30, GPIO, GPIO_OUT | GPIO_DFLT_LOW), /* PA30 */ -+ MXC_PIN(A, 25, GPIO, GPIO_OUT | GPIO_DFLT_LOW), /* PA25 */ -+ MXC_PIN(A, 26, GPIO, GPIO_OUT | GPIO_DFLT_LOW), /* PA26 */ -+ MXC_PIN(A, 24, GPIO, GPIO_OUT | GPIO_DFLT_LOW), /* PA24 */ -+ MXC_PIN(A, 27, GPIO, GPIO_OUT | GPIO_DFLT_LOW), /* PA27 */ -+#endif -+ MX25_PAD_LSCLK__LSCLK, -+ MX25_PAD_LD0__LD0, -+ MX25_PAD_LD1__LD1, -+ MX25_PAD_LD2__LD2, -+ MX25_PAD_LD3__LD3, -+ MX25_PAD_LD4__LD4, -+ MX25_PAD_LD5__LD5, -+ MX25_PAD_LD6__LD6, -+ MX25_PAD_LD7__LD7, -+ MX25_PAD_LD8__LD8, -+ MX25_PAD_LD9__LD9, -+ MX25_PAD_LD10__LD10, -+ MX25_PAD_LD11__LD11, -+ MX25_PAD_LD12__LD12, -+ MX25_PAD_LD13__LD13, -+ MX25_PAD_LD14__LD14, -+ MX25_PAD_LD15__LD15, -+ MX25_PAD_D15__LD16, -+ MX25_PAD_D14__LD17, -+ MX25_PAD_HSYNC__HSYNC, -+ MX25_PAD_VSYNC__VSYNC, -+ MX25_PAD_OE_ACD__OE_ACD, -+}; -+ -+static int stk5_gpio_lcdc_active(struct platform_device *dev) -+{ -+ int ret; -+ -+ DBG(0, "%s: Setting up GPIO pins for LCD\n", __FUNCTION__); -+ ret = mxc_iomux_v3_setup_multiple_pads(mx25_lcdc_gpios, -+ ARRAY_SIZE(mx25_lcdc_gpios)); -+ if (ret) { -+ DBG(0, "%s: Failed to setup GPIO pins for LCD: %d\n", -+ __FUNCTION__, ret); -+ return ret; -+ } -+ return 0; -+} -+ -+/* -+ * Setup GPIO for LCDC device to be inactive -+ * -+ */ -+static void stk5_gpio_lcdc_inactive(struct platform_device *dev) -+{ -+ mxc_iomux_v3_release_multiple_pads(mx25_lcdc_gpios, -+ ARRAY_SIZE(mx25_lcdc_gpios)); -+} -+ -+static struct imx_fb_platform_data stk5_fb_data[] __initdata = { -+ { -+ //.fb_mode = "Xenarc_700_Y-18", -+ .init = stk5_gpio_lcdc_active, -+ .exit = stk5_gpio_lcdc_inactive, -+ .lcd_power = NULL, -+ .backlight_power = NULL, -+ -+ .pixclock = 34576, -+ .xres = 640, -+ .yres = 480, -+ -+ .bpp = 32, -+ -+ .hsync_len = 64, -+ .right_margin = 60 + 1, -+ .left_margin = 80 + 3, -+ -+ .vsync_len = 2, -+ .upper_margin = 54, -+ .lower_margin = 54, -+#if 0 -+ /* currently not used by driver! */ -+ .sync = ((0*FB_SYNC_HOR_HIGH_ACT) | -+ (0*FB_SYNC_VERT_HIGH_ACT) | -+ (1*FB_SYNC_OE_ACT_HIGH)), -+#else -+ .pcr = PCR_TFT | PCR_COLOR | PCR_PBSIZ_8 | -+ PCR_BPIX_18 | PCR_END_SEL | PCR_FLMPOL | PCR_LPPOL | PCR_SCLK_SEL, -+ .dmacr = 0x800a0078, -+#endif -+ .cmap_greyscale = 0, -+ .cmap_inverse = 0, -+ .cmap_static = 0, -+ -+ .fixed_screen_cpu = NULL, -+ }, { -+ //.fb_mode = "Xenarc_700_Y-16", -+ .init = stk5_gpio_lcdc_active, -+ .exit = stk5_gpio_lcdc_inactive, -+ .lcd_power = NULL, -+ .backlight_power = NULL, -+ -+ .pixclock = 34576, -+ .xres = 640, -+ .yres = 480, -+ -+ .bpp = 16, -+ -+ .hsync_len = 64, -+ .right_margin = 138 + 1, -+ .left_margin = 118 + 3, -+ -+ .vsync_len = 7, -+ .upper_margin = 44, -+ .lower_margin = 44, -+#if 0 -+ /* currently not used by driver! */ -+ .sync = ((0*FB_SYNC_HOR_HIGH_ACT) | -+ (0*FB_SYNC_VERT_HIGH_ACT) | -+ (1*FB_SYNC_OE_ACT_HIGH)), -+#else -+ .pcr = PCR_TFT | PCR_COLOR | PCR_PBSIZ_8 | -+ PCR_BPIX_16 | PCR_FLMPOL | PCR_LPPOL | PCR_SCLK_SEL, -+ .dmacr = 0x80040060, -+#endif -+ .cmap_greyscale = 0, -+ .cmap_inverse = 0, -+ .cmap_static = 0, -+ -+ .fixed_screen_cpu = NULL, -+ }, { -+ //.fb_mode = "SHARP LQ10D42-16", -+ .init = stk5_gpio_lcdc_active, -+ .exit = stk5_gpio_lcdc_inactive, -+ .lcd_power = NULL, -+ .backlight_power = NULL, -+ -+ .pixclock = 34576, -+ .xres = 640, -+ .yres = 480, -+ -+#ifdef USE_18BPP -+ .bpp = 32, -+#else -+ .bpp = 16, -+#endif -+ .hsync_len = 64, -+ .right_margin = 138 + 1, -+ .left_margin = 118 + 3, -+ -+ .vsync_len = 7, -+ .upper_margin = 28, -+ .lower_margin = 60, -+#if 0 -+ /* currently not used by driver! */ -+ .sync = ((0*FB_SYNC_HOR_HIGH_ACT) | -+ (0*FB_SYNC_VERT_HIGH_ACT) | -+ (1*FB_SYNC_OE_ACT_HIGH)), -+#else -+ .pcr = PCR_TFT | PCR_COLOR | PCR_PBSIZ_8 | -+#ifdef USE_18BPP -+ PCR_BPIX_18 | PCR_END_SEL | PCR_FLMPOL | PCR_LPPOL | PCR_SCLK_SEL, -+#else -+ PCR_BPIX_16 | PCR_FLMPOL | PCR_LPPOL | PCR_SCLK_SEL, -+#endif -+ .dmacr = 0x80040060, -+#endif -+ .cmap_greyscale = 0, -+ .cmap_inverse = 0, -+ .cmap_static = 0, -+ -+ .fixed_screen_cpu = NULL, -+ }, { -+ //.fb_mode = "SHARP LQ104V1DG61-16", -+ .init = stk5_gpio_lcdc_active, -+ .exit = stk5_gpio_lcdc_inactive, -+ .lcd_power = NULL, -+ .backlight_power = NULL, -+ -+ .pixclock = 40000, -+ .xres = 640, -+ .yres = 480, -+ -+#ifdef USE_18BPP -+ .bpp = 32, -+#else -+ .bpp = 16, -+#endif -+ .hsync_len = 32, -+ .right_margin = 32 + 1, -+ .left_margin = 0 + 3, -+ -+ .vsync_len = 35, -+ .upper_margin = 0, -+ .lower_margin = 0, -+#if 0 -+ /* currently not used by driver! */ -+ .sync = ((0*FB_SYNC_HOR_HIGH_ACT) | -+ (0*FB_SYNC_VERT_HIGH_ACT) | -+ (1*FB_SYNC_OE_ACT_HIGH)), -+#else -+ .pcr = PCR_TFT | PCR_COLOR | PCR_PBSIZ_8 | -+#ifdef USE_18BPP -+ PCR_BPIX_18 | PCR_END_SEL | PCR_FLMPOL | PCR_LPPOL | PCR_SCLK_SEL, -+#else -+ PCR_BPIX_16 | PCR_FLMPOL | PCR_LPPOL | PCR_CLKPOL | PCR_SCLK_SEL, -+#endif -+ .dmacr = 0x80040060, -+#endif -+ .cmap_greyscale = 0, -+ .cmap_inverse = 0, -+ .cmap_static = 0, -+ -+ .fixed_screen_cpu = NULL, -+ }, -+}; -+ -+static int __init karo_stk5_fb_register(void) -+{ -+ int ret; -+ -+ ret = mxc_register_device(&mxc_fb_device, &stk5_fb_data[0]); -+ if (ret != 0) { -+ DBG(0, "%s: Failed to register FB device: %d\n", __FUNCTION__, ret); -+ } -+ return ret; -+} -+#else -+static inline int karo_stk5_fb_register(void) -+{ -+ return 0; -+} -+#endif -+ -+#if defined(CONFIG_MMC_MXC) || defined(CONFIG_MMC_MXC_MODULE) -+/*! -+ * Resource definition for the SDHC1 -+ */ -+static struct resource stk5_sdhc1_resources[] = { -+ { -+ .start = MMC_SDHC1_BASE_ADDR, -+ .end = MMC_SDHC1_BASE_ADDR + SZ_4K - 1, -+ .flags = IORESOURCE_MEM, -+ }, { -+ .start = MXC_INT_SDHC1, -+ .end = MXC_INT_SDHC1, -+ .flags = IORESOURCE_IRQ, -+ }, { -+ .start = gpio_to_irq(4 * 32 + 4), -+ .end = gpio_to_irq(4 * 32 + 4), -+ .flags = IORESOURCE_IRQ, -+#if 0 -+ }, { -+ .name = "sdhc1", -+ .start = DMA_REQ_SDHC1, -+ .end = DMA_REQ_SDHC1, -+ .flags = IORESOURCE_DMA -+#endif -+ }, -+}; -+ -+static inline int stk5_mmc_get_irq(int id) -+{ -+ int irq; -+ -+ switch (id) { -+ case 0: -+ irq = stk5_sdhc1_resources[2].start; -+ break; -+ default: -+ BUG(); -+ } -+ return irq; -+} -+ -+static const char *stk5_mmc_irqdesc[] = { -+ "MMC card 0 detect", -+}; -+ -+static struct pad_desc stk5_sdhc_pads[] = { -+}; -+ -+static int stk5_mmc_init(struct device *dev, irqreturn_t (*mmc_detect_irq)(int, void *), -+ void *data) -+{ -+ int err; -+ int id = to_platform_device(dev)->id; -+ struct mmc_host *host = data; -+ int irq = stk5_mmc_get_irq(id); -+ -+ err = mxc_iomux_v3_setup_multiple_pads(stk5_sdhc_pads, -+ ARRAY_SIZE(stk5_sdhc_pads)); -+ if (err) { -+ return err; -+ } -+ -+ host->caps |= MMC_CAP_4_BIT_DATA; -+ -+ err = request_irq(irq, mmc_detect_irq, -+ IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING, -+ stk5_mmc_irqdesc[id], data); -+ if (err) { -+ printk(KERN_ERR "%s: MMC/SD: can't request MMC card detect IRQ %d\n", -+ __FUNCTION__, irq); -+ return err; -+ } -+ device_set_wakeup_capable(dev, 1); -+ -+ return 0; -+} -+ -+static void stk5_mmc_exit(struct device *dev, void *data) -+{ -+ int id = to_platform_device(dev)->id; -+ int irq = stk5_mmc_get_irq(id); -+ -+ free_irq(irq, data); -+ mxc_iomux_v3_release_multiple_pads(stk5_sdhc_pads, -+ ARRAY_SIZE(stk5_sdhc_pads)); -+} -+ -+#if 0 -+static int stk5_mmc_suspend(struct device *dev, pm_message_t state) -+{ -+ int id = to_platform_device(dev)->id; -+ int irq = stk5_mmc_get_irq(id); -+ -+ if (device_may_wakeup(dev)) { -+ DBG(0, "%s: Enabling IRQ %d wakeup\n", __FUNCTION__, irq); -+ return enable_irq_wake(irq); -+ } -+ return 0; -+} -+ -+static int stk5_mmc_resume(struct device *dev) -+{ -+ int id = to_platform_device(dev)->id; -+ int irq = stk5_mmc_get_irq(id); -+ -+ if (device_may_wakeup(dev)) { -+ DBG(0, "%s: Disabling IRQ %d wakeup\n", __FUNCTION__, irq); -+ return disable_irq_wake(irq); -+ } -+ return 0; -+} -+#endif -+ -+static struct imxmmc_platform_data stk5_sdhc1_data = { -+ //.ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, -+ //.min_clk = 150000, -+ //.max_clk = 25000000, -+ //.detect_delay = 20, -+ .init = stk5_mmc_init, -+ .exit = stk5_mmc_exit, -+// .suspend = stk5_mmc_suspend, -+// .resume = stk5_mmc_resume, -+}; -+ -+static struct platform_device stk5_sdhc1_device = { -+ .name = "imx-mmc", -+ .id = 0, -+ .dev = { -+ .platform_data = &stk5_sdhc1_data, -+ }, -+ .num_resources = ARRAY_SIZE(stk5_sdhc1_resources), -+ .resource = stk5_sdhc1_resources, -+}; -+#endif -+ -+#if defined(CONFIG_SPI_MXC) || defined(CONFIG_SPI_MXC_MODULE) -+static struct resource mxcspi1_resources[] = { -+ { -+ .start = CSPI1_BASE_ADDR, -+ .end = CSPI1_BASE_ADDR + SZ_4K - 1, -+ .flags = IORESOURCE_MEM, -+ }, { -+ .start = MXC_INT_CSPI1, -+ .end = MXC_INT_CSPI1, -+ .flags = IORESOURCE_IRQ, -+ }, -+}; -+ -+static struct mxc_spi_master mxcspi1_data = { -+ .maxchipselect = 2, -+ .spi_version = 0, -+}; -+ -+static struct platform_device mxcspi1_device = { -+ .name = "mxc_spi", -+ .id = 0, -+ .dev = { -+ .platform_data = &mxcspi1_data, -+ }, -+ .num_resources = ARRAY_SIZE(mxcspi1_resources), -+ .resource = mxcspi1_resources, -+}; -+#endif // defined(CONFIG_SPI_MXC) || defined(CONFIG_SPI_MXC_MODULE) -+ -+#if defined(CONFIG_AC97_BUS) || defined(CONFIG_AC97_BUS_MODULE) -+static u64 stk5_dma_mask = ~0UL; -+ -+static struct pad_desc stk5_ac97_pads_on[] = { -+ MX25_PAD_VSTBY_ACK__GPIO_3_18, /* UCB1400 Reset */ -+ MX25_PAD_RW__AUD4_TXFS, -+ MX25_PAD_EB0__AUD4_TXD, -+ MX25_PAD_EB1__AUD4_RXD, -+ MX25_PAD_OE__AUD4_TXC, -+}; -+ -+static struct pad_desc stk5_ac97_pads_off[] = { -+ MX25_PAD_VSTBY_ACK__GPIO_3_18, /* UCB1400 Reset */ -+ MX25_PAD_RW__GPIO_3_25, -+ MX25_PAD_EB0__GPIO_2_12, -+ MX25_PAD_EB1__AUD4_RXD, -+ MX25_PAD_OE__AUD4_TXC, -+}; -+ -+static struct gpio_desc { -+ unsigned int gpio:7; -+ unsigned int dir:1; -+ unsigned int level:1; -+} stk5_ac97_gpios[] = { -+ /* configure the PHY strap pins to the correct values */ -+ { GPIO_PORTC | 18, 1, 0, }, -+ { GPIO_PORTC | 25, 1, 0, }, -+ { GPIO_PORTB | 12, 1, 0, }, -+}; -+ -+static int stk5_ac97_init(struct platform_device *dev) -+{ -+ int ret; -+ int i; -+ -+ DBG(0, "%s: \n", __FUNCTION__); -+ -+ ret = mxc_iomux_v3_setup_multiple_pads(stk5_ac97_pads_off, -+ ARRAY_SIZE(stk5_ac97_pads_off)); -+ if (ret == 0) { -+ for (i = 0; i < ARRAY_SIZE(stk5_ac97_gpios); i++) { -+ struct gpio_desc *pd = &stk5_ac97_gpios[i]; -+ -+ ret = gpio_request(pd->gpio, "AC97"); -+ if (ret < 0) { -+ DBG(0, "%s: Failed to request GPIO%d_%d: %d\n", -+ __FUNCTION__, pd->gpio / 32 + 1, pd->gpio % 32, ret); -+ goto rel_mux; -+ } -+ if (pd->dir) { -+ gpio_direction_output(pd->gpio, -+ pd->level); -+ } else { -+ gpio_direction_input(pd->gpio); -+ } -+ } -+ -+ ret = mxc_iomux_v3_setup_multiple_pads(stk5_ac97_pads_on, -+ ARRAY_SIZE(stk5_ac97_pads_on)); -+ if (ret != 0) { -+ goto rel_gpio; -+ } -+ udelay(1); -+ gpio_set_value(stk5_ac97_gpios[0].gpio, !stk5_ac97_gpios[0].level); -+ } -+ return ret; -+ -+ rel_mux: -+ mxc_iomux_v3_release_multiple_pads(stk5_ac97_gpios_off, -+ ARRAY_SIZE(stk5_ac97_gpios_off)); -+ rel_gpio: -+ while (--i >= 0) { -+ struct gpio_desc *pd = &stk5_ac97_gpios[i]; -+ int grp = pd->gpio / 32 + 1; -+ int ofs = pd->gpio % 32; -+ -+ DBG(0, "%s: Freeing GPIO%d_%d\n", __FUNCTION__, -+ grp, ofs); -+ gpio_free(pd->gpio); -+ } -+ return ret; -+} -+ -+static void stk5_ac97_exit(struct platform_device *dev) -+{ -+ int i; -+ -+ DBG(0, "%s: Releasing AC97 GPIO pins\n", __FUNCTION__); -+ -+ mxc_iomux_v3_release_multiple_pads(stk5_ac97_pads_on, -+ ARRAY_SIZE(stk5_ac97_pads_on)); -+ for (i = 0; i < ARRAY_SIZE(stk5_ac97_gpios); i++) { -+ struct gpio_desc *pd = &stk5_ac97_gpios[i]; -+ int grp = pd->gpio / 32 + 1; -+ int ofs = pd->gpio % 32; -+ -+ DBG(0, "%s: Freeing GPIO%d_%d\n", __FUNCTION__, -+ grp, ofs); -+ gpio_free(pd->gpio); -+ } -+} -+ -+static struct mxc_ac97_audio_ops stk5_ac97_ops = { -+ .init = stk5_ac97_init, -+ .exit = stk5_ac97_exit, -+ .startup = NULL, -+ .shutdown = NULL, -+ .suspend = NULL, -+ .resume = NULL, -+ .priv = NULL, -+}; -+ -+static struct platform_device ac97_device = { -+ .name = "mx25-ac97", -+ .id = -1, -+ .dev = { -+ .dma_mask = &stk5_dma_mask, -+ .coherent_dma_mask = ~0UL, -+ .platform_data = &stk5_ac97_ops, -+ }, -+}; -+#endif -+ -+static struct platform_dev_list { -+ struct platform_device *pdev; -+ int flag; -+} stk5_devices[] __initdata = { -+#if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE) -+ { .pdev = &stk5_led_device, .flag = -1, }, -+#endif -+#if defined(CONFIG_KEYBOARD_MXC) || defined(CONFIG_KEYBOARD_MXC_MODULE) -+ { .pdev = &stk5_keypad_device, .flag = 1, }, -+#endif -+#if defined(CONFIG_SPI_MXC) || defined(CONFIG_SPI_MXC_MODULE) -+ { .pdev = &mxcspi1_device, .flag = 1, }, -+#endif -+#if defined(CONFIG_AC97_BUS) || defined(CONFIG_AC97_BUS_MODULE) -+ { .pdev = &ac97_device, .flag = 1, }, -+#endif -+#if defined(CONFIG_MMC_MXC) || defined(CONFIG_MMC_MXC_MODULE) -+ { .pdev = &stk5_sdhc1_device, .flag = 1, }, -+#endif -+}; -+#define STK5_NUM_DEVICES ARRAY_SIZE(stk5_devices) -+ -+static __init int karo_stk5_board_init(void) -+{ -+ int ret; -+ int i; -+ -+ if (karo_get_board_type() != BOARD_KARO_STK5) { -+ return -ENODEV; -+ } -+ DBG(0, "%s: \n", __FUNCTION__); -+ -+ karo_stk5_serial_init(); -+ -+ dump_regs(); -+ -+ /* enable SSI1_INT (GPIO_3_15) for IRQ probing */ -+ set_irq_flags(gpio_to_irq(GPIO_PORTC | 15), IRQF_VALID | IRQF_PROBE); -+ -+ ret = karo_stk5_fb_register(); -+ if (ret) { -+ 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; -+ if (!stk5_devices[i].flag) { -+ DBG(0, "%s: Skipping platform device[%d] @ %p dev %p: %s\n", -+ __FUNCTION__, i, stk5_devices[i].pdev, &stk5_devices[i].pdev->dev, -+ stk5_devices[i].pdev->name); -+ continue; -+ } -+ DBG(0, "%s: Registering platform device[%d] @ %p dev %p: %s\n", -+ __FUNCTION__, i, stk5_devices[i].pdev, &stk5_devices[i].pdev->dev, -+ stk5_devices[i].pdev->name); -+ ret = platform_device_register(stk5_devices[i].pdev); -+ if (ret) { -+ printk(KERN_WARNING "%s: Failed to register platform_device[%d]: %s: %d\n", -+ __FUNCTION__, i, stk5_devices[i].pdev->name, ret); -+ } -+ } -+ DBG(0, "%s: Done\n", __FUNCTION__); -+ 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:59:19.000000000 +0200 -@@ -381,7 +381,7 @@ DEFINE_CLOCK(gpu2d_clk, 0, CCM_CGR3, 4 - .clk = &c, \ - }, - --static struct clk_lookup lookups[] __initdata = { -+static struct clk_lookup lookups[] = { - _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:59:19.000000000 +0200 -@@ -516,7 +516,7 @@ DEFINE_CLOCK(ipg_clk, 0, NULL, - .clk = &c, \ - }, - --static struct clk_lookup lookups[] __initdata = { -+static struct clk_lookup lookups[] = { - _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 18:01:59.000000000 +0200 -@@ -56,6 +56,9 @@ config ARCH_HAS_RNGA - bool - depends on ARCH_MXC - -+config ARCH_MXC_IOMUX_V2 -+ bool -+ - 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 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 - --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 -+obj-$(CONFIG_ARCH_MXC_IOMUX_V2) += iomux-mx1-mx2.o dma-mx1-mx2.o -+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 18:02:13.000000000 +0200 -@@ -0,0 +1,17 @@ -+/* -+ * Copyright 2009 -+ * -+ * 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 -+ */ -+ -+#define UART1_ENABLED 1 -+#define UART2_ENABLED 1 -+#define UART3_ENABLED 1 -+/* 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 18:02:13.000000000 +0200 -@@ -0,0 +1,13 @@ -+/* -+ * Copyright 2009 -+ * -+ * 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 -+ */ -+ -+#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 18:02:05.000000000 +0200 -@@ -17,6 +17,7 @@ struct clk; - extern void mx1_map_io(void); - extern void mx21_map_io(void); - extern void mx27_map_io(void); -+extern void mx25_map_io(void); - extern void mx31_map_io(void); - extern void mx35_map_io(void); - extern void mxc_init_irq(void); -@@ -24,6 +25,7 @@ extern void mxc_timer_init(struct clk *t - extern int mx1_clocks_init(unsigned long fref); - extern int mx21_clocks_init(unsigned long lref, unsigned long fref); - extern int mx27_clocks_init(unsigned long fref); -+extern int mx25_clocks_init(unsigned long fref); - 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 18:02:13.000000000 +0200 -@@ -0,0 +1,259 @@ -+/* -+ * Copyright 2004-2008 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_DMA_H__ -+#define __ASM_ARCH_MXC_DMA_H__ -+ -+#include -+ -+#define MXC_DMA_DYNAMIC_CHANNEL 255 -+ -+#define MXC_DMA_DONE 0x0 -+#define MXC_DMA_REQUEST_TIMEOUT 0x1 -+#define MXC_DMA_TRANSFER_ERROR 0x2 -+ -+/*! This defines the list of device ID's for DMA */ -+typedef enum mxc_dma_device { -+ MXC_DMA_UART1_RX, -+ MXC_DMA_UART1_TX, -+ MXC_DMA_UART2_RX, -+ MXC_DMA_UART2_TX, -+ MXC_DMA_UART3_RX, -+ MXC_DMA_UART3_TX, -+ MXC_DMA_UART4_RX, -+ MXC_DMA_UART4_TX, -+ MXC_DMA_UART5_RX, -+ MXC_DMA_UART5_TX, -+ MXC_DMA_UART6_RX, -+ MXC_DMA_UART6_TX, -+ MXC_DMA_MMC1_WIDTH_1, -+ MXC_DMA_MMC1_WIDTH_4, -+ MXC_DMA_MMC2_WIDTH_1, -+ MXC_DMA_MMC2_WIDTH_4, -+ MXC_DMA_SSI1_8BIT_RX0, -+ MXC_DMA_SSI1_8BIT_TX0, -+ MXC_DMA_SSI1_16BIT_RX0, -+ MXC_DMA_SSI1_16BIT_TX0, -+ MXC_DMA_SSI1_24BIT_RX0, -+ MXC_DMA_SSI1_24BIT_TX0, -+ MXC_DMA_SSI1_8BIT_RX1, -+ MXC_DMA_SSI1_8BIT_TX1, -+ MXC_DMA_SSI1_16BIT_RX1, -+ MXC_DMA_SSI1_16BIT_TX1, -+ MXC_DMA_SSI1_24BIT_RX1, -+ MXC_DMA_SSI1_24BIT_TX1, -+ MXC_DMA_SSI2_8BIT_RX0, -+ MXC_DMA_SSI2_8BIT_TX0, -+ MXC_DMA_SSI2_16BIT_RX0, -+ MXC_DMA_SSI2_16BIT_TX0, -+ MXC_DMA_SSI2_24BIT_RX0, -+ MXC_DMA_SSI2_24BIT_TX0, -+ MXC_DMA_SSI2_8BIT_RX1, -+ MXC_DMA_SSI2_8BIT_TX1, -+ MXC_DMA_SSI2_16BIT_RX1, -+ MXC_DMA_SSI2_16BIT_TX1, -+ MXC_DMA_SSI2_24BIT_RX1, -+ MXC_DMA_SSI2_24BIT_TX1, -+ MXC_DMA_FIR_RX, -+ MXC_DMA_FIR_TX, -+ MXC_DMA_CSPI1_RX, -+ MXC_DMA_CSPI1_TX, -+ MXC_DMA_CSPI2_RX, -+ MXC_DMA_CSPI2_TX, -+ MXC_DMA_CSPI3_RX, -+ MXC_DMA_CSPI3_TX, -+ MXC_DMA_ATA_RX, -+ MXC_DMA_ATA_TX, -+ MXC_DMA_MEMORY, -+ MXC_DMA_FIFO_MEMORY, -+ MXC_DMA_DSP_PACKET_DATA0_RD, -+ MXC_DMA_DSP_PACKET_DATA0_WR, -+ MXC_DMA_DSP_PACKET_DATA1_RD, -+ MXC_DMA_DSP_PACKET_DATA1_WR, -+ MXC_DMA_DSP_LOG0_CHNL, -+ MXC_DMA_DSP_LOG1_CHNL, -+ MXC_DMA_DSP_LOG2_CHNL, -+ MXC_DMA_DSP_LOG3_CHNL, -+ MXC_DMA_CSI_RX, -+ MXC_DMA_SPDIF_16BIT_TX, -+ MXC_DMA_SPDIF_16BIT_RX, -+ MXC_DMA_SPDIF_32BIT_TX, -+ MXC_DMA_SPDIF_32BIT_RX, -+ MXC_DMA_ASRC_A_RX, -+ MXC_DMA_ASRC_A_TX, -+ MXC_DMA_ASRC_B_RX, -+ MXC_DMA_ASRC_B_TX, -+ MXC_DMA_ASRC_C_RX, -+ MXC_DMA_ASRC_C_TX, -+ MXC_DMA_ESAI_16BIT_RX, -+ MXC_DMA_ESAI_16BIT_TX, -+ MXC_DMA_ESAI_24BIT_RX, -+ MXC_DMA_ESAI_24BIT_TX, -+ MXC_DMA_TEST_RAM2D2RAM, -+ MXC_DMA_TEST_RAM2RAM2D, -+ MXC_DMA_TEST_RAM2D2RAM2D, -+ MXC_DMA_TEST_RAM2RAM, -+ MXC_DMA_TEST_HW_CHAINING, -+ MXC_DMA_TEST_SW_CHAINING -+} mxc_dma_device_t; -+ -+/*! This defines the prototype of callback funtion registered by the drivers */ -+typedef void (*mxc_dma_callback_t) (void *arg, int error_status, -+ unsigned int count); -+ -+/*! This defines the type of DMA transfer requested */ -+typedef enum mxc_dma_mode { -+ MXC_DMA_MODE_READ, -+ MXC_DMA_MODE_WRITE, -+} mxc_dma_mode_t; -+ -+/*! This defines the DMA channel parameters */ -+typedef struct mxc_dma_channel { -+ unsigned int active:1; /*!< When there has a active tranfer, it is set to 1 */ -+ unsigned int lock; /*!< Defines the channel is allocated or not */ -+ int curr_buf; /*!< Current buffer */ -+ mxc_dma_mode_t mode; /*!< Read or Write */ -+ unsigned int channel; /*!< Channel info */ -+ unsigned int dynamic:1; /*!< Channel not statically allocated when 1 */ -+ char *dev_name; /*!< Device name */ -+ void *private; /*!< Private structure for platform */ -+ mxc_dma_callback_t cb_fn; /*!< The callback function */ -+ void *cb_args; /*!< The argument of callback function */ -+} mxc_dma_channel_t; -+ -+/*! This structure contains the information about a dma transfer */ -+typedef struct mxc_dma_requestbuf { -+ dma_addr_t src_addr; /*!< source address */ -+ dma_addr_t dst_addr; /*!< destination address */ -+ int num_of_bytes; /*!< the length of this transfer : bytes */ -+} mxc_dma_requestbuf_t; -+ -+/*! -+ * This function is generally called by the driver at open time. -+ * The DMA driver would do any initialization steps that is required -+ * to get the channel ready for data transfer. -+ * -+ * @param channel_id a pre-defined id. The peripheral driver would specify -+ * the id associated with its peripheral. This would be -+ * used by the DMA driver to identify the peripheral -+ * requesting DMA and do the necessary setup on the -+ * channel associated with the particular peripheral. -+ * The DMA driver could use static or dynamic DMA channel -+ * allocation. -+ * @param dev_name module name or device name -+ * @return returns a negative number on error if request for a DMA channel did not -+ * succeed, returns the channel number to be used on success. -+ */ -+extern int mxc_dma_request(mxc_dma_device_t channel_id, char *dev_name); -+ -+/*! -+ * This function is generally called by the driver at close time. The DMA -+ * driver would do any cleanup associated with this channel. -+ * -+ * @param channel_num the channel number returned at request time. This -+ * would be used by the DMA driver to identify the calling -+ * driver and do the necessary cleanup on the channel -+ * associated with the particular peripheral -+ * @return returns a negative number on error or 0 on success -+ */ -+extern int mxc_dma_free(int channel_num); -+ -+/*! -+ * This function would just configure the buffers specified by the user into -+ * dma channel. The caller must call mxc_dma_enable to start this transfer. -+ * -+ * @param channel_num the channel number returned at request time. This -+ * would be used by the DMA driver to identify the calling -+ * driver and do the necessary cleanup on the channel -+ * associated with the particular peripheral -+ * @param dma_buf an array of physical addresses to the user defined -+ * buffers. The caller must guarantee the dma_buf is -+ * available until the transfer is completed. -+ * @param num_buf number of buffers in the array -+ * @param mode specifies whether this is READ or WRITE operation -+ * @return This function returns a negative number on error if buffer could not be -+ * added with DMA for transfer. On Success, it returns 0 -+ */ -+extern int mxc_dma_config(int channel_num, mxc_dma_requestbuf_t * dma_buf, -+ int num_buf, mxc_dma_mode_t mode); -+ -+/*! -+ * This function would just configure the scatterlist specified by the -+ * user into dma channel. This is a slight variation of mxc_dma_config(), -+ * it is provided for the convenience of drivers that have a scatterlist -+ * passed into them. It is the calling driver's responsibility to have the -+ * correct physical address filled in the "dma_address" field of the -+ * scatterlist. -+ * -+ * @param channel_num the channel number returned at request time. This -+ * would be used by the DMA driver to identify the calling -+ * driver and do the necessary cleanup on the channel -+ * associated with the particular peripheral -+ * @param sg a scatterlist of buffers. The caller must guarantee -+ * the dma_buf is available until the transfer is -+ * completed. -+ * @param num_buf number of buffers in the array -+ * @param num_of_bytes total number of bytes to transfer. If set to 0, this -+ * would imply to use the length field of the scatterlist -+ * for each DMA transfer. Else it would calculate the size -+ * for each DMA transfer. -+ * @param mode specifies whether this is READ or WRITE operation -+ * @return This function returns a negative number on error if buffer could not -+ * be added with DMA for transfer. On Success, it returns 0 -+ */ -+extern int mxc_dma_sg_config(int channel_num, struct scatterlist *sg, -+ int num_buf, int num_of_bytes, -+ mxc_dma_mode_t mode); -+ -+/*! -+ * This function is provided if the driver would like to set/change its -+ * callback function. -+ * -+ * @param channel_num the channel number returned at request time. This -+ * would be used by the DMA driver to identify the calling -+ * driver and do the necessary cleanup on the channel -+ * associated with the particular peripheral -+ * @param callback a callback function to provide notification on transfer -+ * completion, user could specify NULL if he does not wish -+ * to be notified -+ * @param arg an argument that gets passed in to the callback -+ * function, used by the user to do any driver specific -+ * operations. -+ * @return this function returns a negative number on error if the callback -+ * could not be set for the channel or 0 on success -+ */ -+extern int mxc_dma_callback_set(int channel_num, mxc_dma_callback_t callback, -+ void *arg); -+ -+/*! -+ * This stops the DMA channel and any ongoing transfers. Subsequent use of -+ * mxc_dma_enable() will restart the channel and restart the transfer. -+ * -+ * @param channel_num the channel number returned at request time. This -+ * would be used by the DMA driver to identify the calling -+ * driver and do the necessary cleanup on the channel -+ * associated with the particular peripheral -+ * @return returns a negative number on error or 0 on success -+ */ -+extern int mxc_dma_disable(int channel_num); -+ -+/*! -+ * This starts DMA transfer. Or it restarts DMA on a stopped channel -+ * previously stopped with mxc_dma_disable(). -+ * -+ * @param channel_num the channel number returned at request time. This -+ * would be used by the DMA driver to identify the calling -+ * driver and do the necessary cleanup on the channel -+ * associated with the particular peripheral -+ * @return returns a negative number on error or 0 on success -+ */ -+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 18:02:06.000000000 +0200 -@@ -29,13 +29,18 @@ - #endif - - #ifdef CONFIG_ARCH_MX2 -+#ifndef CONFIG_MACH_MX25 - # include -+#endif - # ifdef CONFIG_MACH_MX21 - # include - # endif - # ifdef CONFIG_MACH_MX27 - # include - # endif -+# ifdef CONFIG_MACH_MX25 -+# include -+# endif - #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 18:02:06.000000000 +0200 -@@ -13,7 +13,8 @@ - #define PCR_BPIX_4 (2 << 25) - #define PCR_BPIX_8 (3 << 25) - #define PCR_BPIX_12 (4 << 25) --#define PCR_BPIX_16 (4 << 25) -+#define PCR_BPIX_16 (5 << 25) -+#define PCR_BPIX_18 (6 << 25) - #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 18:02:13.000000000 +0200 -@@ -0,0 +1,905 @@ -+/* -+ * arch/arm/plat-mxc/include/mach/iomux-mx25.h -+ * -+ * Copyright (C) 2009 by Lothar Wassmann -+ * -+ * based on arch/arm/mach-mx25/mx25_pins.h -+ * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved. -+ * and -+ * arch/arm/plat-mxc/include/mach/iomux-mx35.h -+ * Copyright (C, NO_PAD_CTRL) 2009 by Jan Weitzel Phytec Messtechnik GmbH -+ * -+ * 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 __IOMUX_MX25_H__ -+#define __IOMUX_MX25_H__ -+ -+#include -+ -+/* -+ * -+ * @brief MX25 I/O Pin List -+ * -+ * @ingroup GPIO_MX25 -+ */ -+ -+#ifndef __ASSEMBLY__ -+ -+/* -+ * 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 IOMUX_TO_GPIO(__pad_desc) ({ \ -+ int __gpio = -1; \ -+ struct pad_desc *__pd = __pad_desc; \ -+ \ -+ switch (__pd->mux_ctrl_ofs) { \ -+ case MX25_PAD_GPIO_A__GPIO_A: \ -+ __gpio = GPIO_A; \ -+ break; \ -+ case MX25_PAD_GPIO_B__GPIO_B: \ -+ __gpio = GPIO_B; \ -+ break; \ -+ case MX25_PAD_GPIO_C__GPIO_C: \ -+ __gpio = GPIO_C; \ -+ break; \ -+ case MX25_PAD_GPIO_D__GPIO_D: \ -+ __gpio = GPIO_D; \ -+ break; \ -+ case MX25_PAD_GPIO_E__GPIO_E: \ -+ __gpio = GPIO_E; \ -+ break; \ -+ case MX25_PAD_GPIO_F__GPIO_F: \ -+ __gpio = GPIO_F; \ -+ break; \ -+ case MX25_PAD_CSI_D7__GPIO_1_6: \ -+ __gpio = GPIO_1_6; \ -+ break; \ -+ case MX25_PAD_CSI_D8__GPIO_1_7: \ -+ __gpio = GPIO_1_7; \ -+ break; \ -+ case MX25_PAD_CSI_MCLK__GPIO_1_8: \ -+ __gpio = GPIO_1_8; \ -+ break; \ -+ case MX25_PAD_CSI_VSYNC__GPIO_1_9: \ -+ __gpio = GPIO_1_9; \ -+ break; \ -+ case MX25_PAD_CSI_HSYNC__GPIO_1_10: \ -+ __gpio = GPIO_1_10; \ -+ break; \ -+ case MX25_PAD_CSI_PIXCLK__GPIO_1_11: \ -+ __gpio = GPIO_1_11; \ -+ break; \ -+ case MX25_PAD_I2C1_CLK__GPIO_1_12: \ -+ __gpio = GPIO_1_12; \ -+ break; \ -+ case MX25_PAD_I2C1_DAT__GPIO_1_13: \ -+ __gpio = GPIO_1_13; \ -+ break; \ -+ case MX25_PAD_CSPI1_MOSI__GPIO_1_14: \ -+ __gpio = GPIO_1_14; \ -+ break; \ -+ case MX25_PAD_CSPI1_MISO__GPIO_1_15: \ -+ __gpio = GPIO_1_15; \ -+ break; \ -+ case MX25_PAD_CSPI1_SS0__GPIO_1_16: \ -+ __gpio = GPIO_1_16; \ -+ break; \ -+ case MX25_PAD_CSPI1_SS1__GPIO_1_17: \ -+ __gpio = GPIO_1_17; \ -+ break; \ -+ case MX25_PAD_CSPI1_SCLK__GPIO_1_18: \ -+ __gpio = GPIO_1_18; \ -+ break; \ -+ case MX25_PAD_LD5__GPIO_1_19: \ -+ __gpio = GPIO_1_19; \ -+ break; \ -+ case MX25_PAD_LD6__GPIO_1_20: \ -+ __gpio = GPIO_1_20; \ -+ break; \ -+ case MX25_PAD_LD7__GPIO_1_21: \ -+ __gpio = GPIO_1_21; \ -+ break; \ -+ case MX25_PAD_HSYNC__GPIO_1_22: \ -+ __gpio = GPIO_1_22; \ -+ break; \ -+ case MX25_PAD_VSYNC__GPIO_1_23: \ -+ __gpio = GPIO_1_23; \ -+ break; \ -+ case MX25_PAD_LSCLK__GPIO_1_24: \ -+ __gpio = GPIO_1_24; \ -+ break; \ -+ case MX25_PAD_OE_ACD__GPIO_1_25: \ -+ __gpio = GPIO_1_25; \ -+ break; \ -+ case MX25_PAD_PWM__GPIO_1_26: \ -+ __gpio = GPIO_1_26; \ -+ break; \ -+ case MX25_PAD_CSI_D2__GPIO_1_27: \ -+ __gpio = GPIO_1_27; \ -+ break; \ -+ case MX25_PAD_CSI_D3__GPIO_1_28: \ -+ __gpio = GPIO_1_28; \ -+ break; \ -+ case MX25_PAD_CSI_D4__GPIO_1_29: \ -+ __gpio = GPIO_1_29; \ -+ break; \ -+ case MX25_PAD_CSI_D5__GPIO_1_30: \ -+ __gpio = GPIO_1_30; \ -+ break; \ -+ case MX25_PAD_CSI_D6__GPIO_1_31: \ -+ __gpio = GPIO_1_31; \ -+ break; \ -+ \ -+ case MX25_PAD_A14__GPIO_2_0: \ -+ __gpio = GPIO_2_0; \ -+ break; \ -+ case MX25_PAD_A15__GPIO_2_1: \ -+ __gpio = GPIO_2_1; \ -+ break; \ -+ case MX25_PAD_A16__GPIO_2_2: \ -+ __gpio = GPIO_2_2; \ -+ break; \ -+ case MX25_PAD_A17__GPIO_2_3: \ -+ __gpio = GPIO_2_3; \ -+ break; \ -+ case MX25_PAD_A18__GPIO_2_4: \ -+ __gpio = GPIO_2_4; \ -+ break; \ -+ case MX25_PAD_A19__GPIO_2_5: \ -+ __gpio = GPIO_2_5; \ -+ break; \ -+ case MX25_PAD_A20__GPIO_2_6: \ -+ __gpio = GPIO_2_6; \ -+ break; \ -+ case MX25_PAD_A21__GPIO_2_7: \ -+ __gpio = GPIO_2_7; \ -+ break; \ -+ case MX25_PAD_A22__GPIO_2_8: \ -+ __gpio = GPIO_2_8; \ -+ break; \ -+ case MX25_PAD_A23__GPIO_2_9: \ -+ __gpio = GPIO_2_9; \ -+ break; \ -+ case MX25_PAD_A24__GPIO_2_10: \ -+ __gpio = GPIO_2_10; \ -+ break; \ -+ case MX25_PAD_A25__GPIO_2_11: \ -+ __gpio = GPIO_2_11; \ -+ break; \ -+ case MX25_PAD_EB0__GPIO_2_12: \ -+ __gpio = GPIO_2_12; \ -+ break; \ -+ case MX25_PAD_EB1__GPIO_2_13: \ -+ __gpio = GPIO_2_13; \ -+ break; \ -+ case MX25_PAD_OE__GPIO_2_14: \ -+ __gpio = GPIO_2_14; \ -+ break; \ -+ case MX25_PAD_LD0__GPIO_2_15: \ -+ __gpio = GPIO_2_15; \ -+ break; \ -+ case MX25_PAD_LD1__GPIO_2_16: \ -+ __gpio = GPIO_2_16; \ -+ break; \ -+ case MX25_PAD_LD2__GPIO_2_17: \ -+ __gpio = GPIO_2_17; \ -+ break; \ -+ case MX25_PAD_LD3__GPIO_2_18: \ -+ __gpio = GPIO_2_18; \ -+ break; \ -+ case MX25_PAD_LD4__GPIO_2_19: \ -+ __gpio = GPIO_2_19; \ -+ break; \ -+ case MX25_PAD_DE_B__GPIO_2_20: \ -+ __gpio = GPIO_2_20; \ -+ break; \ -+ case MX25_PAD_CLKO__GPIO_2_21: \ -+ __gpio = GPIO_2_21; \ -+ break; \ -+ case MX25_PAD_CSPI1_RDY__GPIO_2_22: \ -+ __gpio = GPIO_2_22; \ -+ break; \ -+ case MX25_PAD_SD1_CMD__GPIO_2_23: \ -+ __gpio = GPIO_2_23; \ -+ break; \ -+ case MX25_PAD_SD1_CLK__GPIO_2_24: \ -+ __gpio = GPIO_2_24; \ -+ break; \ -+ case MX25_PAD_SD1_DATA0__GPIO_2_25: \ -+ __gpio = GPIO_2_25; \ -+ break; \ -+ case MX25_PAD_SD1_DATA1__GPIO_2_26: \ -+ __gpio = GPIO_2_26; \ -+ break; \ -+ case MX25_PAD_SD1_DATA2__GPIO_2_27: \ -+ __gpio = GPIO_2_27; \ -+ break; \ -+ case MX25_PAD_SD1_DATA3__GPIO_2_28: \ -+ __gpio = GPIO_2_28; \ -+ break; \ -+ case MX25_PAD_KPP_ROW0__GPIO_2_29: \ -+ __gpio = GPIO_2_29; \ -+ break; \ -+ case MX25_PAD_KPP_ROW1__GPIO_2_30: \ -+ __gpio = GPIO_2_30; \ -+ break; \ -+ case MX25_PAD_KPP_ROW2__GPIO_2_31: \ -+ __gpio = GPIO_2_31; \ -+ break; \ -+ \ -+ case MX25_PAD_KPP_ROW3__GPIO_3_0: \ -+ __gpio = GPIO_3_0; \ -+ break; \ -+ case MX25_PAD_KPP_COL0__GPIO_3_1: \ -+ __gpio = GPIO_3_1; \ -+ break; \ -+ case MX25_PAD_KPP_COL1__GPIO_3_2: \ -+ __gpio = GPIO_3_2; \ -+ break; \ -+ case MX25_PAD_KPP_COL2__GPIO_3_3: \ -+ __gpio = GPIO_3_3; \ -+ break; \ -+ case MX25_PAD_KPP_COL3__GPIO_3_4: \ -+ __gpio = GPIO_3_4; \ -+ break; \ -+ case MX25_PAD_FEC_MDC__GPIO_3_5: \ -+ __gpio = GPIO_3_5; \ -+ break; \ -+ case MX25_PAD_FEC_MDIO__GPIO_3_6: \ -+ __gpio = GPIO_3_6; \ -+ break; \ -+ case MX25_PAD_FEC_TDATA0__GPIO_3_7: \ -+ __gpio = GPIO_3_7; \ -+ break; \ -+ case MX25_PAD_FEC_TDATA1__GPIO_3_8: \ -+ __gpio = GPIO_3_8; \ -+ break; \ -+ case MX25_PAD_FEC_TX_EN__GPIO_3_9: \ -+ __gpio = GPIO_3_9; \ -+ break; \ -+ case MX25_PAD_FEC_RDATA0__GPIO_3_10: \ -+ __gpio = GPIO_3_10; \ -+ break; \ -+ case MX25_PAD_FEC_RDATA1__GPIO_3_11: \ -+ __gpio = GPIO_3_11; \ -+ break; \ -+ case MX25_PAD_FEC_RX_DV__GPIO_3_12: \ -+ __gpio = GPIO_3_12; \ -+ break; \ -+ case MX25_PAD_FEC_TX_CLK__GPIO_3_13: \ -+ __gpio = GPIO_3_13; \ -+ break; \ -+ case MX25_PAD_RTCK__GPIO_3_14: \ -+ __gpio = GPIO_3_14; \ -+ break; \ -+ case MX25_PAD_EXT_ARMCLK__GPIO_3_15: \ -+ __gpio = GPIO_3_15; \ -+ break; \ -+ case MX25_PAD_UPLL_BYPCLK__GPIO_3_16: \ -+ __gpio = GPIO_3_16; \ -+ break; \ -+ case MX25_PAD_VSTBY_REQ__GPIO_3_17: \ -+ __gpio = GPIO_3_17; \ -+ break; \ -+ case MX25_PAD_VSTBY_ACK__GPIO_3_18: \ -+ __gpio = GPIO_3_18; \ -+ break; \ -+ case MX25_PAD_POWER_FAIL__GPIO_3_19: \ -+ __gpio = GPIO_3_19; \ -+ break; \ -+ case MX25_PAD_CS4__GPIO_3_20: \ -+ __gpio = GPIO_3_20; \ -+ break; \ -+ case MX25_PAD_CS5__GPIO_3_21: \ -+ __gpio = GPIO_3_21; \ -+ break; \ -+ case MX25_PAD_NF_CE0__GPIO_3_22: \ -+ __gpio = GPIO_3_22; \ -+ break; \ -+ case MX25_PAD_ECB__GPIO_3_23: \ -+ __gpio = GPIO_3_23; \ -+ break; \ -+ case MX25_PAD_LBA__GPIO_3_24: \ -+ __gpio = GPIO_3_24; \ -+ break; \ -+ case MX25_PAD_RW__GPIO_3_25: \ -+ __gpio = GPIO_3_25; \ -+ break; \ -+ case MX25_PAD_NFWE_B__GPIO_3_26: \ -+ __gpio = GPIO_3_26; \ -+ break; \ -+ case MX25_PAD_NFRE_B__GPIO_3_27: \ -+ __gpio = GPIO_3_27; \ -+ break; \ -+ case MX25_PAD_NFALE__GPIO_3_28: \ -+ __gpio = GPIO_3_28; \ -+ break; \ -+ case MX25_PAD_NFCLE__GPIO_3_29: \ -+ __gpio = GPIO_3_29; \ -+ break; \ -+ case MX25_PAD_NFWP_B__GPIO_3_30: \ -+ __gpio = GPIO_3_30; \ -+ break; \ -+ case MX25_PAD_NFRB__GPIO_3_31: \ -+ __gpio = GPIO_3_31; \ -+ break; \ -+ \ -+ case MX25_PAD_A10__GPIO_4_0: \ -+ __gpio = GPIO_4_0; \ -+ break; \ -+ case MX25_PAD_A13__GPIO_4_1: \ -+ __gpio = GPIO_4_1; \ -+ break; \ -+ case MX25_PAD_CS0__GPIO_4_2: \ -+ __gpio = GPIO_4_2; \ -+ break; \ -+ case MX25_PAD_CS1__GPIO_4_3: \ -+ __gpio = GPIO_4_3; \ -+ break; \ -+ case MX25_PAD_BCLK__GPIO_4_4: \ -+ __gpio = GPIO_4_4; \ -+ break; \ -+ case MX25_PAD_D15__GPIO_4_5: \ -+ __gpio = GPIO_4_5; \ -+ break; \ -+ case MX25_PAD_D14__GPIO_4_6: \ -+ __gpio = GPIO_4_6; \ -+ break; \ -+ case MX25_PAD_D13__GPIO_4_7: \ -+ __gpio = GPIO_4_7; \ -+ break; \ -+ case MX25_PAD_D12__GPIO_4_8: \ -+ __gpio = GPIO_4_8; \ -+ break; \ -+ case MX25_PAD_D11__GPIO_4_9: \ -+ __gpio = GPIO_4_9; \ -+ break; \ -+ case MX25_PAD_D10__GPIO_4_10: \ -+ __gpio = GPIO_4_10; \ -+ break; \ -+ case MX25_PAD_D9__GPIO_4_11: \ -+ __gpio = GPIO_4_11; \ -+ break; \ -+ case MX25_PAD_D8__GPIO_4_12: \ -+ __gpio = GPIO_4_12; \ -+ break; \ -+ case MX25_PAD_D7__GPIO_4_13: \ -+ __gpio = GPIO_4_13; \ -+ break; \ -+ case MX25_PAD_D6__GPIO_4_14: \ -+ __gpio = GPIO_4_14; \ -+ break; \ -+ case MX25_PAD_D5__GPIO_4_15: \ -+ __gpio = GPIO_4_15; \ -+ break; \ -+ case MX25_PAD_D4__GPIO_4_16: \ -+ __gpio = GPIO_4_16; \ -+ break; \ -+ case MX25_PAD_D3__GPIO_4_17: \ -+ __gpio = GPIO_4_17; \ -+ break; \ -+ case MX25_PAD_D2__GPIO_4_18: \ -+ __gpio = GPIO_4_18; \ -+ break; \ -+ case MX25_PAD_D1__GPIO_4_19: \ -+ __gpio = GPIO_4_19; \ -+ break; \ -+ case MX25_PAD_D0__GPIO_4_20: \ -+ __gpio = GPIO_4_20; \ -+ break; \ -+ case MX25_PAD_CSI_D9__GPIO_4_21: \ -+ __gpio = GPIO_4_21; \ -+ break; \ -+ case MX25_PAD_UART1_RXD__GPIO_4_22: \ -+ __gpio = GPIO_4_22; \ -+ break; \ -+ case MX25_PAD_UART1_TXD__GPIO_4_23: \ -+ __gpio = GPIO_4_23; \ -+ break; \ -+ case MX25_PAD_UART1_RTS__GPIO_4_24: \ -+ __gpio = GPIO_4_24; \ -+ break; \ -+ case MX25_PAD_UART1_CTS__GPIO_4_25: \ -+ __gpio = GPIO_4_25; \ -+ break; \ -+ case MX25_PAD_UART2_RXD__GPIO_4_26: \ -+ __gpio = GPIO_4_26; \ -+ break; \ -+ case MX25_PAD_UART2_TXD__GPIO_4_27: \ -+ __gpio = GPIO_4_27; \ -+ break; \ -+ case MX25_PAD_UART2_RTS__GPIO_4_28: \ -+ __gpio = GPIO_4_28; \ -+ break; \ -+ case MX25_PAD_UART2_CTS__GPIO_4_29: \ -+ __gpio = GPIO_4_29; \ -+ break; \ -+ case MX25_PAD_BOOT_MODE0__GPIO_4_30: \ -+ __gpio = GPIO_4_30; \ -+ break; \ -+ case MX25_PAD_BOOT_MODE1__GPIO_4_31: \ -+ __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 18:02:08.000000000 +0200 -@@ -54,7 +54,7 @@ struct pad_desc { - unsigned select_input:3; - }; - --#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 { - /* - * 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_DRIVE_VOLTAGE_3_3_V (0 << 13) -+#define PAD_CTL_DRIVE_VOLTAGE_1_8_V (1 << 13) - --#define PAD_CTL_NO_HYSTERESIS 0 --#define PAD_CTL_HYSTERESIS 1 -+#define PAD_CTL_NO_HYSTERESIS (0 << 8) -+#define PAD_CTL_HYSTERESIS (1 << 8) - --#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_PULL_DISABLED (0x0 << 4) -+#define PAD_CTL_PULL_KEEPER (0x8 << 4) -+#define PAD_CTL_PULL_DOWN_100K (0xc << 4) -+#define PAD_CTL_PULL_UP_47K (0xd << 4) -+#define PAD_CTL_PULL_UP_100K (0xe << 4) -+#define PAD_CTL_PULL_UP_22K (0xf << 4) -+ -+#define PAD_CTL_OUTPUT_CMOS (0 << 3) -+#define PAD_CTL_OUTPUT_OPEN_DRAIN (1 << 3) -+ -+#define PAD_CTL_DRIVE_STRENGTH_NORM (0 << 1) -+#define PAD_CTL_DRIVE_STRENGTH_HIGH (1 << 1) -+#define PAD_CTL_DRIVE_STRENGTH_MAX (2 << 1) - --#define PAD_CTL_SLEW_RATE_SLOW 0 --#define PAD_CTL_SLEW_RATE_FAST 1 -+#define PAD_CTL_SLEW_RATE_SLOW (0 << 0) -+#define PAD_CTL_SLEW_RATE_FAST (1 << 0) - - /* - * 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 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 - */ -+#ifndef CONFIG_MACH_MX25 - #define VA_GPIO_BASE IO_ADDRESS(GPIO_BASE_ADDR) -+#endif - #define MXC_DDIR(x) (0x00 + ((x) << 8)) -+#ifndef CONFIG_MACH_MX25 - #define MXC_OCR1(x) (0x04 + ((x) << 8)) - #define MXC_OCR2(x) (0x08 + ((x) << 8)) -+#endif - #define MXC_ICONFA1(x) (0x0c + ((x) << 8)) - #define MXC_ICONFA2(x) (0x10 + ((x) << 8)) - #define MXC_ICONFB1(x) (0x14 + ((x) << 8)) -@@ -96,16 +100,20 @@ - - - #ifdef CONFIG_ARCH_MX1 --#include -+# include - #endif - #ifdef CONFIG_ARCH_MX2 --#include --#ifdef CONFIG_MACH_MX21 --#include --#endif --#ifdef CONFIG_MACH_MX27 --#include --#endif -+# ifndef CONFIG_MACH_MX25 -+# include -+# ifdef CONFIG_MACH_MX21 -+# include -+# endif -+# endif -+# ifdef CONFIG_MACH_MX27 -+# include -+# else -+# include -+# endif - #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 18:02:09.000000000 +0200 -@@ -21,7 +21,11 @@ - #if defined CONFIG_ARCH_MX1 - #define MXC_GPIO_IRQS (32 * 4) - #elif defined CONFIG_ARCH_MX2 -+#ifndef CONFIG_MACH_MX25 - #define MXC_GPIO_IRQS (32 * 6) -+#else -+#define MXC_GPIO_IRQS (32 * 4) -+#endif - #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 18:02:09.000000000 +0200 -@@ -14,12 +14,13 @@ - #if defined CONFIG_ARCH_MX1 - #define PHYS_OFFSET UL(0x08000000) - #elif defined CONFIG_ARCH_MX2 --#ifdef CONFIG_MACH_MX21 -+# if defined(CONFIG_MACH_MX21) - #define PHYS_OFFSET UL(0xC0000000) --#endif --#ifdef CONFIG_MACH_MX27 -+# elif defined(CONFIG_MACH_MX27) - #define PHYS_OFFSET UL(0xA0000000) --#endif -+# elif defined(CONFIG_MACH_MX25) -+#define PHYS_OFFSET UL(0x80000000) -+# endif - #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 18:02:13.000000000 +0200 -@@ -0,0 +1,482 @@ -+/* -+ * Copyright 2008-2009 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 -+ */ -+ -+/*! -+ * @file arch-mxc/mx25.h -+ * @brief This file contains register definitions. -+ * -+ * @ingroup MSL_MX25 -+ */ -+ -+#ifndef __ASM_ARCH_MXC_MX25_H__ -+#define __ASM_ARCH_MXC_MX25_H__ -+ -+#ifndef __ASM_ARCH_MXC_HARDWARE_H__ -+#error "Do not include directly." -+#endif -+ -+#ifdef CONFIG_DEBUG_LL -+#ifdef CONFIG_MACH_TX25 -+#include -+#endif -+#endif // CONFIG_DEBUG_LL -+ -+/* -+ * MX25 memory map: -+ * -+ * Virt Phys Size What -+ * --------------------------------------------------------------------------- -+ * FC000000 43F00000 1M AIPS 1 -+ * FC100000 50000000 1M SPBA -+ * FC200000 53F00000 1M AIPS 2 -+ * FC300000 60000000 1M ROMPATCH (128M) -+ * FC400000 68000000 1M ASIC (128M) -+ * FC500000 78000000 128K FBC RAM (IRAM) -+ * 80000000 256M SDRAM0 -+ * 90000000 256M SDRAM1 -+ * A0000000 128M CS0 Flash -+ * A8000000 128M CS1 Flash -+ * B0000000 32M CS2 SRAM -+ * B2000000 32M CS3 -+ * B4000000 32M CS4 -+ * B6000000 32M CS5 -+ * FC520000 B8000000 64K SDRAM, WEIM, M3IF, EMI controllers -+ * FC530000 BB000000 8K NFC -+ */ -+ -+#include -+#define VA(x) _AT(void __force __iomem *,x) -+ -+/* -+ * IRAM -+ */ -+#define IRAM_BASE_ADDR UL(0x78000000) /* internal ram */ -+#define IRAM_BASE_ADDR_VIRT VA(0xFC500000) -+#define IRAM_SIZE SZ_128K -+ -+/* -+ * AIPS 1 -+ */ -+#define AIPS1_BASE_ADDR UL(0x43F00000) -+#define AIPS1_BASE_ADDR_VIRT VA(0xFC000000) -+#define AIPS1_SIZE SZ_1M -+ -+#define MAX_BASE_ADDR (AIPS1_BASE_ADDR + 0x00004000) -+#define CLKCTL_BASE_ADDR (AIPS1_BASE_ADDR + 0x00008000) -+#define ETB_SLOT4_BASE_ADDR (AIPS1_BASE_ADDR + 0x0000C000) -+#define ETB_SLOT5_BASE_ADDR (AIPS1_BASE_ADDR + 0x00010000) -+#define AAPE_BASE_ADDR (AIPS1_BASE_ADDR + 0x00014000) -+#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 UART1_BASE_ADDR (AIPS1_BASE_ADDR + 0x00090000) -+#define UART2_BASE_ADDR (AIPS1_BASE_ADDR + 0x00094000) -+#define I2C2_BASE_ADDR (AIPS1_BASE_ADDR + 0x00098000) -+#define OWIRE_BASE_ADDR (AIPS1_BASE_ADDR + 0x0009C000) -+#define ATA_BASE_ADDR (AIPS1_BASE_ADDR + 0x000A0000) -+#define CSPI1_BASE_ADDR (AIPS1_BASE_ADDR + 0x000A4000) -+#define KPP_BASE_ADDR (AIPS1_BASE_ADDR + 0x000A8000) -+#define IOMUXC_BASE_ADDR (AIPS1_BASE_ADDR + 0x000AC000) -+#define AUDMUX_BASE_ADDR (AIPS1_BASE_ADDR + 0x000B0000) -+#define ECT_A_BASE_ADDR (AIPS1_BASE_ADDR + 0x000B8000) -+#define ECT_B_BASE_ADDR (AIPS1_BASE_ADDR + 0x000BC000) -+ -+/* -+ * SPBA global module enabled #0 -+ */ -+#define SPBA0_BASE_ADDR UL(0x50000000) -+#define SPBA0_BASE_ADDR_VIRT VA(0xFC100000) -+#define SPBA0_SIZE SZ_1M -+ -+#define CSPI3_BASE_ADDR (SPBA0_BASE_ADDR + 0x00004000) -+#define UART4_BASE_ADDR (SPBA0_BASE_ADDR + 0x00008000) -+#define UART3_BASE_ADDR (SPBA0_BASE_ADDR + 0x0000C000) -+#define CSPI2_BASE_ADDR (SPBA0_BASE_ADDR + 0x00010000) -+#define SSI2_BASE_ADDR (SPBA0_BASE_ADDR + 0x00014000) -+#define ESAI_BASE_ADDR (SPBA0_BASE_ADDR + 0x00018000) -+#define ATA_DMA_BASE_ADDR (SPBA0_BASE_ADDR + 0x00020000) -+#define SIM1_BASE_ADDR (SPBA0_BASE_ADDR + 0x00024000) -+#define SIM2_BASE_ADDR (SPBA0_BASE_ADDR + 0x00028000) -+#define UART5_BASE_ADDR (SPBA0_BASE_ADDR + 0x0002C000) -+#define TSC_BASE_ADDR (SPBA0_BASE_ADDR + 0x00030000) -+#define SSI1_BASE_ADDR (SPBA0_BASE_ADDR + 0x00034000) -+#define FEC_BASE_ADDR (SPBA0_BASE_ADDR + 0x00038000) -+#define SPBA_CTRL_BASE_ADDR (SPBA0_BASE_ADDR + 0x0003C000) -+ -+/*! -+ * defines for SPBA modules -+ */ -+#define SPBA_CSPI3 (0x1 << 2) -+#define SPBA_UART4 (0x2 << 2) -+#define SPBA_UART3 (0x3 << 2) -+#define SPBA_CSPI2 (0x4 << 2) -+#define SPBA_SSI2 (0x5 << 2) -+#define SPBA_ESAI (0x6 << 2) -+#define SPBA_ATA (0x8 << 2) -+#define SPBA_SIM1 (0x9 << 2) -+#define SPBA_SIM2 (0xA << 2) -+#define SPBA_UART5 (0xB << 2) -+#define SPBA_ANALOG (0xC << 2) -+#define SPBA_SSI1 (0xD << 2) -+#define SPBA_FEC (0xE << 2) -+ -+/*! -+ * Defines for modules using static and dynamic DMA channels -+ */ -+#define MXC_DMA_CHANNEL_IRAM 30 -+#define MXC_DMA_CHANNEL_UART1_RX MXC_DMA_DYNAMIC_CHANNEL -+#define MXC_DMA_CHANNEL_UART1_TX MXC_DMA_DYNAMIC_CHANNEL -+#define MXC_DMA_CHANNEL_UART2_RX MXC_DMA_DYNAMIC_CHANNEL -+#define MXC_DMA_CHANNEL_UART2_TX MXC_DMA_DYNAMIC_CHANNEL -+#define MXC_DMA_CHANNEL_UART3_RX MXC_DMA_DYNAMIC_CHANNEL -+#define MXC_DMA_CHANNEL_UART3_TX MXC_DMA_DYNAMIC_CHANNEL -+#define MXC_DMA_CHANNEL_UART4_RX MXC_DMA_DYNAMIC_CHANNEL -+#define MXC_DMA_CHANNEL_UART4_TX MXC_DMA_DYNAMIC_CHANNEL -+#define MXC_DMA_CHANNEL_UART5_RX MXC_DMA_DYNAMIC_CHANNEL -+#define MXC_DMA_CHANNEL_UART5_TX MXC_DMA_DYNAMIC_CHANNEL -+#define MXC_DMA_CHANNEL_MMC1 MXC_DMA_DYNAMIC_CHANNEL -+#define MXC_DMA_CHANNEL_SSI1_RX MXC_DMA_DYNAMIC_CHANNEL -+#ifdef CONFIG_SDMA_IRAM -+#define MXC_DMA_CHANNEL_SSI1_TX (MXC_DMA_CHANNEL_IRAM + 1) -+#else -+#define MXC_DMA_CHANNEL_SSI1_TX MXC_DMA_DYNAMIC_CHANNEL -+#endif -+#define MXC_DMA_CHANNEL_SSI2_RX MXC_DMA_DYNAMIC_CHANNEL -+#define MXC_DMA_CHANNEL_SSI2_TX MXC_DMA_DYNAMIC_CHANNEL -+#define MXC_DMA_CHANNEL_CSPI1_RX MXC_DMA_DYNAMIC_CHANNEL -+#define MXC_DMA_CHANNEL_CSPI1_TX MXC_DMA_DYNAMIC_CHANNEL -+#define MXC_DMA_CHANNEL_CSPI2_RX MXC_DMA_DYNAMIC_CHANNEL -+#define MXC_DMA_CHANNEL_CSPI2_TX MXC_DMA_DYNAMIC_CHANNEL -+#define MXC_DMA_CHANNEL_CSPI3_RX MXC_DMA_DYNAMIC_CHANNEL -+#define MXC_DMA_CHANNEL_CSPI3_TX MXC_DMA_DYNAMIC_CHANNEL -+#define MXC_DMA_CHANNEL_ATA_RX MXC_DMA_DYNAMIC_CHANNEL -+#define MXC_DMA_CHANNEL_ATA_TX MXC_DMA_DYNAMIC_CHANNEL -+#define MXC_DMA_CHANNEL_MEMORY MXC_DMA_DYNAMIC_CHANNEL -+#define MXC_DMA_CHANNEL_ESAI_RX MXC_DMA_DYNAMIC_CHANNEL -+#define MXC_DMA_CHANNEL_ESAI_TX MXC_DMA_DYNAMIC_CHANNEL -+ -+/* -+ * AIPS 2 -+ */ -+#define AIPS2_BASE_ADDR UL(0x53F00000) -+#define AIPS2_BASE_ADDR_VIRT VA(0xFC200000) -+#define AIPS2_SIZE SZ_1M -+ -+#define CCM_BASE_ADDR (AIPS2_BASE_ADDR + 0x00080000) -+#define GPT4_BASE_ADDR (AIPS2_BASE_ADDR + 0x00084000) -+#define GPT3_BASE_ADDR (AIPS2_BASE_ADDR + 0x00088000) -+#define GPT2_BASE_ADDR (AIPS2_BASE_ADDR + 0x0008C000) -+#define GPT1_BASE_ADDR (AIPS2_BASE_ADDR + 0x00090000) -+#define EPIT1_BASE_ADDR (AIPS2_BASE_ADDR + 0x00094000) -+#define EPIT2_BASE_ADDR (AIPS2_BASE_ADDR + 0x00098000) -+#define GPIO4_BASE_ADDR (AIPS2_BASE_ADDR + 0x0009C000) -+#define PWM2_BASE_ADDR (AIPS2_BASE_ADDR + 0x000A0000) -+#define GPIO3_BASE_ADDR (AIPS2_BASE_ADDR + 0x000A4000) -+#define PWM3_BASE_ADDR (AIPS2_BASE_ADDR + 0x000A8000) -+#define SCC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000AC000) -+#define RNGD_BASE_ADDR (AIPS2_BASE_ADDR + 0x000B0000) -+#define MMC_SDHC1_BASE_ADDR (AIPS2_BASE_ADDR + 0x000B4000) -+#define MMC_SDHC2_BASE_ADDR (AIPS2_BASE_ADDR + 0x000B8000) -+#define LCDC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000BC000) -+#define SLCDC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000C0000) -+#define PWM4_BASE_ADDR (AIPS2_BASE_ADDR + 0x000C8000) -+#define GPIO1_BASE_ADDR (AIPS2_BASE_ADDR + 0x000CC000) -+#define GPIO2_BASE_ADDR (AIPS2_BASE_ADDR + 0x000D0000) -+#define SDMA_BASE_ADDR (AIPS2_BASE_ADDR + 0x000D4000) -+#define WDOG_BASE_ADDR (AIPS2_BASE_ADDR + 0x000DC000) -+#define PWM1_BASE_ADDR (AIPS2_BASE_ADDR + 0x000E0000) -+#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 CSI_BASE_ADDR (AIPS2_BASE_ADDR + 0x000F8000) -+#define DRYICE_BASE_ADDR (AIPS2_BASE_ADDR + 0x000FC000) -+ -+/* -+ * ROMP and ASIC -+ */ -+#define ROMP_BASE_ADDR UL(0x60000000) -+#define ROMP_BASE_ADDR_VIRT VA(0xFC300000) -+#define ROMP_SIZE SZ_1M -+ -+#define ASIC_BASE_ADDR UL(0x68000000) -+#define ASIC_BASE_ADDR_VIRT VA(0xFC400000) -+#define ASIC_SIZE SZ_1M -+#define AVIC_BASE_ADDR ASIC_BASE_ADDR -+#define AVIC_BASE_ADDR_VIRT ASIC_BASE_ADDR_VIRT -+#define AVIC_SIZE ASIC_SIZE -+ -+/* -+ * SDRAM, WEIM, M3IF, EMI controllers -+ */ -+#define X_MEMC_BASE_ADDR UL(0xB8000000) -+#define X_MEMC_BASE_ADDR_VIRT VA(0xFC520000) -+#define X_MEMC_SIZE SZ_64K -+ -+#define SDRAMC_BASE_ADDR (X_MEMC_BASE_ADDR + 0x1000) -+#define WEIM_BASE_ADDR (X_MEMC_BASE_ADDR + 0x2000) -+#define M3IF_BASE_ADDR (X_MEMC_BASE_ADDR + 0x3000) -+#define EMI_CTL_BASE_ADDR (X_MEMC_BASE_ADDR + 0x4000) -+ -+/* -+ * NFC controller -+ */ -+#define NFC_BASE_ADDR UL(0xBB000000) -+#define NFC_BASE_ADDR_VIRT VA(0xFC530000) -+#define NFC_SIZE SZ_8K -+ -+/* -+ * Memory regions and CS -+ */ -+#define CSD0_BASE_ADDR UL(0x80000000) -+#define CSD1_BASE_ADDR UL(0x90000000) -+ -+#define SDRAM_BASE_ADDR CSD0_BASE_ADDR -+ -+#define CS0_BASE_ADDR UL(0xA0000000) -+#define CS1_BASE_ADDR UL(0xA8000000) -+#define CS2_BASE_ADDR UL(0xB0000000) -+#define CS3_BASE_ADDR UL(0xB2000000) -+#define CS4_BASE_ADDR UL(0xB4000000) -+#define CS4_SIZE SZ_32M -+#define CS5_BASE_ADDR UL(0xB6000000) -+#define CS5_SIZE SZ_32M -+ -+/*! -+ * 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 -+ * and returning the virtual address. If the physical address is not mapped, -+ * it returns 0 -+ */ -+#define IO_ADDRESS(x) \ -+ VA((((x) >= AIPS1_BASE_ADDR) && ((x) < (AIPS1_BASE_ADDR + AIPS1_SIZE))) ? AIPS1_IO_ADDRESS(x): \ -+ (((x) >= SPBA0_BASE_ADDR) && ((x) < (SPBA0_BASE_ADDR + SPBA0_SIZE))) ? SPBA0_IO_ADDRESS(x): \ -+ (((x) >= AIPS2_BASE_ADDR) && ((x) < (AIPS2_BASE_ADDR + AIPS2_SIZE))) ? AIPS2_IO_ADDRESS(x): \ -+ (((x) >= ROMP_BASE_ADDR) && ((x) < (ROMP_BASE_ADDR + ROMP_SIZE))) ? ROMP_IO_ADDRESS(x): \ -+ (((x) >= ASIC_BASE_ADDR) && ((x) < (ASIC_BASE_ADDR + AVIC_SIZE))) ? ASIC_IO_ADDRESS(x): \ -+ (((x) >= IRAM_BASE_ADDR) && ((x) < (IRAM_BASE_ADDR + IRAM_SIZE))) ? IRAM_IO_ADDRESS(x): \ -+ (((x) >= X_MEMC_BASE_ADDR) && ((x) < (X_MEMC_BASE_ADDR + X_MEMC_SIZE))) ? X_MEMC_IO_ADDRESS(x): \ -+ (((x) >= NFC_BASE_ADDR) && ((x) < (NFC_BASE_ADDR + NFC_SIZE))) ? NFC_IO_ADDRESS(x): \ -+ 0) -+ -+#define MXC_VADDR_RANGE(v,n) \ -+ (((v)) >= n##_BASE_ADDR_VIRT) && \ -+ (((v)) < n##_BASE_ADDR_VIRT + n##_SIZE) ? \ -+ ((v)-n##_BASE_ADDR_VIRT + n##_BASE_ADDR) : -+ -+#define MXC_PHYS_ADDRESS(v) \ -+ UL(MXC_VADDR_RANGE(v,AIPS1) \ -+ MXC_VADDR_RANGE(v,AIPS2) \ -+ MXC_VADDR_RANGE(v,SPBA0) \ -+ MXC_VADDR_RANGE(v,ROMP) \ -+ MXC_VADDR_RANGE(v,ASIC) \ -+ MXC_VADDR_RANGE(v,IRAM) \ -+ MXC_VADDR_RANGE(v,X_MEMC) \ -+ MXC_VADDR_RANGE(v,NFC) \ -+ 0) -+ -+#define GPIO_BASE_ADDR(port) \ -+ ((port == 1 ? GPIO1_BASE_ADDR : \ -+ (port == 2 ? GPIO2_BASE_ADDR : \ -+ (port == 3 ? GPIO3_BASE_ADDR : \ -+ (port == 4 ? GPIO4_BASE_ADDR : 0))))) -+ -+/* -+ * define the address mapping macros: in physical address order -+ */ -+ -+#define AIPS1_IO_ADDRESS(x) \ -+ (((x) - AIPS1_BASE_ADDR) + AIPS1_BASE_ADDR_VIRT) -+ -+#define SPBA0_IO_ADDRESS(x) \ -+ (((x) - SPBA0_BASE_ADDR) + SPBA0_BASE_ADDR_VIRT) -+ -+#define AIPS2_IO_ADDRESS(x) \ -+ (((x) - AIPS2_BASE_ADDR) + AIPS2_BASE_ADDR_VIRT) -+ -+#define ROMP_IO_ADDRESS(x) \ -+ (((x) - ROMP_BASE_ADDR) + ROMP_BASE_ADDR_VIRT) -+ -+#define ASIC_IO_ADDRESS(x) \ -+ (((x) - ASIC_BASE_ADDR) + ASIC_BASE_ADDR_VIRT) -+ -+/* for entry-macro.S */ -+#define AVIC_IO_ADDRESS(x) ASIC_IO_ADDRESS(x) -+ -+#define IRAM_IO_ADDRESS(x) \ -+ (((x) - IRAM_BASE_ADDR) + IRAM_BASE_ADDR_VIRT) -+ -+#define X_MEMC_IO_ADDRESS(x) \ -+ (((x) - X_MEMC_BASE_ADDR) + X_MEMC_BASE_ADDR_VIRT) -+ -+#define NFC_IO_ADDRESS(x) \ -+ (((x) - NFC_BASE_ADDR) + NFC_BASE_ADDR_VIRT) -+ -+/* -+ * DMA request assignments -+ */ -+#define DMA_REQ_EXTREQ0 0 -+#define DMA_REQ_CCM 1 -+#define DMA_REQ_ATA_TX_END 2 -+#define DMA_REQ_ATA_TX 3 -+#define DMA_REQ_ATA_RX 4 -+#define DMA_REQ_CSPI2_RX 6 -+#define DMA_REQ_CSPI2_TX 7 -+#define DMA_REQ_CSPI1_RX 8 -+#define DMA_REQ_CSPI1_TX 9 -+#define DMA_REQ_UART3_RX 10 -+#define DMA_REQ_UART3_TX 11 -+#define DMA_REQ_UART4_RX 12 -+#define DMA_REQ_UART4_TX 13 -+#define DMA_REQ_EXTREQ1 14 -+#define DMA_REQ_EXTREQ2 15 -+#define DMA_REQ_UART2_RX 16 -+#define DMA_REQ_UART2_TX 17 -+#define DMA_REQ_UART1_RX 18 -+#define DMA_REQ_UART1_TX 19 -+#define DMA_REQ_SSI2_RX1 22 -+#define DMA_REQ_SSI2_TX1 23 -+#define DMA_REQ_SSI2_RX0 24 -+#define DMA_REQ_SSI2_TX0 25 -+#define DMA_REQ_SSI1_RX1 26 -+#define DMA_REQ_SSI1_TX1 27 -+#define DMA_REQ_SSI1_RX0 28 -+#define DMA_REQ_SSI1_TX0 29 -+#define DMA_REQ_NFC 30 -+#define DMA_REQ_ECT 31 -+#define DMA_REQ_ESAI_RX 32 -+#define DMA_REQ_ESAI_TX 33 -+#define DMA_REQ_CSPI3_RX 34 -+#define DMA_REQ_CSPI3_TX 35 -+#define DMA_REQ_SIM2_RX 36 -+#define DMA_REQ_SIM2_TX 37 -+#define DMA_REQ_SIM1_RX 38 -+#define DMA_REQ_SIM1_TX 39 -+#define DMA_REQ_TSC_GCQ 44 -+#define DMA_REQ_TSC_TCQ 45 -+#define DMA_REQ_UART5_RX 46 -+#define DMA_REQ_UART5_TX 47 -+ -+/* -+ * Interrupt numbers -+ */ -+#define MXC_INT_CSPI3 0 -+#define MXC_INT_GPT4 1 -+#define MXC_INT_OWIRE 2 -+#define MXC_INT_I2C 3 -+#define MXC_INT_I2C2 4 -+#define MXC_INT_UART4 5 -+#define MXC_INT_RTIC 6 -+#define MXC_INT_ESAI 7 -+#define MXC_INT_SDHC2 8 -+#define MXC_INT_SDHC1 9 -+#define MXC_INT_I2C3 10 -+#define MXC_INT_SSI2 11 -+#define MXC_INT_SSI1 12 -+#define MXC_INT_CSPI2 13 -+#define MXC_INT_CSPI1 14 -+#define MXC_INT_ATA 15 -+#define MXC_INT_GPIO3 16 -+#define MXC_INT_CSI 17 -+#define MXC_INT_UART3 18 -+#define MXC_INT_IIM 19 -+#define MXC_INT_SIM1 20 -+#define MXC_INT_SIM2 21 -+#define MXC_INT_RNGD 22 -+#define MXC_INT_GPIO4 23 -+#define MXC_INT_KPP 24 -+#define MXC_INT_DRYICE_RTC 25 -+#define MXC_INT_PWM 26 -+#define MXC_INT_EPIT2 27 -+#define MXC_INT_EPIT1 28 -+#define MXC_INT_GPT3 29 -+#define MXC_INT_POWER_FAIL 30 -+#define MXC_INT_CRM 31 -+#define MXC_INT_UART2 32 -+#define MXC_INT_NANDFC 33 -+#define MXC_INT_SDMA 34 -+#define MXC_INT_USB_HTG 35 -+#define MXC_INT_PWM2 36 -+#define MXC_INT_USB_OTG 37 -+#define MXC_INT_SLCDC 38 -+#define MXC_INT_LCDC 39 -+#define MXC_INT_UART5 40 -+#define MXC_INT_PWM3 41 -+#define MXC_INT_PWM4 42 -+#define MXC_INT_CAN1 43 -+#define MXC_INT_CAN2 44 -+#define MXC_INT_UART1 45 -+#define MXC_INT_TSC 46 -+#define MXC_INT_ECT 48 -+#define MXC_INT_SCC_SCM 49 -+#define MXC_INT_SCC_SMN 50 -+#define MXC_INT_GPIO2 51 -+#define MXC_INT_GPIO1 52 -+#define MXC_INT_GPT2 53 -+#define MXC_INT_GPT1 54 -+#define MXC_INT_WDOG 55 -+#define MXC_INT_DRYICE 56 -+#define MXC_INT_FEC 57 -+#define MXC_INT_EXT_INT5 58 -+#define MXC_INT_EXT_INT4 59 -+#define MXC_INT_EXT_INT3 60 -+#define MXC_INT_EXT_INT2 61 -+#define MXC_INT_EXT_INT1 62 -+#define MXC_INT_EXT_INT0 63 -+ -+#define MXC_INT_GPT MXC_INT_GPT1 -+ -+/* silicon revisions specific to i.MX25 */ -+#define CHIP_REV_1_0 0x00 -+#define CHIP_REV_1_1 0x01 -+ -+/* gpio and gpio based interrupt handling */ -+#define GPIO_DR 0x00 -+#define GPIO_GDIR 0x04 -+#define GPIO_PSR 0x08 -+#define GPIO_ICR1 0x0C -+#define GPIO_ICR2 0x10 -+#define GPIO_IMR 0x14 -+#define GPIO_ISR 0x18 -+#define GPIO_INT_LOW_LEV 0x0 -+#define GPIO_INT_HIGH_LEV 0x1 -+#define GPIO_INT_RISE_EDGE 0x2 -+#define GPIO_INT_FALL_EDGE 0x3 -+#define GPIO_INT_NONE 0x4 -+ -+/* Mandatory defines used globally */ -+ -+/* this CPU supports up to 96 GPIOs */ -+#define ARCH_NR_GPIOS 128 -+ -+#define MXC_TIMER_GPT1 1 -+#define MXC_TIMER_GPT2 2 -+#define MXC_TIMER_GPT3 3 -+#define MXC_TIMER_GPT4 4 -+ -+/*! -+ * NFMS bit in RCSR register for pagesize of nandflash -+ */ -+#define NFMS_REG IO_ADDRESS(CCM_BASE_ADDR + 0x28) -+#define NFMS_NF_DWIDTH 14 -+#define NFMS_NF_PG_SZ 8 -+ -+#if !defined(__ASSEMBLY__) && !defined(__MXC_BOOT_UNCOMPRESS) -+#include -+ -+extern int mx25_revision(void); -+ -+#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 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 - * and returning the virtual address. If the physical address is not mapped, -- * it returns 0xDEADBEEF -+ * it returns 0 - */ - #define IO_ADDRESS(x) \ - (void __force __iomem *) \ -@@ -88,7 +88,7 @@ - ((x >= SAHB1_BASE_ADDR) && (x < (SAHB1_BASE_ADDR + SAHB1_SIZE))) ? \ - SAHB1_IO_ADDRESS(x) : \ - ((x >= X_MEMC_BASE_ADDR) && (x < (X_MEMC_BASE_ADDR + X_MEMC_SIZE))) ? \ -- X_MEMC_IO_ADDRESS(x) : 0xDEADBEEF) -+ X_MEMC_IO_ADDRESS(x) : 0) - - /* 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 18:02:12.000000000 +0200 -@@ -27,6 +27,7 @@ - #define MXC_CPU_MX1 1 - #define MXC_CPU_MX21 21 - #define MXC_CPU_MX27 27 -+#define MXC_CPU_MX25 25 - #define MXC_CPU_MX31 31 - #define MXC_CPU_MX35 35 - -@@ -70,6 +71,18 @@ extern unsigned int __mxc_cpu_type; - # define cpu_is_mx27() (0) - #endif - -+#ifdef CONFIG_MACH_MX25 -+# ifdef mxc_cpu_type -+# undef mxc_cpu_type -+# define mxc_cpu_type __mxc_cpu_type -+# else -+# define mxc_cpu_type MXC_CPU_MX25 -+# endif -+# define cpu_is_mx25() (mxc_cpu_type == MXC_CPU_MX25) -+#else -+# define cpu_is_mx25() (0) -+#endif -+ - #ifdef CONFIG_ARCH_MX31 - # ifdef mxc_cpu_type - # undef mxc_cpu_type -@@ -101,6 +114,6 @@ extern unsigned int __mxc_cpu_type; - #endif - - #define cpu_is_mx3() (cpu_is_mx31() || cpu_is_mx35()) --#define cpu_is_mx2() (cpu_is_mx21() || cpu_is_mx27()) -+#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 18:02:13.000000000 +0200 -@@ -0,0 +1,504 @@ -+ -+/* -+ * Copyright 2004-2008 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_SDMA_H__ -+#define __ASM_ARCH_MXC_SDMA_H__ -+ -+/*! -+ * @defgroup SDMA Smart Direct Memory Access (SDMA) Driver -+ */ -+ -+/*! -+ * @file arch-mxc/sdma.h -+ * -+ * @brief This file contains the SDMA API declarations. -+ * -+ * SDMA is responsible on moving data between peripherals and memories (MCU, EMI and DSP). -+ * -+ * @ingroup SDMA -+ */ -+ -+#include -+#include -+#include -+#include -+ -+/*! -+ * This defines maximum DMA address -+ */ -+#define MAX_DMA_ADDRESS 0xffffffff -+ -+/*! -+ * This defines maximum number of DMA channels -+ */ -+#ifdef CONFIG_MXC_SDMA_API -+#define MAX_DMA_CHANNELS 32 -+#define MAX_BD_NUMBER 16 -+#define MXC_SDMA_DEFAULT_PRIORITY 1 -+#define MXC_SDMA_MIN_PRIORITY 1 -+#define MXC_SDMA_MAX_PRIORITY 7 -+#else -+#define MAX_DMA_CHANNELS 0 -+#endif -+ -+#define MXC_FIFO_MEM_DEST_FIXED 0x1 -+#define MXC_FIFO_MEM_SRC_FIXED 0x2 -+/*! -+ * This enumerates transfer types -+ */ -+typedef enum { -+ emi_2_per = 0, /*!< EMI memory to peripheral */ -+ emi_2_int, /*!< EMI memory to internal RAM */ -+ emi_2_emi, /*!< EMI memory to EMI memory */ -+ emi_2_dsp, /*!< EMI memory to DSP memory */ -+ per_2_int, /*!< Peripheral to internal RAM */ -+ per_2_emi, /*!< Peripheral to internal EMI memory */ -+ per_2_dsp, /*!< Peripheral to DSP memory */ -+ per_2_per, /*!< Peripheral to Peripheral */ -+ int_2_per, /*!< Internal RAM to peripheral */ -+ int_2_int, /*!< Internal RAM to Internal RAM */ -+ int_2_emi, /*!< Internal RAM to EMI memory */ -+ int_2_dsp, /*!< Internal RAM to DSP memory */ -+ dsp_2_per, /*!< DSP memory to peripheral */ -+ dsp_2_int, /*!< DSP memory to internal RAM */ -+ dsp_2_emi, /*!< DSP memory to EMI memory */ -+ dsp_2_dsp, /*!< DSP memory to DSP memory */ -+ emi_2_dsp_loop, /*!< EMI memory to DSP memory loopback */ -+ dsp_2_emi_loop, /*!< DSP memory to EMI memory loopback */ -+ dvfs_pll, /*!< DVFS script with PLL change */ -+ dvfs_pdr /*!< DVFS script without PLL change */ -+} sdma_transferT; -+ -+/*! -+ * This enumerates peripheral types -+ */ -+typedef enum { -+ SSI, /*!< MCU domain SSI */ -+ SSI_SP, /*!< Shared SSI */ -+ MMC, /*!< MMC */ -+ SDHC, /*!< SDHC */ -+ UART, /*!< MCU domain UART */ -+ UART_SP, /*!< Shared UART */ -+ FIRI, /*!< FIRI */ -+ CSPI, /*!< MCU domain CSPI */ -+ CSPI_SP, /*!< Shared CSPI */ -+ SIM, /*!< SIM */ -+ ATA, /*!< ATA */ -+ CCM, /*!< CCM */ -+ EXT, /*!< External peripheral */ -+ MSHC, /*!< Memory Stick Host Controller */ -+ MSHC_SP, /*!< Shared Memory Stick Host Controller */ -+ DSP, /*!< DSP */ -+ MEMORY, /*!< Memory */ -+ FIFO_MEMORY, /*!< FIFO type Memory */ -+ SPDIF, /*!< SPDIF */ -+ IPU_MEMORY, /*!< IPU Memory */ -+ ASRC, /*!< ASRC */ -+ ESAI, /*!< ESAI */ -+} sdma_periphT; -+ -+#ifndef TRANSFER_32BIT -+/*! -+ * This defines SDMA access data size -+ */ -+#define TRANSFER_32BIT 0x00 -+#define TRANSFER_8BIT 0x01 -+#define TRANSFER_16BIT 0x02 -+#define TRANSFER_24BIT 0x03 -+ -+#endif -+ -+/*! -+ * This defines maximum device name length passed during mxc_request_dma(). -+ */ -+#define MAX_DEVNAME_LENGTH 32 -+ -+/*! -+ * This defines SDMA interrupt callback function prototype. -+ */ -+typedef void (*dma_callback_t) (void *arg); -+ -+/*! -+ * Structure containing sdma channel parameters. -+ */ -+typedef struct { -+ __u32 watermark_level; /*!< Lower/upper threshold that -+ * triggers SDMA event -+ */ -+ __u32 per_address; /*!< Peripheral source/destination -+ * physical address -+ */ -+ sdma_periphT peripheral_type; /*!< Peripheral type */ -+ sdma_transferT transfer_type; /*!< Transfer type */ -+ int event_id; /*!< Event number, -+ * needed by all channels -+ * that started by peripherals dma -+ * request (per_2_*,*_2_per) -+ * Not used for memory and DSP -+ * transfers. -+ */ -+ int event_id2; /*!< Second event number, -+ * used in ATA scripts only. -+ */ -+ int bd_number; /*!< Buffer descriptors number. -+ * If not set, single buffer -+ * descriptor will be used. -+ */ -+ dma_callback_t callback; /*! callback function */ -+ void *arg; /*! callback argument */ -+ unsigned long word_size:8; /*!< SDMA data access word size */ -+} dma_channel_params; -+ -+/*! -+ * Structure containing sdma request parameters. -+ */ -+typedef struct { -+ /*! physical source memory address */ -+ __u8 *sourceAddr; -+ /*! physical destination memory address */ -+ __u8 *destAddr; -+ /*! amount of data to transfer, -+ * updated during mxc_dma_get_config -+ */ -+ __u16 count; -+ /*!< DONE bit of the buffer descriptor, -+ * updated during mxc_dma_get_config -+ * 0 - means the BD is done and closed by SDMA -+ * 1 - means the BD is still being processed by SDMA -+ */ -+ int bd_done; -+ /*!< CONT bit of the buffer descriptor, -+ * set it if full multi-buffer descriptor mechanism -+ * required. -+ */ -+ int bd_cont; -+ /*!< ERROR bit of the buffer descriptor, -+ * updated during mxc_dma_get_config. -+ * If it is set - there was an error during BD processing. -+ */ -+ int bd_error; -+} dma_request_t; -+ -+/*! -+ * Structure containing sdma request parameters. -+ */ -+typedef struct { -+ /*! address of ap_2_ap script */ -+ int mxc_sdma_ap_2_ap_addr; -+ /*! address of ap_2_bp script */ -+ int mxc_sdma_ap_2_bp_addr; -+ /*! address of ap_2_ap_fixed script */ -+ int mxc_sdma_ap_2_ap_fixed_addr; -+ /*! address of bp_2_ap script */ -+ int mxc_sdma_bp_2_ap_addr; -+ /*! address of loopback_on_dsp_side script */ -+ int mxc_sdma_loopback_on_dsp_side_addr; -+ /*! address of mcu_interrupt_only script */ -+ int mxc_sdma_mcu_interrupt_only_addr; -+ -+ /*! address of firi_2_per script */ -+ int mxc_sdma_firi_2_per_addr; -+ /*! address of firi_2_mcu script */ -+ int mxc_sdma_firi_2_mcu_addr; -+ /*! address of per_2_firi script */ -+ int mxc_sdma_per_2_firi_addr; -+ /*! address of mcu_2_firi script */ -+ int mxc_sdma_mcu_2_firi_addr; -+ -+ /*! address of uart_2_per script */ -+ int mxc_sdma_uart_2_per_addr; -+ /*! address of uart_2_mcu script */ -+ int mxc_sdma_uart_2_mcu_addr; -+ /*! address of per_2_app script */ -+ int mxc_sdma_per_2_app_addr; -+ /*! address of mcu_2_app script */ -+ int mxc_sdma_mcu_2_app_addr; -+ /*! address of per_2_per script */ -+ int mxc_sdma_per_2_per_addr; -+ -+ /*! address of uartsh_2_per script */ -+ int mxc_sdma_uartsh_2_per_addr; -+ /*! address of uartsh_2_mcu script */ -+ int mxc_sdma_uartsh_2_mcu_addr; -+ /*! address of per_2_shp script */ -+ int mxc_sdma_per_2_shp_addr; -+ /*! address of mcu_2_shp script */ -+ int mxc_sdma_mcu_2_shp_addr; -+ -+ /*! address of ata_2_mcu script */ -+ int mxc_sdma_ata_2_mcu_addr; -+ /*! address of mcu_2_ata script */ -+ int mxc_sdma_mcu_2_ata_addr; -+ -+ /*! address of app_2_per script */ -+ int mxc_sdma_app_2_per_addr; -+ /*! address of app_2_mcu script */ -+ int mxc_sdma_app_2_mcu_addr; -+ /*! address of shp_2_per script */ -+ int mxc_sdma_shp_2_per_addr; -+ /*! address of shp_2_mcu script */ -+ int mxc_sdma_shp_2_mcu_addr; -+ -+ /*! address of mshc_2_mcu script */ -+ int mxc_sdma_mshc_2_mcu_addr; -+ /*! address of mcu_2_mshc script */ -+ int mxc_sdma_mcu_2_mshc_addr; -+ -+ /*! address of spdif_2_mcu script */ -+ int mxc_sdma_spdif_2_mcu_addr; -+ /*! address of mcu_2_spdif script */ -+ int mxc_sdma_mcu_2_spdif_addr; -+ -+ /*! address of asrc_2_mcu script */ -+ int mxc_sdma_asrc_2_mcu_addr; -+ -+ /*! address of ext_mem_2_ipu script */ -+ int mxc_sdma_ext_mem_2_ipu_addr; -+ -+ /*! address of descrambler script */ -+ int mxc_sdma_descrambler_addr; -+ -+ /*! address of dptc_dvfs script */ -+ int mxc_sdma_dptc_dvfs_addr; -+ -+ int mxc_sdma_utra_addr; -+ -+ /*! address where ram code starts */ -+ int mxc_sdma_ram_code_start_addr; -+ /*! size of the ram code */ -+ int mxc_sdma_ram_code_size; -+ /*! RAM image address */ -+ unsigned short *mxc_sdma_start_addr; -+} sdma_script_start_addrs; -+ -+/*! Structure to store the initialized dma_channel parameters */ -+typedef struct mxc_sdma_channel_params { -+ /*! Channel params */ -+ dma_channel_params chnl_params; -+ /*! Channel type (static channel number or dynamic channel) */ -+ unsigned int channel_num; -+ /*! Channel priority [0x1(lowest) - 0x7(highest)] */ -+ unsigned int chnl_priority; -+} mxc_sdma_channel_params_t; -+ -+/*! Private SDMA data structure */ -+typedef struct mxc_dma_channel_private { -+ /*! ID of the buffer that was processed */ -+ unsigned int buf_tail; -+ /*! Tasklet for the channel */ -+ struct tasklet_struct chnl_tasklet; -+ /*! Flag indicates if interrupt is required after every BD transfer */ -+ int intr_after_every_bd; -+} mxc_dma_channel_private_t; -+ -+/*! -+ * Setup channel according to parameters. -+ * Must be called once after mxc_request_dma() -+ * -+ * @param channel channel number -+ * @param p channel parameters pointer -+ * @return 0 on success, error code on fail -+ */ -+int mxc_dma_setup_channel(int channel, dma_channel_params * p); -+ -+/*! -+ * Setup the channel priority. This can be used to change the default priority -+ * for the channel. -+ * -+ * @param channel channel number -+ * @param priority priority to be set for the channel -+ * -+ * @return 0 on success, error code on failure -+ */ -+int mxc_dma_set_channel_priority(unsigned int channel, unsigned int priority); -+ -+/*! -+ * Allocates dma channel. -+ * If channel's value is 0, then the function allocates a free channel -+ * dynamically and sets its value to channel. -+ * Else allocates requested channel if it is free. -+ * If the channel is busy or no free channels (in dynamic allocation) -EBUSY returned. -+ * -+ * @param channel pointer to channel number -+ * @param devicename device name -+ * @return 0 on success, error code on fail -+ */ -+int mxc_request_dma(int *channel, const char *devicename); -+ -+/*! -+ * Configures request parameters. Can be called multiple times after -+ * mxc_request_dma() and mxc_dma_setup_channel(). -+ * -+ * -+ * @param channel channel number -+ * @param p request parameters pointer -+ * @param bd_index index of buffer descriptor to set -+ * @return 0 on success, error code on fail -+ */ -+/* int mxc_dma_set_config(int channel, dma_request_t *p, int bd_index); */ -+int mxc_dma_set_config(int channel, dma_request_t * p, int bd_index); -+ -+/*! -+ * Returns request parameters. -+ * -+ * @param channel channel number -+ * @param p request parameters pointer -+ * @param bd_index index of buffer descriptor to get -+ * @return 0 on success, error code on fail -+ */ -+/* int mxc_dma_get_config(int channel, dma_request_t *p, int bd_index); */ -+int mxc_dma_get_config(int channel, dma_request_t * p, int bd_index); -+ -+/*! -+ * This function is used by MXC IPC's write_ex2. It passes the a pointer to the -+ * data control structure to iapi_write_ipcv2() -+ * -+ * @param channel SDMA channel number -+ * @param ctrl_ptr Data Control structure pointer -+ */ -+int mxc_sdma_write_ipcv2(int channel, void *ctrl_ptr); -+ -+/*! -+ * This function is used by MXC IPC's read_ex2. It passes the a pointer to the -+ * data control structure to iapi_read_ipcv2() -+ * -+ * @param channel SDMA channel number -+ * @param ctrl_ptr Data Control structure pointer -+ */ -+int mxc_sdma_read_ipcv2(int channel, void *ctrl_ptr); -+ -+/*! -+ * Starts dma channel. -+ * -+ * @param channel channel number -+ */ -+int mxc_dma_start(int channel); -+ -+/*! -+ * Stops dma channel. -+ * -+ * @param channel channel number -+ */ -+int mxc_dma_stop(int channel); -+ -+/*! -+ * Frees dma channel. -+ * -+ * @param channel channel number -+ */ -+void mxc_free_dma(int channel); -+ -+/*! -+ * Sets callback function. Used with standard dma api -+ * for supporting interrupts -+ * -+ * @param channel channel number -+ * @param callback callback function pointer -+ * @param arg argument for callback function -+ */ -+void mxc_dma_set_callback(int channel, dma_callback_t callback, void *arg); -+ -+/*! -+ * Allocates uncachable buffer. Uses hash table. -+ * -+ * @param size size of allocated buffer -+ * @return pointer to buffer -+ */ -+void *sdma_malloc(size_t size); -+ -+#ifdef CONFIG_SDMA_IRAM -+/*! -+ * Allocates uncachable buffer from IRAM.. -+ * -+ * @param size size of allocated buffer -+ * @return pointer to buffer -+ */ -+void *sdma_iram_malloc(size_t size); -+#endif /*CONFIG_SDMA_IRAM */ -+ -+/*! -+ * Frees uncachable buffer. Uses hash table. -+ */ -+void sdma_free(void *buf); -+ -+/*! -+ * Converts virtual to physical address. Uses hash table. -+ * -+ * @param buf virtual address pointer -+ * @return physical address value -+ */ -+unsigned long sdma_virt_to_phys(void *buf); -+ -+/*! -+ * Converts physical to virtual address. Uses hash table. -+ * -+ * @param buf physical address value -+ * @return virtual address pointer -+ */ -+void *sdma_phys_to_virt(unsigned long buf); -+ -+/*! -+ * Configures the BD_INTR bit on a buffer descriptor parameters. -+ * -+ * -+ * @param channel channel number -+ * @param bd_index index of buffer descriptor to set -+ * @param bd_intr flag to set or clear the BD_INTR bit -+ */ -+void mxc_dma_set_bd_intr(int channel, int bd_index, int bd_intr); -+ -+/*! -+ * Gets the BD_INTR bit on a buffer descriptor. -+ * -+ * -+ * @param channel channel number -+ * @param bd_index index of buffer descriptor to set -+ * -+ * @return returns the BD_INTR bit status -+ */ -+int mxc_dma_get_bd_intr(int channel, int bd_index); -+ -+/*! -+ * Stop the current transfer -+ * -+ * @param channel channel number -+ * @param buffer_number number of buffers (beginning with 0), -+ * whose done bits should be reset to 0 -+ */ -+int mxc_dma_reset(int channel, int buffer_number); -+ -+/*! -+ * This functions Returns the SDMA paramaters associated for a module -+ * -+ * @param channel_id the ID of the module requesting DMA -+ * @return returns the sdma parameters structure for the device -+ */ -+mxc_sdma_channel_params_t *mxc_sdma_get_channel_params(mxc_dma_device_t -+ channel_id); -+ -+/*! -+ * This functions marks the SDMA channels that are statically allocated -+ * -+ * @param chnl the channel array used to store channel information -+ */ -+void mxc_get_static_channels(mxc_dma_channel_t * chnl); -+ -+/*! -+ * Initializes SDMA driver -+ */ -+int __init sdma_init(void); -+ -+#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 18:02:13.000000000 +0200 -@@ -0,0 +1,66 @@ -+ -+/* -+ * Copyright 2004-2008 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 -+ */ -+ -+/*! -+ * @defgroup SPBA Shared Peripheral Bus Arbiter (SPBA) -+ * @ingroup MSL_MX31 MSL_MX35 MSL_MX37 MSL_MX51 MSL_MXC91321 -+ */ -+ -+/*! -+ * @file arch-mxc/spba.h -+ * @brief This file contains the Shared Peripheral Bus Arbiter (spba) API. -+ * -+ * @ingroup SPBA -+ */ -+ -+#ifndef __ASM_ARCH_MXC_SPBA_H__ -+#define __ASM_ARCH_MXC_SPBA_H__ -+ -+#ifdef __KERNEL__ -+ -+#define MXC_SPBA_RAR_MASK 0x7 -+ -+/*! -+ * Defines three SPBA masters: A - ARM, C - SDMA (no master B for MX31) -+ */ -+enum spba_masters { -+ SPBA_MASTER_A = 1, -+ SPBA_MASTER_B = 2, -+ SPBA_MASTER_C = 4, -+}; -+ -+/*! -+ * This function allows the three masters (A, B, C) to take ownership of a -+ * shared peripheral. -+ * -+ * @param mod specified module as defined in \b enum \b #spba_module -+ * @param master one of more (or-ed together) masters as defined in \b enum \b #spba_masters -+ * -+ * @return 0 if successful; -1 otherwise. -+ */ -+int spba_take_ownership(int mod, int master); -+ -+/*! -+ * This function releases the ownership for a shared peripheral. -+ * -+ * @param mod specified module as defined in \b enum \b #spba_module -+ * @param master one of more (or-ed together) masters as defined in \b enum \b #spba_masters -+ * -+ * @return 0 if successful; -1 otherwise. -+ */ -+int spba_rel_ownership(int mod, int master); -+ -+#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 18:02:12.000000000 +0200 -@@ -23,7 +23,11 @@ - #if defined CONFIG_ARCH_MX1 - #define CLOCK_TICK_RATE 16000000 - #elif defined CONFIG_ARCH_MX2 -+#ifndef CONFIG_MACH_MX25 - #define CLOCK_TICK_RATE 13300000 -+#else -+#define CLOCK_TICK_RATE 12000000 -+#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 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)); - - if (pin < 16) { -+#ifndef CONFIG_MACH_MX25 - tmp = __raw_readl(VA_GPIO_BASE + MXC_OCR1(port)); - tmp &= ~(3 << (pin * 2)); - tmp |= (ocr << (pin * 2)); - __raw_writel(tmp, VA_GPIO_BASE + MXC_OCR1(port)); -- -+#endif - tmp = __raw_readl(VA_GPIO_BASE + MXC_ICONFA1(port)); - tmp &= ~(3 << (pin * 2)); - tmp |= ((gpio_mode >> GPIO_AOUT_SHIFT) & 3) << (pin * 2); -@@ -90,12 +91,12 @@ void mxc_gpio_mode(int gpio_mode) - __raw_writel(tmp, VA_GPIO_BASE + MXC_ICONFB1(port)); - } else { - pin -= 16; -- -+#ifndef CONFIG_MACH_MX25 - tmp = __raw_readl(VA_GPIO_BASE + MXC_OCR2(port)); - tmp &= ~(3 << (pin * 2)); - tmp |= (ocr << (pin * 2)); - __raw_writel(tmp, VA_GPIO_BASE + MXC_OCR2(port)); -- -+#endif - 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 18:02:02.000000000 +0200 -@@ -31,7 +31,24 @@ - - #define IOMUX_BASE IO_ADDRESS(IOMUXC_BASE_ADDR) - --static unsigned long iomux_v3_pad_alloc_map[0x200 / BITS_PER_LONG]; -+#ifdef CONFIG_MACH_MX25 -+#define NUM_PADS 0x228 -+#else -+#define NUM_PADS 0x200 -+#endif -+ -+static unsigned long iomux_v3_pad_alloc_map[NUM_PADS / BITS_PER_LONG]; -+ -+static inline int mxc_iomux_v3_pad_offset(struct pad_desc *pad) -+{ -+ int pad_ofs; -+ if (cpu_is_mx25()) -+ pad_ofs = pad->mux_ctrl_ofs; -+ else -+ pad_ofs = pad->pad_ctrl_ofs; -+ BUG_ON((pad_ofs >> 7) >= ARRAY_SIZE(iomux_v3_pad_alloc_map)); -+ return pad_ofs; -+} - - /* - * setups a single pin: -@@ -40,7 +57,7 @@ static unsigned long iomux_v3_pad_alloc_ - */ - int mxc_iomux_v3_setup_pad(struct pad_desc *pad) - { -- unsigned int pad_ofs = pad->pad_ctrl_ofs; -+ unsigned int pad_ofs = mxc_iomux_v3_pad_offset(pad); - - if (test_and_set_bit(pad_ofs >> 2, iomux_v3_pad_alloc_map)) - return -EBUSY; -@@ -65,8 +82,10 @@ int mxc_iomux_v3_setup_multiple_pads(str - - for (i = 0; i < count; i++) { - ret = mxc_iomux_v3_setup_pad(p); -- if (ret) -+ if (ret) { -+ printk(KERN_ERR "Failed to setup PAD[%d]: %d\n", i, ret); - goto setup_error; -+ } - p++; - } - return 0; -@@ -79,7 +98,7 @@ EXPORT_SYMBOL(mxc_iomux_v3_setup_multipl - - void mxc_iomux_v3_release_pad(struct pad_desc *pad) - { -- unsigned int pad_ofs = pad->pad_ctrl_ofs; -+ unsigned int pad_ofs = mxc_iomux_v3_pad_offset(pad); - - 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 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; - -- if (cpu_is_mx27() || cpu_is_mx3()) { -+ if (cpu_is_mx27() || cpu_is_mx3() || cpu_is_mx25()) { - 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 18:02:03.000000000 +0200 -@@ -0,0 +1,143 @@ -+/* -+ * Copyright 2004-2008 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 -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+/*! -+ * @file plat-mxc/spba.c -+ * -+ * @brief This file contains the SPBA API implementation details. -+ * -+ * @ingroup SPBA -+ */ -+ -+static DEFINE_SPINLOCK(spba_lock); -+ -+#define SPBA_MASTER_MIN 1 -+#define SPBA_MASTER_MAX 7 -+ -+/*! -+ * the base addresses for the SPBA modules -+ */ -+static unsigned long spba_base = (unsigned long)IO_ADDRESS(SPBA_CTRL_BASE_ADDR); -+ -+/*! -+ * SPBA clock -+ */ -+static struct clk *spba_clk; -+/*! -+ * This function allows the three masters (A, B, C) to take ownership of a -+ * shared peripheral. -+ * -+ * @param mod specified module as defined in \b enum \b #spba_module -+ * @param master one of more (or-ed together) masters as defined in \b enum \b #spba_masters -+ * -+ * @return 0 if successful; a negative errno value otherwise. -+ */ -+int spba_take_ownership(int mod, int master) -+{ -+ unsigned long spba_flags; -+ int rtn_val = -EIO; -+ -+ if (master < SPBA_MASTER_MIN || master > SPBA_MASTER_MAX) { -+ printk("%s() invalid master %d\n", __FUNCTION__, master); -+ return -EINVAL; -+ } -+ -+ if (spba_clk == NULL) { -+ spba_clk = clk_get(NULL, "spba"); -+ if (IS_ERR(spba_clk)) { -+ int ret = PTR_ERR(spba_clk); -+ -+ spba_clk = NULL; -+ return ret; -+ } -+ } -+ clk_enable(spba_clk); -+ -+ spin_lock_irqsave(&spba_lock, spba_flags); -+ __raw_writel(master, spba_base + mod); -+ -+ if ((__raw_readl(spba_base + mod) & MXC_SPBA_RAR_MASK) == master) { -+ rtn_val = 0; -+ } -+ -+ spin_unlock_irqrestore(&spba_lock, spba_flags); -+ -+ clk_disable(spba_clk); -+ return rtn_val; -+} -+ -+/*! -+ * This function releases the ownership for a shared peripheral. -+ * -+ * @param mod specified module as defined in \b enum \b #spba_module -+ * @param master one of more (or-ed together) masters as defined in \b enum \b #spba_masters -+ * -+ * @return 0 if successful; a negativ errno value otherwise. -+ */ -+int spba_rel_ownership(int mod, int master) -+{ -+ unsigned long spba_flags; -+ volatile unsigned long rar; -+ -+ if (master < SPBA_MASTER_MIN || master > SPBA_MASTER_MAX) { -+ printk("%s() invalid master %d\n", __FUNCTION__, master); -+ return -EINVAL; -+ } -+ -+ if (spba_clk == NULL) { -+ spba_clk = clk_get(NULL, "spba"); -+ if (IS_ERR(spba_clk)) { -+ int ret = PTR_ERR(spba_clk); -+ spba_clk = NULL; -+ return ret; -+ } -+ } -+ clk_enable(spba_clk); -+ -+ if ((__raw_readl(spba_base + mod) & master) == 0) { -+ clk_disable(spba_clk); -+ return -EBUSY; /* does not own it */ -+ } -+ -+ spin_lock_irqsave(&spba_lock, spba_flags); -+ -+ /* Since only the last 3 bits are writeable, doesn't need to mask off -+ bits 31-3 */ -+ rar = __raw_readl(spba_base + mod) & (~master); -+ __raw_writel(rar, spba_base + mod); -+ -+ if ((__raw_readl(spba_base + mod) & master) != 0) { -+ spin_unlock_irqrestore(&spba_lock, spba_flags); -+ clk_disable(spba_clk); -+ return -EIO; -+ } -+ spin_unlock_irqrestore(&spba_lock, spba_flags); -+ -+ clk_disable(spba_clk); -+ return 0; -+} -+ -+EXPORT_SYMBOL(spba_take_ownership); -+EXPORT_SYMBOL(spba_rel_ownership); -+ -+MODULE_AUTHOR("Freescale Semiconductor, Inc."); -+MODULE_DESCRIPTION("SPBA"); -+MODULE_LICENSE("GPL"); -diff -urNp linux-2.6.30-rc4/arch/arm/plat-mxc/system.c linux-2.6.30-rc4-karo/arch/arm/plat-mxc/system.c ---- linux-2.6.30-rc4/arch/arm/plat-mxc/system.c 2009-05-13 09:46:19.000000000 +0200 -+++ linux-2.6.30-rc4-karo/arch/arm/plat-mxc/system.c 2009-06-08 12:48:23.000000000 +0200 -@@ -21,6 +21,7 @@ - */ - - #include -+#include - #include - #include - #include -@@ -38,18 +39,15 @@ - #define WDOG_WCR_ENABLE (1 << 2) - #endif - -+static struct clk *mxc_wdt_clk; -+ - /* - * Reset the system. It is called by machine_restart(). - */ - 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); -- } -+ if (mxc_wdt_clk) -+ clk_enable(mxc_wdt_clk); - - /* Assert SRS signal */ - __raw_writew(WDOG_WCR_ENABLE, WDOG_WCR_REG); -@@ -65,3 +63,20 @@ 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) -+{ -+ if (cpu_is_mx1()) -+ return 0; -+ -+ mxc_wdt_clk = clk_get_sys("imx-wdt.0", NULL); -+ if (IS_ERR(mxc_wdt_clk)) { -+ int ret = PTR_ERR(mxc_wdt_clk); -+ -+ printk(KERN_ERR "%s: Failed to get imx-wdt.0 clk: %d\n", __FUNCTION__, ret); -+ mxc_wdt_clk = NULL; -+ return ret; -+ } -+ return 0; -+} -+arch_initcall(mxc_wdt_init); -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 18:02:02.000000000 +0200 -@@ -66,7 +66,7 @@ static inline void gpt_irq_disable(void) - { - unsigned int tmp; - -- if (cpu_is_mx3()) -+ if (cpu_is_mx3() || cpu_is_mx25()) - __raw_writel(0, timer_base + MX3_IR); - else { - tmp = __raw_readl(timer_base + MXC_TCTL); -@@ -76,7 +76,7 @@ static inline void gpt_irq_disable(void) - - static inline void gpt_irq_enable(void) - { -- if (cpu_is_mx3()) -+ if (cpu_is_mx3() || cpu_is_mx25()) - __raw_writel(1<<0, timer_base + MX3_IR); - else { - __raw_writel(__raw_readl(timer_base + MXC_TCTL) | MX1_2_TCTL_IRQEN, -@@ -88,9 +88,9 @@ static void gpt_irq_acknowledge(void) - { - if (cpu_is_mx1()) - __raw_writel(0, timer_base + MX1_2_TSTAT); -- if (cpu_is_mx2()) -+ if (cpu_is_mx2() && !cpu_is_mx25()) - __raw_writel(MX2_TSTAT_CAPT | MX2_TSTAT_COMP, timer_base + MX1_2_TSTAT); -- if (cpu_is_mx3()) -+ if (cpu_is_mx3() || cpu_is_mx25()) - __raw_writel(MX3_TSTAT_OF1, timer_base + MX3_TSTAT); - } - -@@ -117,7 +117,7 @@ static int __init mxc_clocksource_init(s - { - unsigned int c = clk_get_rate(timer_clk); - -- if (cpu_is_mx3()) -+ if (cpu_is_mx3() || cpu_is_mx25()) - clocksource_mxc.read = mx3_get_cycles; - - clocksource_mxc.mult = clocksource_hz2mult(c, -@@ -180,7 +180,7 @@ static void mxc_set_mode(enum clock_even - - if (mode != clockevent_mode) { - /* Set event time into far-far future */ -- if (cpu_is_mx3()) -+ if (cpu_is_mx3() || cpu_is_mx25()) - __raw_writel(__raw_readl(timer_base + MX3_TCN) - 3, - timer_base + MX3_TCMP); - else -@@ -233,7 +233,7 @@ static irqreturn_t mxc_timer_interrupt(i - struct clock_event_device *evt = &clockevent_mxc; - uint32_t tstat; - -- if (cpu_is_mx3()) -+ if (cpu_is_mx3() || cpu_is_mx25()) - tstat = __raw_readl(timer_base + MX3_TSTAT); - else - tstat = __raw_readl(timer_base + MX1_2_TSTAT); -@@ -264,7 +264,7 @@ static int __init mxc_clockevent_init(st - { - unsigned int c = clk_get_rate(timer_clk); - -- if (cpu_is_mx3()) -+ if (cpu_is_mx3() || cpu_is_mx25()) - 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 - __raw_writel(0, timer_base + MXC_TCTL); - __raw_writel(0, timer_base + MXC_TPRER); /* see datasheet note */ - -- if (cpu_is_mx3()) -+ if (cpu_is_mx3() || cpu_is_mx25()) - 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 18:02:54.000000000 +0200 -@@ -12,7 +12,7 @@ - # - # http://www.arm.linux.org.uk/developer/machines/?action=new - # --# Last update: Mon Mar 23 20:09:01 2009 -+# Last update: Mon Apr 20 10:31:38 2009 - # - # machine_is_xxx CONFIG_xxxx MACH_TYPE_xxx number - # -@@ -1721,7 +1721,7 @@ sapphire MACH_SAPPHIRE SAPPHIRE 1729 - csb637xo MACH_CSB637XO CSB637XO 1730 - evisiong MACH_EVISIONG EVISIONG 1731 - stmp37xx MACH_STMP37XX STMP37XX 1732 --stmp378x MACH_STMP38XX STMP38XX 1733 -+stmp378x MACH_STMP378X STMP378X 1733 - tnt MACH_TNT TNT 1734 - tbxt MACH_TBXT TBXT 1735 - playmate MACH_PLAYMATE PLAYMATE 1736 -@@ -2132,3 +2132,41 @@ apollo MACH_APOLLO APOLLO 2141 - at91cap9stk MACH_AT91CAP9STK AT91CAP9STK 2142 - spc300 MACH_SPC300 SPC300 2143 - eko MACH_EKO EKO 2144 -+ccw9m2443 MACH_CCW9M2443 CCW9M2443 2145 -+ccw9m2443js MACH_CCW9M2443JS CCW9M2443JS 2146 -+m2m_router_device MACH_M2M_ROUTER_DEVICE M2M_ROUTER_DEVICE 2147 -+str9104nas MACH_STAR9104NAS STAR9104NAS 2148 -+pca100 MACH_PCA100 PCA100 2149 -+z3_dm365_mod_01 MACH_Z3_DM365_MOD_01 Z3_DM365_MOD_01 2150 -+hipox MACH_HIPOX HIPOX 2151 -+omap3_piteds MACH_OMAP3_PITEDS OMAP3_PITEDS 2152 -+bm150r MACH_BM150R BM150R 2153 -+tbone MACH_TBONE TBONE 2154 -+merlin MACH_MERLIN MERLIN 2155 -+falcon MACH_FALCON FALCON 2156 -+davinci_da850_evm MACH_DAVINCI_DA850_EVM DAVINCI_DA850_EVM 2157 -+s5p6440 MACH_S5P6440 S5P6440 2158 -+at91sam9g10ek MACH_AT91SAM9G10EK AT91SAM9G10EK 2159 -+omap_4430sdp MACH_OMAP_4430SDP OMAP_4430SDP 2160 -+lpc313x MACH_LPC313X LPC313X 2161 -+magx_zn5 MACH_MAGX_ZN5 MAGX_ZN5 2162 -+magx_em30 MACH_MAGX_EM30 MAGX_EM30 2163 -+magx_ve66 MACH_MAGX_VE66 MAGX_VE66 2164 -+meesc MACH_MEESC MEESC 2165 -+otc570 MACH_OTC570 OTC570 2166 -+bcu2412 MACH_BCU2412 BCU2412 2167 -+beacon MACH_BEACON BEACON 2168 -+actia_tgw MACH_ACTIA_TGW ACTIA_TGW 2169 -+e4430 MACH_E4430 E4430 2170 -+ql300 MACH_QL300 QL300 2171 -+btmavb101 MACH_BTMAVB101 BTMAVB101 2172 -+btmawb101 MACH_BTMAWB101 BTMAWB101 2173 -+sq201 MACH_SQ201 SQ201 2174 -+quatro45xx MACH_QUATRO45XX QUATRO45XX 2175 -+openpad MACH_OPENPAD OPENPAD 2176 -+tx25 MACH_TX25 TX25 2177 -+omap3_torpedo MACH_OMAP3_TORPEDO OMAP3_TORPEDO 2178 -+htcraphael_k MACH_HTCRAPHAEL_K HTCRAPHAEL_K 2179 -+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 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", - template->gpio, template->name); -- return 0; -+ return -EINVAL; - } - - 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 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. - -+config MTD_NAND_MXC_FLASH_BBT -+ bool "Support a flash based bad block table" -+ depends on MTD_NAND_MXC -+ -+config ARCH_MXC_HAS_NFC_V1 -+ bool -+ -+config ARCH_MXC_HAS_NFC_V1_1 -+ select ARCH_MXC_HAS_NFC_V1 -+ bool -+ -+config ARCH_MXC_HAS_NFC_V2 -+ bool -+ -+config ARCH_MXC_HAS_NFC_V2_1 -+ bool -+ select ARCH_MXC_HAS_NFC_V2 -+ -+config ARCH_MXC_HAS_NFC_V3 -+ bool -+ - 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/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-08 12:51:07.000000000 +0200 -@@ -34,23 +34,52 @@ - #include - #include - -+#ifdef CONFIG_MTD_DEBUG -+static int debug = 0; -+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(l, fmt...) DBG(l, fmt) -+#else -+static int debug; -+module_param(debug, int, 0); -+ -+#define dbg_lvl(n) 0 -+#define DBG(lvl, fmt...) do { } while (0) -+#endif -+ -+ - #define DRIVER_NAME "mxc_nand" - - /* Addresses for NFC registers */ --#define NFC_BUF_SIZE 0xE00 --#define NFC_BUF_ADDR 0xE04 --#define NFC_FLASH_ADDR 0xE06 --#define NFC_FLASH_CMD 0xE08 --#define NFC_CONFIG 0xE0A --#define NFC_ECC_STATUS_RESULT 0xE0C --#define NFC_RSLTMAIN_AREA 0xE0E --#define NFC_RSLTSPARE_AREA 0xE10 --#define NFC_WRPROT 0xE12 --#define NFC_UNLOCKSTART_BLKADDR 0xE14 --#define NFC_UNLOCKEND_BLKADDR 0xE16 --#define NFC_NF_WRPRST 0xE18 --#define NFC_CONFIG1 0xE1A --#define NFC_CONFIG2 0xE1C -+#define NFC_BUF_SIZE 0x000 -+#define NFC_BUF_ADDR 0x004 -+#define NFC_FLASH_ADDR 0x006 -+#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_UNLOCKSTART_BLKADDR 0x014 -+#define NFC_UNLOCKEND_BLKADDR 0x016 -+#endif -+#define NFC_NF_WRPRST 0x018 -+#define NFC_CONFIG1 0x01A -+#define NFC_CONFIG2 0x01C -+#ifdef CONFIG_ARCH_MXC_HAS_NFC_V1_1 -+#define NFC_UNLOCKSTART_BLKADDR 0x020 -+#define NFC_UNLOCKEND_BLKADDR 0x022 -+#define NFC_UNLOCKSTART_BLKADDR1 0x024 -+#define NFC_UNLOCKEND_BLKADDR1 0x026 -+#define NFC_UNLOCKSTART_BLKADDR2 0x028 -+#define NFC_UNLOCKEND_BLKADDR2 0x02a -+#define NFC_UNLOCKSTART_BLKADDR3 0x02c -+#define NFC_UNLOCKEND_BLKADDR3 0x02e -+#endif - - /* Addresses for NFC RAM BUFFER Main area 0 */ - #define MAIN_AREA0 0x000 -@@ -59,10 +88,27 @@ - #define MAIN_AREA3 0x600 - - /* Addresses for NFC SPARE BUFFER Spare area 0 */ -+#ifndef CONFIG_ARCH_MXC_HAS_NFC_V1_1 -+#define SPARE_AREA_SIZE 16 - #define SPARE_AREA0 0x800 - #define SPARE_AREA1 0x810 - #define SPARE_AREA2 0x820 - #define SPARE_AREA3 0x830 -+#else -+#define SPARE_AREA_SIZE 64 -+#define MAIN_AREA4 0x800 -+#define MAIN_AREA5 0xa00 -+#define MAIN_AREA6 0xc00 -+#define MAIN_AREA7 0xe00 -+#define SPARE_AREA0 0x1000 -+#define SPARE_AREA1 0x1040 -+#define SPARE_AREA2 0x1080 -+#define SPARE_AREA3 0x10c0 -+#define SPARE_AREA4 0x1100 -+#define SPARE_AREA5 0x1140 -+#define SPARE_AREA6 0x1180 -+#define SPARE_AREA7 0x11c0 -+#endif - - /* 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 { - struct device *dev; - - void __iomem *regs; -+ void __iomem *nfc_buf; - int spare_only; - int status_request; - int pagesize_2k; -@@ -120,40 +167,149 @@ 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}} -+}; -+ - static struct nand_ecclayout nand_hw_eccoob_8 = { - .eccbytes = 5, - .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}} -+}; -+ -+#ifdef CONFIG_MTD_NAND_MXC_FLASH_BBT -+static u8 bbt_pattern[] = {'B', 'b', 't', '0' }; -+static u8 mirror_pattern[] = {'1', 't', 'b', 'B' }; -+ -+static struct nand_bbt_descr bbt_main_descr = { -+ .options = (NAND_BBT_LASTBLOCK | NAND_BBT_WRITE | -+ NAND_BBT_2BIT | NAND_BBT_VERSION | NAND_BBT_PERCHIP), -+ .offs = 12, -+ .len = 4, -+ .veroffs = 11, -+ .maxblocks = 4, -+ .pattern = bbt_pattern, - }; - -+static struct nand_bbt_descr bbt_mirror_descr = { -+ .options = (NAND_BBT_LASTBLOCK | NAND_BBT_WRITE | -+ NAND_BBT_2BIT | NAND_BBT_VERSION | NAND_BBT_PERCHIP), -+ .offs = 12, -+ .len = 4, -+ .veroffs = 11, -+ .maxblocks = 4, -+ .pattern = mirror_pattern, -+}; -+#endif -+#else -+/* -+ * 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 = {{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}, -+ .oobfree = {{0, 4}}, -+}; -+ -+static struct nand_ecclayout nand_hw_eccoob2k_16 = { -+ .eccbytes = 9, -+ .eccpos = {6, 7, 8, 9, 10, 11, 12, 13, 14}, -+ .oobfree = {{2, 4}, {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 -+*/ -+static u8 bbt_pattern[] = { 'B', 'b', 't', '0' }; -+static u8 mirror_pattern[] = { '1', 't', 'b', 'B' }; -+ -+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 -+}; -+ -+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 -+}; -+#endif -+#endif -+ - #ifdef CONFIG_MTD_PARTITIONS - static const char *part_probes[] = { "RedBoot", "cmdlinepart", NULL }; - #endif - -+#ifdef CONFIG_MTD_DEBUG -+#define nfc_read_reg(b, r) __nfc_read_reg(b, r, #r, __FUNCTION__) -+static inline u16 __nfc_read_reg(void __iomem *base, unsigned int reg, -+ const char *name, const char *fn) -+{ -+ u16 val = readw(base + reg); -+ DBG(3, "%s: Read %04x from %s[%02x]\n", fn, val, name, reg); -+ return val; -+} -+ -+#define nfc_write_reg(v, b, r) __nfc_write_reg(v, b, r, #r, __FUNCTION__) -+static inline void __nfc_write_reg(u16 val, void __iomem *base, unsigned int reg, -+ const char *name, const char *fn) -+{ -+ DBG(3, "%s: Writing %04x to %s[%02x]\n", fn, val, name, reg); -+ writew(val, base + reg); -+} -+#else -+#define nfc_read_reg(b, r) readw(b + r) -+#define nfc_write_reg(v, b, r) writew(v, b + r) -+#endif -+ - 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_LEVEL3, "%s(%d)\n", __FUNCTION__, irq); -+ -+ tmp = nfc_read_reg(host->regs, NFC_CONFIG1); - tmp |= NFC_INT_MSK; /* Disable interrupt */ -- writew(tmp, host->regs + NFC_CONFIG1); -+ nfc_write_reg(tmp, host->regs, NFC_CONFIG1); - - wake_up(&host->irq_waitq); - -@@ -166,35 +322,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; -- - if (useirq) { -- if ((readw(host->regs + NFC_CONFIG2) & NFC_INT) == 0) { -- -- tmp = readw(host->regs + NFC_CONFIG1); -- tmp &= ~NFC_INT_MSK; /* Enable interrupt */ -- writew(tmp, host->regs + NFC_CONFIG1); -- -- wait_event(host->irq_waitq, -- readw(host->regs + NFC_CONFIG2) & NFC_INT); -- -- tmp = readw(host->regs + NFC_CONFIG2); -- tmp &= ~NFC_INT; -- writew(tmp, host->regs + NFC_CONFIG2); -+ if (!(nfc_read_reg(host->regs, NFC_CONFIG2) & NFC_INT)) { -+ uint32_t cfg1; -+ 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_read_reg(host->regs, NFC_CONFIG2) & -+ NFC_INT, timeout); - } - } else { -- while (max_retries-- > 0) { -- if (readw(host->regs + NFC_CONFIG2) & NFC_INT) { -- tmp = readw(host->regs + NFC_CONFIG2); -- tmp &= ~NFC_INT; -- writew(tmp, host->regs + NFC_CONFIG2); -- break; -- } -+ 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); - } - } - -@@ -204,8 +354,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 +369,9 @@ 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); -@@ -230,22 +382,28 @@ static void send_addr(struct mxc_nand_ho - static void send_prog_page(struct mxc_nand_host *host, uint8_t buf_id, - int spare_only) - { -+ int i; - DEBUG(MTD_DEBUG_LEVEL3, "send_prog_page (%d)\n", spare_only); - -+ for (i = 0; i < 4; i++) { -+ void *src = host->nfc_buf + SPARE_AREA0 + i * 16; -+ void *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); -+ nfc_write_reg(buf_id, host->regs, NFC_BUF_ADDR); - - /* Configure spare or page+spare access */ - if (!host->pagesize_2k) { -- uint16_t config1 = readw(host->regs + NFC_CONFIG1); -+ uint16_t config1 = nfc_read_reg(host->regs, NFC_CONFIG1); - if (spare_only) - config1 |= NFC_SP_EN; - else -- 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); -@@ -256,25 +414,33 @@ 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 */ -- writew(buf_id, host->regs + NFC_BUF_ADDR); -+ nfc_write_reg(buf_id, host->regs, NFC_BUF_ADDR); - - /* Configure spare or page+spare access */ - if (!host->pagesize_2k) { -- uint32_t config1 = readw(host->regs + NFC_CONFIG1); -+ uint32_t config1 = nfc_read_reg(host->regs, NFC_CONFIG1); - if (spare_only) - config1 |= NFC_SP_EN; - else - config1 &= ~NFC_SP_EN; -- writew(config1, host->regs + NFC_CONFIG1); -+ nfc_write_reg(config1, host->regs, NFC_CONFIG1); - } - -- 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); -+ for (i = 0; i < 4; i++) { -+ void *src = host->nfc_buf + SPARE_AREA0 + i * 64; -+ void *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 +450,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 */ -- tmp = readw(host->regs + NFC_CONFIG1); -+ tmp = nfc_read_reg(host->regs, NFC_CONFIG1); - tmp &= ~NFC_SP_EN; -- writew(tmp, host->regs + NFC_CONFIG1); -+ 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 */ - wait_op_done(host, TROP_US_DELAY, 0, true); - - 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,32 +480,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_AREA1; - uint32_t store; - uint16_t ret, tmp; - /* 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 - * corruption of read/write buffer on status requests. */ -- writew(1, 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); -+ tmp = nfc_read_reg(host->regs, NFC_CONFIG1); - tmp &= ~NFC_SP_EN; -- writew(tmp, host->regs + NFC_CONFIG1); -+ nfc_write_reg(tmp, host->regs, NFC_CONFIG1); - -- writew(NFC_STATUS, host->regs + NFC_CONFIG2); -+ WARN_ON(nfc_read_reg(host->regs, NFC_CONFIG2)); -+ nfc_write_reg(NFC_STATUS, host->regs, NFC_CONFIG2); - - /* Wait for operation to complete */ - wait_op_done(host, TROP_US_DELAY, 0, true); - - /* Status is placed in first word of main buffer */ -- /* get status, then recovery area 1 data */ -+ /* get status, then recover area 1 data */ - ret = readw(main_buf); - writel(store, main_buf); - -+ DBG(0, "%s: status=%02x\n", __FUNCTION__, ret); -+ - return ret; - } - -@@ -369,7 +541,7 @@ static int mxc_nand_correct_data(struct - * 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, -@@ -392,8 +564,10 @@ 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; -- uint16_t __iomem *main_buf = host->regs + MAIN_AREA0; -- 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; -+ -+ WARN_ON(host->spare_only && host->col_addr >= 16); - - /* Check for status request */ - if (host->status_request) -@@ -431,14 +605,16 @@ static uint16_t mxc_nand_read_word(struc - "mxc_nand_read_word(col = %d)\n", host->col_addr); - - col = host->col_addr; -+ - /* Adjust saved column address */ - if (col < mtd->writesize && host->spare_only) - col += mtd->writesize; -+ WARN_ON(col >= mtd->writesize + 16); - - if (col < mtd->writesize) -- p = (host->regs + MAIN_AREA0) + (col >> 1); -+ p = (host->nfc_buf + MAIN_AREA0) + (col >> 1); - else -- p = (host->regs + SPARE_AREA0) + ((col - mtd->writesize) >> 1); -+ p = (host->nfc_buf + SPARE_AREA0) + ((col - mtd->writesize) >> 1); - - if (col & 1) { - rd_word = readw(p); -@@ -474,10 +650,13 @@ static void mxc_nand_write_buf(struct mt - /* 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 -+ 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); - -@@ -485,10 +664,10 @@ static void mxc_nand_write_buf(struct mt - void __iomem *p; - - if (col < mtd->writesize) -- p = host->regs + MAIN_AREA0 + (col & ~3); -+ p = host->nfc_buf + MAIN_AREA0 + (col & ~3); - else -- p = host->regs + SPARE_AREA0 - -- mtd->writesize + (col & ~3); -+ p = host->nfc_buf + SPARE_AREA0 + -+ (col & ~3) - mtd->writesize; - - DEBUG(MTD_DEBUG_LEVEL3, "%s:%d: p = %p\n", __func__, - __LINE__, p); -@@ -542,6 +721,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); - - memcpy(p, &buf[i], m); - col += m; -@@ -571,18 +751,28 @@ static void mxc_nand_read_buf(struct mtd - /* 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 -+ /* 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; - - if (col < mtd->writesize) -- p = host->regs + MAIN_AREA0 + (col & ~3); -+ p = host->nfc_buf + MAIN_AREA0 + (col & ~3); - else -- p = host->regs + SPARE_AREA0 - -- mtd->writesize + (col & ~3); -+ p = host->nfc_buf + SPARE_AREA0 + -+ (col & ~3) - mtd->writesize; -+ -+ if (dbg_lvl(3)) { -+ print_hex_dump(KERN_DEBUG, "spare: ", DUMP_PREFIX_ADDRESS, -+ 16, 2, p, 64, 0); -+ } - - if (((col | (int)&buf[i]) & 3) || n < 16) { - uint32_t data; -@@ -621,15 +811,20 @@ static void mxc_nand_read_buf(struct mtd - m += mtd->oobsize; - - 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; - } - } -+ 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 -@@ -637,7 +832,22 @@ 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; -+ -+ for (i = 0; i < len >> 1; i++) { -+ u16 w = *wp++; -+ u8 c1 = *buf++; -+ u8 c2 = *buf++; -+ if ((w & 0xff) != c1 || (w >> 8) != c2) { -+ DBG(0, "%s: verify error @ %03x: read: %02x %02x expected: %02x %02x\n", -+ __FUNCTION__, i, w & 0xff, w >> 8, c1, c2); -+ return -EFAULT; -+ } -+ } -+ return 0; - } - - /* This function is used by upper layer for select and -@@ -655,13 +865,15 @@ 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); - 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); - #endif - - switch (chip) { -@@ -679,9 +891,6 @@ static void mxc_nand_select_chip(struct - host->clk_act = 1; - } - break; -- -- default: -- break; - } - } - -@@ -692,7 +901,7 @@ 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", -@@ -712,13 +921,11 @@ static void mxc_nand_command(struct mtd_ - case NAND_CMD_READ0: - 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; -@@ -751,23 +958,25 @@ 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); -- -+#ifndef CONFIG_ARCH_MXC_HAS_NFC_V1_1 - if (host->pagesize_2k) { - /* 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); - } -- -+#endif -+ useirq = true; - break; - - case NAND_CMD_ERASE1: -- useirq = false; -+ break; -+ case NAND_CMD_ERASE2: -+ useirq = true; - break; - } - -@@ -791,23 +1000,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 +1022,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); -+#ifndef CONFIG_ARCH_MXC_HAS_NFC_V1_1 - send_read_page(host, 1, host->spare_only); - send_read_page(host, 2, host->spare_only); - send_read_page(host, 3, host->spare_only); -+#endif - } else - send_read_page(host, 0, host->spare_only); - break; - - case NAND_CMD_READID: -+ host->col_addr = 0; - send_read_id(host); - break; - -@@ -851,9 +1053,12 @@ 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; -- struct resource *res; -+ struct resource *res1, *res2; - 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 +1073,6 @@ static int __init mxcnd_probe(struct pla - mtd->owner = THIS_MODULE; - mtd->dev.parent = &pdev->dev; - -- /* 50 us command delay time */ -- this->chip_delay = 5; -- - this->priv = host; - this->dev_ready = mxc_nand_dev_ready; - this->cmdfunc = mxc_nand_command; -@@ -880,29 +1082,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; -+#ifdef CONFIG_MTD_NAND_MXC_FLASH_BBT -+ this->bbt_td = &bbt_main_descr; -+ this->bbt_md = &bbt_mirror_descr; -+ this->options |= NAND_USE_FLASH_BBT; -+#endif - -- host->clk = clk_get(&pdev->dev, "nfc"); -- if (IS_ERR(host->clk)) -+ host->clk = clk_get(&pdev->dev, "nfc_clk"); -+ if (IS_ERR(host->clk)) { -+ err = PTR_ERR(host->clk); - goto eclk; -+ } - - clk_enable(host->clk); - host->clk_act = 1; - -- res = platform_get_resource(pdev, IORESOURCE_MEM, 0); -- if (!res) { -+ res1 = platform_get_resource(pdev, IORESOURCE_MEM, 0); -+ res2 = platform_get_resource(pdev, IORESOURCE_MEM, 1); -+ if (!res1 || !res2) { - err = -ENODEV; - goto eres; - } - -- 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; -+ } -+ -+ if (!request_mem_region(res2->start, resource_size(res2), "mxc_nand buffer")) { -+ err = -EBUSY; -+ goto ereq2; -+ } -+ -+ host->regs = ioremap(res1->start, resource_size(res1)); - if (!host->regs) { -- err = -EIO; -- goto eres; -+ err = -ENOMEM; -+ goto eunmap1; - } - -- tmp = readw(host->regs + NFC_CONFIG1); -+ 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); - -@@ -912,57 +1139,84 @@ static int __init mxcnd_probe(struct pla - if (err) - goto eirq; - -- 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_ECC_EN; -- writew(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; -- tmp = readw(host->regs + NFC_CONFIG1); -- tmp &= ~NFC_ECC_EN; -- writew(tmp, host->regs + NFC_CONFIG1); -- } -- - /* Reset NAND */ - this->cmdfunc(mtd, NAND_CMD_RESET, -1, -1); - - /* preset operation */ - /* Unlock the internal RAM Buffer */ -- writew(0x2, host->regs + NFC_CONFIG); -+ nfc_write_reg(0x2, host->regs, NFC_CONFIG); - - /* Blocks to be unlocked */ -- writew(0x0, host->regs + NFC_UNLOCKSTART_BLKADDR); -- writew(0x4000, host->regs + NFC_UNLOCKEND_BLKADDR); -+ nfc_write_reg(0x0, host->regs, NFC_UNLOCKSTART_BLKADDR); -+ nfc_write_reg(0x4000, host->regs, NFC_UNLOCKEND_BLKADDR); - - /* Unlock Block Command for given address range */ -- writew(0x4, host->regs + NFC_WRPROT); -+ nfc_write_reg(0x4, host->regs, NFC_WRPROT); - - /* NAND bus width determines access funtions used by upper layer */ - if (pdata->width == 2) { - this->options |= NAND_BUSWIDTH_16; -- this->ecc.layout = &nand_hw_eccoob_16; - } - -- host->pagesize_2k = 0; -- - /* Scan to find existence of the device */ -- if (nand_scan(mtd, 1)) { -+ err = nand_scan_ident(mtd, 1); -+ if (err) { - DEBUG(MTD_DEBUG_LEVEL0, - "MXC_ND: Unable to find any NAND device.\n"); -- err = -ENXIO; -+ goto escan; -+ } -+ /* this is required before completing the scan */ -+ host->pagesize_2k = (mtd->writesize == 2048); -+ tmp = nfc_read_reg(host->regs, NFC_CONFIG1); -+ tmp |= NFC_ONE_CYCLE; -+ tmp &= ~(3 << 9); /* clear PPB mask */ -+ DBG(0, "%s: ppb=%d (%02x)\n", __FUNCTION__, -+ mtd->erasesize / mtd->writesize, -+ ffs(mtd->erasesize / mtd->writesize) - 6); -+ -+ /* set PPB (pages per block */ -+ tmp |= (ffs(mtd->erasesize / mtd->writesize) - 6) << 9; -+ nfc_write_reg(tmp, host->regs, NFC_CONFIG1); -+ if (pdata->width == 2) { -+ if (host->pagesize_2k) { -+ this->ecc.layout = &nand_hw_eccoob2k_16; -+ } else { -+ this->ecc.layout = &nand_hw_eccoob_16; -+ } -+ } 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; -+ nfc_write_reg(tmp, host->regs, NFC_CONFIG1); -+ } -+ -+ err = nand_scan_tail(mtd); -+ if (err) { - goto escan; - } - -+ 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 +1235,19 @@ static int __init mxcnd_probe(struct pla - return 0; - - escan: -- free_irq(host->irq, NULL); -+ free_irq(host->irq, host); - eirq: -+ if (res2) -+ iounmap(host->nfc_buf); -+eunmap2: - iounmap(host->regs); -+eunmap1: -+ release_mem_region(res2->start, resource_size(res2)); -+ereq2: -+ release_mem_region(res1->start, resource_size(res1)); -+ereq1: - eres: -+ clk_disable(host->clk); - clk_put(host->clk); - eclk: - kfree(host); -@@ -995,46 +1258,63 @@ eclk: - static int __devexit mxcnd_remove(struct platform_device *pdev) - { - struct mxc_nand_host *host = platform_get_drvdata(pdev); -+ struct resource *res; - -+ if (host->clk_act) -+ clk_disable(host->clk); - clk_put(host->clk); - -- platform_set_drvdata(pdev, NULL); -- - nand_release(&host->mtd); -- free_irq(host->irq, NULL); -+ free_irq(host->irq, host); - iounmap(host->regs); - kfree(host); - -+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0); -+ if (res) { -+ release_mem_region(res->start, resource_size(res)); -+ } -+ res = platform_get_resource(pdev, IORESOURCE_MEM, 1); -+ if (res) { -+ release_mem_region(res->start, resource_size(res)); -+ } - return 0; - } - - #ifdef CONFIG_PM - static int mxcnd_suspend(struct platform_device *pdev, pm_message_t state) - { -- struct mtd_info *info = platform_get_drvdata(pdev); -+ struct mtd_info *mtd = platform_get_drvdata(pdev); -+ struct nand_chip *nand_chip = mtd->priv; -+ struct mxc_nand_host *host = nand_chip->priv; - int ret = 0; - - DEBUG(MTD_DEBUG_LEVEL0, "MXC_ND : NAND suspend\n"); -- if (info) -- ret = info->suspend(info); -+ if (mtd) -+ ret = mtd->suspend(mtd); - -- /* Disable the NFC clock */ -- clk_disable(nfc_clk); /* FIXME */ -+ if (host->clk_act) { -+ /* Disable the NFC clock */ -+ clk_disable(host->clk); -+ } - - return ret; - } - - static int mxcnd_resume(struct platform_device *pdev) - { -- struct mtd_info *info = platform_get_drvdata(pdev); -+ struct mtd_info *mtd = platform_get_drvdata(pdev); -+ struct nand_chip *nand_chip = mtd->priv; -+ struct mxc_nand_host *host = nand_chip->priv; - int ret = 0; - - DEBUG(MTD_DEBUG_LEVEL0, "MXC_ND : NAND resume\n"); -- /* Enable the NFC clock */ -- clk_enable(nfc_clk); /* FIXME */ - -- if (info) -- info->resume(info); -+ if (host->clk_act) { -+ /* Enable the NFC clock */ -+ clk_enable(host->clk); -+ } -+ if (mtd) -+ mtd->resume(mtd); - - return ret; - } -@@ -1047,7 +1327,7 @@ static int mxcnd_resume(struct platform_ - static struct platform_driver mxcnd_driver = { - .driver = { - .name = DRIVER_NAME, -- }, -+ }, - .remove = __exit_p(mxcnd_remove), - .suspend = mxcnd_suspend, - .resume = mxcnd_resume, -@@ -1055,13 +1335,14 @@ static struct platform_driver mxcnd_driv - - static int __init mxc_nd_init(void) - { -+ int ret; -+ - /* Register the device driver structure. */ -- pr_info("MXC MTD nand Driver\n"); -- if (platform_driver_probe(&mxcnd_driver, mxcnd_probe) != 0) { -+ ret = platform_driver_probe(&mxcnd_driver, mxcnd_probe); -+ if (ret != 0) { - printk(KERN_ERR "Driver register failed for mxcnd_driver\n"); -- return -ENODEV; - } -- return 0; -+ return ret; - } - - static void __exit mxc_nd_cleanup(void) -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 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 -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 18:43:03.000000000 +0200 -@@ -2,6 +2,12 @@ - * Fast Ethernet Controller (FEC) driver for Motorola MPC8xx. - * Copyright (c) 1997 Dan Malek (dmalek@jlc.net) - * -+ * This version of the driver is specific to the FADS implementation, -+ * since the board contains control registers external to the processor -+ * for the control of the LevelOne LXT970 transceiver. The MPC860T manual -+ * describes connections using the internal parallel port I/O, which -+ * is basically all of Port D. -+ * - * Right now, I am very wasteful with the buffers. I allocate memory - * pages and then divide them into 2K frame buffers. This way I know I - * have buffers large enough to hold one frame within one buffer descriptor. -@@ -18,77 +24,123 @@ - * Bug fixes and cleanup by Philippe De Muyter (phdm@macqel.be) - * Copyright (c) 2004-2006 Macq Electronique SA. - */ -+/* -+ * Copyright 2006-2007 Freescale Semiconductor, Inc. All Rights Reserved. -+ */ - - #include - #include --#include --#include -+#include - #include - #include - #include - #include --#include --#include -+#include - #include -+#include - #include - #include - #include - #include --#include --#include --#include --#include -+#include - #include --#include -+#include -+#include - --#include -+#include -+#include - --#ifndef CONFIG_ARCH_MXC --#include --#include -+#define DRV_NAME "fec" -+#define DEBUG -+ -+#ifdef DEBUG -+static int debug = 0; -+#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 - -+#if defined(CONFIG_M523x) || defined(CONFIG_M527x) || \ -+ defined(CONFIG_M5272) || defined(CONFIG_M528x) || \ -+ defined(CONFIG_M520x) || defined(CONFIG_M532x) -+#include -+#include - #include "fec.h" -- --#ifdef CONFIG_ARCH_MXC -+#define FEC_ALIGNMENT (0x03) /*FEC needs 4bytes alignment*/ -+#elif defined(CONFIG_ARCH_MXC) - #include --#define FEC_ALIGNMENT 0xf -+#include -+#include "fec.h" -+#define FEC_ALIGNMENT (0x0F) /*FEC needs 128bits(16bytes) alignment*/ - #else --#define FEC_ALIGNMENT 0x3 -+#include -+#include -+#include "commproc.h" -+#define FEC_ALIGNMENT (0x03) /*FEC needs 4bytes alignment */ - #endif - -+#define FEC_ADDR_ALIGNMENT(x) ((unsigned char *)(((unsigned long)(x) + (FEC_ALIGNMENT)) & (~FEC_ALIGNMENT))) -+ -+#if 0 - /* - * Define the fixed address of the FEC hardware. - */ -+/* USE resources provided by platform_device! */ -+static unsigned int fec_hw[] = { - #if defined(CONFIG_M5272) --#define HAVE_mii_link_interrupt -- --static unsigned char fec_mac_default[] = { -- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ (MCF_MBAR + 0x840), -+#elif defined(CONFIG_M527x) -+ (MCF_MBAR + 0x1000), -+ (MCF_MBAR + 0x1800), -+#elif defined(CONFIG_M523x) || defined(CONFIG_M528x) -+ (MCF_MBAR + 0x1000), -+#elif defined(CONFIG_M520x) -+ (MCF_MBAR+0x30000), -+#elif defined(CONFIG_M532x) -+ (MCF_MBAR+0xfc030000), -+#elif defined(CONFIG_ARCH_MXC) -+ (IO_ADDRESS(FEC_BASE_ADDR)), -+#else -+ &(((immap_t *)IMAP_ADDR)->im_cpm.cp_fec), -+#endif - }; -+#endif - -+#if 0 - /* - * Some hardware gets it MAC address out of local flash memory. - * if this is non-zero then assume it is the address to get MAC from. - */ -+/* implemented using platform_data! */ - #if defined(CONFIG_NETtel) - #define FEC_FLASHMAC 0xf0006006 - #elif defined(CONFIG_GILBARCONAP) || defined(CONFIG_SCALES) - #define FEC_FLASHMAC 0xf0006000 -+#elif defined (CONFIG_MTD_KeyTechnology) -+#define FEC_FLASHMAC 0xffe04000 - #elif defined(CONFIG_CANCam) - #define FEC_FLASHMAC 0xf0020000 - #elif defined (CONFIG_M5272C3) - #define FEC_FLASHMAC (0xffe04000 + 4) - #elif defined(CONFIG_MOD5272) --#define FEC_FLASHMAC 0xffc0406b -+#define FEC_FLASHMAC 0xffc0406b - #else - #define FEC_FLASHMAC 0 - #endif --#endif /* CONFIG_M5272 */ -+#endif -+ -+#define platform_func(p, args...) ((p) ? (p)(args) : 0) - - /* Forward declarations of some structures to support different PHYs - */ -- -+#ifndef CONFIG_PHYLIB - typedef struct { - uint mii_data; - void (*funct)(uint mii_reg, struct net_device *dev); -@@ -103,6 +155,7 @@ typedef struct { - const phy_cmd_t *ack_int; - const phy_cmd_t *shutdown; - } phy_info_t; -+#endif - - /* The number of Tx and Rx buffers. These are allocated from the page - * pool. The code may assume these are power of two, so it it best -@@ -116,12 +169,13 @@ typedef struct { - #define RX_RING_SIZE (FEC_ENET_RX_FRPPG * FEC_ENET_RX_PAGES) - #define FEC_ENET_TX_FRSIZE 2048 - #define FEC_ENET_TX_FRPPG (PAGE_SIZE / FEC_ENET_TX_FRSIZE) --#define TX_RING_SIZE 16 /* Must be power of two */ --#define TX_RING_MOD_MASK 15 /* for this to work */ -+#define TX_RING_SIZE 16 /* Must be power of two */ -+#define TX_RING_MOD_MASK (TX_RING_SIZE - 1) /* for this to work */ - - #if (((RX_RING_SIZE + TX_RING_SIZE) * 8) > PAGE_SIZE) - #error "FEC: descriptor ring size constants too large" - #endif -+#define CBD_BUF_SIZE ((RX_RING_SIZE + TX_RING_SIZE) * sizeof(cbd_t)) - - /* Interrupt events/masks. - */ -@@ -136,6 +190,17 @@ typedef struct { - #define FEC_ENET_MII ((uint)0x00800000) /* MII interrupt */ - #define FEC_ENET_EBERR ((uint)0x00400000) /* SDMA bus error */ - -+/* MXC arch interrupt bits */ -+#define FEC_ENET_LC ((uint)0x00200000) /* Late collision */ -+#define FEC_ENET_RL ((uint)0x00100000) /* Collision retry limit exceeded */ -+#define FEC_ENET_UN ((uint)0x00080000) /* TX Fifo underrun */ -+ -+#ifndef CONFIG_ARCH_MXC -+#define FEC_ENET_MASK ((uint)0xffc00000) -+#else -+#define FEC_ENET_MASK ((uint)0xfff80000) -+#endif -+ - /* The FEC stores dest/src/type, data, and checksum for receive packets. - */ - #define PKT_MAXBUF_SIZE 1518 -@@ -150,7 +215,7 @@ typedef struct { - */ - #if defined(CONFIG_M523x) || defined(CONFIG_M527x) || defined(CONFIG_M528x) || \ - defined(CONFIG_M520x) || defined(CONFIG_M532x) || defined(CONFIG_ARCH_MXC) --#define OPT_FRAME_SIZE (PKT_MAXBUF_SIZE << 16) -+#define OPT_FRAME_SIZE (RCR_MAX_FL_set(PKT_MAXBUF_SIZE)) - #else - #define OPT_FRAME_SIZE 0 - #endif -@@ -165,31 +230,45 @@ typedef struct { - */ - struct fec_enet_private { - /* Hardware registers of the FEC device */ -- volatile fec_t *hwp; -- -- struct net_device *netdev; -- -- struct clk *clk; -+ void __iomem *reg_base; -+ void __iomem *mib_base; -+ struct resource *res_mem1; -+ struct resource *res_mem2; -+ int etn_irq; -+ int mii_irq; -+#ifndef CONFIG_PHYLIB -+ struct timer_list *phy_timer; -+#else -+ struct mii_bus *mii; -+ int mii_complete; -+#endif -+ u32 msg_enable; - - /* The saved address of a sent-in-place packet/buffer, for skfree(). */ -- unsigned char *tx_bounce[TX_RING_SIZE]; -+ void *tx_bounce[TX_RING_SIZE]; - struct sk_buff* tx_skbuff[TX_RING_SIZE]; -+ struct sk_buff* rx_skbuff[RX_RING_SIZE]; - ushort skb_cur; - ushort skb_dirty; - - /* CPM dual port RAM relative addresses. - */ -- dma_addr_t bd_dma; -+ struct device *dma_dev; /* pointer to (platform_)device for dma_sync*() functions */ -+ void *cbd_mem_base; /* save the virtual base address of rx&tx buffer descriptor */ -+ dma_addr_t cbd_phys_base; /* physical address of buffer descriptor memory for access by FEC HW */ -+ - cbd_t *rx_bd_base; /* Address of Rx and Tx buffers. */ - cbd_t *tx_bd_base; -- cbd_t *cur_rx, *cur_tx; /* The next free ring entry */ -- cbd_t *dirty_tx; /* The ring entries to be free()ed. */ -+ cbd_t *cur_rx, *cur_tx; /* The next free ring entry */ -+ cbd_t *dirty_tx; /* The ring entries to be free()ed. */ -+ struct net_device_stats stats; - uint tx_full; -- /* hold while accessing the HW like ringbuffer for tx/rx but not MAC */ -- spinlock_t hw_lock; -- /* hold while accessing the mii_list_t() elements */ -- spinlock_t mii_lock; -+ spinlock_t lock; - -+#ifdef CONFIG_PHYLIB -+ struct phy_device *phy; -+ uint phy_speed; -+#else - uint phy_id; - uint phy_id_done; - uint phy_status; -@@ -199,28 +278,41 @@ struct fec_enet_private { - - uint sequence_done; - uint mii_phy_task_queued; -- -+#endif - uint phy_addr; - -- int index; -- int opened; -- int link; -- int old_link; -- int full_duplex; -+ unsigned int opened:1; -+ unsigned int phy_int_enabled:1; -+ unsigned int linkstatus:1; -+#ifndef CONFIG_PHYLIB -+ unsigned int old_linkstatus:1; -+#endif -+ unsigned int full_duplex:1; -+ -+ struct clk *clk; - }; - --static int fec_enet_open(struct net_device *dev); --static int fec_enet_start_xmit(struct sk_buff *skb, struct net_device *dev); --static void fec_enet_mii(struct net_device *dev); --static irqreturn_t fec_enet_interrupt(int irq, void * dev_id); -+#ifdef CONFIG_PHYLIB -+static int fec_connect_phy(struct net_device *dev, struct fec_enet_private *fep); -+#else -+static irqreturn_t mii_link_interrupt(int irq, void *dev_id); -+#endif -+static void fec_restart(struct net_device *dev, int duplex); - static void fec_enet_tx(struct net_device *dev); - static void fec_enet_rx(struct net_device *dev); --static int fec_enet_close(struct net_device *dev); --static void set_multicast_list(struct net_device *dev); --static void fec_restart(struct net_device *dev, int duplex); -+static void fec_enet_mii(struct net_device *dev); - static void fec_stop(struct net_device *dev); --static void fec_set_mac_address(struct net_device *dev); -+static void _fec_set_mac_address(struct net_device *dev); - -+/* -+ * fec_copy_threshold controls the copy when receiving ethernet frame. -+ * If ethernet header is aligned on a 4byte boundary, the ip header and -+ * higher level header will not be aligned. -+ * The reason is, that an ethernet header is 14bytes long. -+ * And the max size of tcp & ip header is 128bytes. Normally it is 40bytes. -+ * So I set the default value between 128 to 256. -+ */ -+static int fec_copy_threshold = 192; - - /* MII processing. We keep this as simple as possible. Requests are - * placed on the list (if there is room). When the request is finished -@@ -232,14 +324,16 @@ typedef struct mii_list { - struct mii_list *mii_next; - } mii_list_t; - -+#ifndef CONFIG_PHYLIB - #define NMII 20 - static mii_list_t mii_cmds[NMII]; - static mii_list_t *mii_free; - static mii_list_t *mii_head; - static mii_list_t *mii_tail; - --static int mii_queue(struct net_device *dev, int request, -- void (*func)(uint, struct net_device *)); -+static int mii_queue(struct net_device *dev, int request, -+ void (*func)(uint, struct net_device *)); -+#endif - - /* Make MII read/write commands for the FEC. - */ -@@ -284,87 +378,233 @@ 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 */ - -+#ifndef DEBUG -+static inline unsigned long fec_reg_read(struct fec_enet_private *fep, unsigned int reg) -+{ -+ return readl(fep->reg_base + reg); -+} -+ -+static inline void fec_reg_write(struct fec_enet_private *fep, unsigned int reg, unsigned long val) -+{ -+ writel(val, fep->reg_base + reg); -+} -+#else -+#define fec_reg_read(fep, reg) __fec_reg_read(fep, reg, __FUNCTION__, #reg) -+#define fec_reg_write(fep, reg, val) __fec_reg_write(fep, reg, val, __FUNCTION__, #reg) -+ -+static inline unsigned long __fec_reg_read(struct fec_enet_private *fep, unsigned int reg, -+ const char *func, const char *reg_name) -+{ -+ unsigned long val = readl(fep->reg_base + reg); -+ DBG(3, "%s: Read %08lx from %s(%03x)\n", func, val, reg_name, reg); -+ return val; -+} -+ -+static inline void __fec_reg_write(struct fec_enet_private *fep, unsigned int reg, -+ unsigned long val, const char *func, const char *reg_name) -+{ -+ DBG(3, "%s: Writing %08lx to %s(%03x)\n", func, val, reg_name, reg); -+ writel(val, fep->reg_base + reg); -+} -+#endif -+ -+static inline void fec_enet_cbd_get(struct fec_enet_private *fep) -+{ -+ DBG(2, "%s: Requesting cbd area: %08lx\n", __FUNCTION__, -+ (unsigned long)fep->cbd_phys_base); -+ dma_sync_single_for_cpu(fep->dma_dev, fep->cbd_phys_base, -+ CBD_BUF_SIZE, DMA_BIDIRECTIONAL); -+} -+ -+static inline void fec_enet_cbd_put(struct fec_enet_private *fep) -+{ -+ DBG(2, "%s: Flushing changes to cbd area\n", __FUNCTION__); -+ dma_sync_single_for_device(fep->dma_dev, fep->cbd_phys_base, -+ CBD_BUF_SIZE, DMA_BIDIRECTIONAL); -+} -+ -+static inline void fec_enet_rxbuf_get(struct fec_enet_private *fep, cbd_t *bdp, ushort len) -+{ -+ DBG(2, "%s: Requesting RX buffer %08lx(%u)\n", __FUNCTION__, -+ (unsigned long)bdp->cbd_bufaddr, len); -+ dma_sync_single_for_cpu(fep->dma_dev, bdp->cbd_bufaddr, -+ len, DMA_FROM_DEVICE); -+} -+ -+static inline void fec_enet_rxbuf_put(struct fec_enet_private *fep, cbd_t *bdp, ushort len) -+{ -+ DBG(2, "%s: Releasing RX buffer %08lx(%u)\n", __FUNCTION__, (ulong)bdp->cbd_bufaddr, len); -+ dma_sync_single_for_device(fep->dma_dev, bdp->cbd_bufaddr, len, DMA_FROM_DEVICE); -+} -+ -+static inline void fec_enet_rxbuf_map(struct fec_enet_private *fep, cbd_t *bdp, -+ void *buf, ushort len) -+{ -+ BUG_ON(!dma_mapping_error(fep->dma_dev, bdp->cbd_bufaddr)); -+ bdp->cbd_bufaddr = dma_map_single(fep->dma_dev, buf, -+ len, DMA_FROM_DEVICE); -+ DBG(2, "%s: RX buffer %p(%u) mapped to %08lx\n", __FUNCTION__, -+ buf, len, (unsigned long)bdp->cbd_bufaddr); -+} -+ -+static inline void fec_enet_rxbuf_unmap(struct fec_enet_private *fep, cbd_t *bdp, ushort len) -+{ -+ DBG(2, "%s: Unmapping RX buffer %08lx(%u)\n", __FUNCTION__, -+ (unsigned long)bdp->cbd_bufaddr, len); -+ BUG_ON(dma_mapping_error(fep->dma_dev, bdp->cbd_bufaddr)); -+ dma_unmap_single(fep->dma_dev, bdp->cbd_bufaddr, -+ len, DMA_FROM_DEVICE); -+ bdp->cbd_bufaddr = ~0; -+} -+ -+static inline void fec_enet_txbuf_map(struct fec_enet_private *fep, cbd_t *bdp, -+ void *buf, ushort len) -+{ -+ BUG_ON(!dma_mapping_error(fep->dma_dev, bdp->cbd_bufaddr)); -+ bdp->cbd_bufaddr = dma_map_single(fep->dma_dev, buf, -+ len, DMA_TO_DEVICE); -+ DBG(2, "%s: TX buffer %p(%u) mapped to %08lx\n", __FUNCTION__, -+ buf, len, (unsigned long)bdp->cbd_bufaddr); -+} -+ -+static inline void fec_enet_txbuf_unmap(struct fec_enet_private *fep, cbd_t *bdp, ushort len) -+{ -+ DBG(2, "%s: Unmapping TX buffer %08lx(%u)\n", __FUNCTION__, -+ (unsigned long)bdp->cbd_bufaddr, len); -+ BUG_ON(dma_mapping_error(fep->dma_dev, bdp->cbd_bufaddr)); -+ dma_unmap_single(fep->dma_dev, bdp->cbd_bufaddr, -+ len, DMA_TO_DEVICE); -+ bdp->cbd_bufaddr = ~0; -+} -+ -+static inline void fec_enet_txbuf_get(struct fec_enet_private *fep, cbd_t *bdp, ushort len) -+{ -+ DBG(2, "%s: Requesting TX buffer %08lx(%u)\n", __FUNCTION__, -+ (unsigned long)bdp->cbd_bufaddr, len); -+ dma_sync_single_for_cpu(fep->dma_dev, bdp->cbd_bufaddr, -+ len, DMA_TO_DEVICE); -+} -+ -+static inline void fec_enet_txbuf_put(struct fec_enet_private *fep, cbd_t *bdp, ushort len) -+{ -+ DBG(2, "%s: Releasing TX buffer %08lx(%u)\n", __FUNCTION__, -+ (unsigned long)bdp->cbd_bufaddr, len); -+ 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) - { -- struct fec_enet_private *fep; -- volatile fec_t *fecp; -- volatile cbd_t *bdp; -- unsigned short status; -+ struct fec_enet_private *fep = netdev_priv(dev); -+ cbd_t *bdp; -+ unsigned short status; - unsigned long flags; - -- fep = netdev_priv(dev); -- fecp = (volatile fec_t*)dev->base_addr; -- -- if (!fep->link) { -+ if (!fep->linkstatus) { -+ DBG(0, "%s: Cannot send packet; link is down\n", __FUNCTION__); - /* Link is down or autonegotiation is in progress. */ - return 1; - } - -- 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 */ - bdp = fep->cur_tx; - - status = bdp->cbd_sc; --#ifndef final_version -+#ifdef DEBUG - if (status & BD_ENET_TX_READY) { - /* Ooops. All transmit buffers are full. Bail out. - * This should not happen, since dev->tbusy should be set. - */ - printk("%s: tx queue full!.\n", dev->name); -- spin_unlock_irqrestore(&fep->hw_lock, flags); -+ fec_enet_cbd_put(fep); -+ spin_unlock_irqrestore(&fep->lock, flags); - return 1; - } - #endif -- - /* Clear all of the status flags. - */ - status &= ~BD_ENET_TX_STATS; - - /* Set buffer length and buffer pointer. - */ -- 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 - * 4-byte boundaries. Use bounce buffers to copy data - * and get it aligned. Ugh. - */ -- if (bdp->cbd_bufaddr & FEC_ALIGNMENT) { -+ if (unlikely((bdp->cbd_bufaddr) & FEC_ALIGNMENT)) { - unsigned int index; - index = bdp - fep->tx_bd_base; -- memcpy(fep->tx_bounce[index], (void *)skb->data, skb->len); -- bdp->cbd_bufaddr = __pa(fep->tx_bounce[index]); -+ memcpy(fep->tx_bounce[index], skb->data, skb->len); -+ fec_enet_txbuf_map(fep, bdp, fep->tx_bounce[index], skb->len); -+ } else { -+ fec_enet_txbuf_map(fep, bdp, skb->data, skb->len); - } - - /* Save skb pointer. - */ - fep->tx_skbuff[fep->skb_cur] = skb; - -- dev->stats.tx_bytes += skb->len; -- fep->skb_cur = (fep->skb_cur+1) & TX_RING_MOD_MASK; -- -- /* Push the data cache so the CPM does not get stale memory -- * data. -- */ -- dma_sync_single(NULL, bdp->cbd_bufaddr, -- bdp->cbd_datlen, DMA_TO_DEVICE); -+ fep->stats.tx_bytes += skb->len; -+ fep->skb_cur = (fep->skb_cur + 1) & TX_RING_MOD_MASK; - - /* Send it on its way. Tell FEC it's ready, interrupt when done, - * it's the last BD of the frame, and to put the CRC on the end. - */ -- - status |= (BD_ENET_TX_READY | BD_ENET_TX_INTR - | BD_ENET_TX_LAST | BD_ENET_TX_TC); - bdp->cbd_sc = status; - - dev->trans_start = jiffies; - -- /* Trigger transmission start */ -- fecp->fec_x_des_active = 0; -- - /* 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, - - if (bdp == fep->dirty_tx) { - fep->tx_full = 1; -+ DBG(0, "TX ring full, stopping netif queue\n"); - netif_stop_queue(dev); - } - -- 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; - } -@@ -390,101 +640,126 @@ fec_timeout(struct net_device *dev) - { - struct fec_enet_private *fep = netdev_priv(dev); - -- printk("%s: transmit timed out.\n", dev->name); -- dev->stats.tx_errors++; --#ifndef final_version -+ printk(KERN_WARNING "%s: transmit timed out.\n", dev->name); -+ fep->stats.tx_errors++; -+#ifdef DEBUG - { -- int i; -- cbd_t *bdp; -+ int i; -+ cbd_t *bdp; - -- printk("Ring data dump: cur_tx %lx%s, dirty_tx %lx cur_rx: %lx\n", -- (unsigned long)fep->cur_tx, fep->tx_full ? " (full)" : "", -- (unsigned long)fep->dirty_tx, -- (unsigned long)fep->cur_rx); -+ fec_enet_cbd_get(fep); - -- bdp = fep->tx_bd_base; -- printk(" tx: %u buffers\n", TX_RING_SIZE); -- for (i = 0 ; i < TX_RING_SIZE; i++) { -- printk(" %08x: %04x %04x %08x\n", -- (uint) bdp, -- bdp->cbd_sc, -- bdp->cbd_datlen, -- (int) bdp->cbd_bufaddr); -- bdp++; -- } -+ printk(KERN_DEBUG "%s: Ring data dump: cur_tx %p%s, dirty_tx %p cur_rx: %p\n", -+ __FUNCTION__, -+ fep->cur_tx, fep->tx_full ? " (full)" : "", -+ fep->dirty_tx, -+ fep->cur_rx); - -- bdp = fep->rx_bd_base; -- printk(" rx: %lu buffers\n", (unsigned long) RX_RING_SIZE); -- for (i = 0 ; i < RX_RING_SIZE; i++) { -- printk(" %08x: %04x %04x %08x\n", -- (uint) bdp, -- bdp->cbd_sc, -- bdp->cbd_datlen, -- (int) bdp->cbd_bufaddr); -- bdp++; -- } -+ bdp = fep->tx_bd_base; -+ printk(" tx: %u buffers\n", TX_RING_SIZE); -+ for (i = 0; i < TX_RING_SIZE; i++) { -+ printk(" %p: %04x %04x %08x\n", -+ bdp, -+ bdp->cbd_sc, -+ bdp->cbd_datlen, -+ bdp->cbd_bufaddr); -+ bdp++; -+ } -+ -+ bdp = fep->rx_bd_base; -+ printk(" rx: %lu buffers\n", RX_RING_SIZE); -+ for (i = 0; i < RX_RING_SIZE; i++) { -+ printk(" %p: %04x %04x %08x\n", -+ bdp, -+ bdp->cbd_sc, -+ bdp->cbd_datlen, -+ bdp->cbd_bufaddr); -+ bdp++; -+ } -+ fec_enet_cbd_put(fep); - } - #endif - fec_restart(dev, fep->full_duplex); -- netif_wake_queue(dev); -+ DBG(0, "%s: Scheduling netif queue\n", __FUNCTION__); -+ //netif_schedule(dev); - } - - /* The interrupt handler. - * This is called from the MPC core interrupt. - */ - static irqreturn_t --fec_enet_interrupt(int irq, void * dev_id) -+fec_enet_interrupt(int irq, void *dev_id) - { -- struct net_device *dev = dev_id; -- volatile fec_t *fecp; -- uint int_events; -- irqreturn_t ret = IRQ_NONE; -- -- fecp = (volatile fec_t*)dev->base_addr; -+ struct net_device *dev = dev_id; -+ struct fec_enet_private *fep = netdev_priv(dev); -+ uint int_events; -+ int handled = 0; -+ unsigned int eimr = fec_reg_read(fep, FEC_EIMR); - -+ DBG(2, "%s: %08lx:%08lx\n", __FUNCTION__, -+ fec_reg_read(fep, FEC_EIR), fec_reg_read(fep, FEC_EIMR)); - /* Get the interrupt events that caused us to be here. - */ -- do { -- int_events = fecp->fec_ievent; -- fecp->fec_ievent = int_events; -+ while ((int_events = fec_reg_read(fep, FEC_EIR) & FEC_ENET_MASK) != 0) { -+ if (int_events & ~eimr) { -+ printk(KERN_WARNING "%s: masked interrupt condition: %08x\n", -+ __FUNCTION__, int_events & ~eimr); -+ } -+ -+ fec_reg_write(fep, FEC_EIR, int_events); - - /* Handle receive event in its own function. - */ -- if (int_events & FEC_ENET_RXF) { -- ret = IRQ_HANDLED; -+ if (int_events & (FEC_ENET_RXF | FEC_ENET_RXB)) { -+ DBG(2, "%s: Handling RX Interrupt\n", __FUNCTION__); -+ handled = 1; - fec_enet_rx(dev); - } - -+ if (int_events & FEC_ENET_UN) { -+ printk(KERN_WARNING "TX fifo underrun"); -+ } - /* Transmit OK, or non-fatal error. Update the buffer - descriptors. FEC handles all errors, we just discover - them as part of the transmit process. - */ -- if (int_events & FEC_ENET_TXF) { -- ret = IRQ_HANDLED; -+ if (int_events & (FEC_ENET_TXF | FEC_ENET_TXB)) { -+ DBG(2, "%s: Handling TX Interrupt\n", __FUNCTION__); -+ handled = 1; - fec_enet_tx(dev); - } - -- if (int_events & FEC_ENET_MII) { -- ret = IRQ_HANDLED; -+ if (int_events & (FEC_ENET_MII | FEC_ENET_HBERR)) { -+ DBG(2, "%s: Handling MII Interrupt\n", __FUNCTION__); -+ handled = 1; - fec_enet_mii(dev); - } -- -- } while (int_events); -- -- return ret; -+ } -+ return IRQ_RETVAL(handled); - } - -+static void fec_free_skb(struct fec_enet_private *fep, cbd_t *bdp, struct sk_buff **pskb) -+{ -+ struct sk_buff *skb = *pskb; -+ if (!dma_mapping_error(fep->dma_dev, bdp->cbd_bufaddr)) { -+ fec_enet_txbuf_unmap(fep, bdp, skb->len); -+ } -+ dev_kfree_skb_any(skb); -+ *pskb = NULL; -+} - - static void - fec_enet_tx(struct net_device *dev) - { -- struct fec_enet_private *fep; -- volatile cbd_t *bdp; -+ struct fec_enet_private *fep = netdev_priv(dev); -+ cbd_t *bdp; - unsigned short status; -- struct sk_buff *skb; -+ struct sk_buff *skb; - -- fep = netdev_priv(dev); -- 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) - if (status & (BD_ENET_TX_HB | BD_ENET_TX_LC | - BD_ENET_TX_RL | BD_ENET_TX_UN | - BD_ENET_TX_CSL)) { -- dev->stats.tx_errors++; -+ fep->stats.tx_errors++; - if (status & BD_ENET_TX_HB) /* No heartbeat */ -- dev->stats.tx_heartbeat_errors++; -+ fep->stats.tx_heartbeat_errors++; - if (status & BD_ENET_TX_LC) /* Late collision */ -- dev->stats.tx_window_errors++; -+ fep->stats.tx_window_errors++; - if (status & BD_ENET_TX_RL) /* Retrans limit */ -- dev->stats.tx_aborted_errors++; -+ fep->stats.tx_aborted_errors++; - if (status & BD_ENET_TX_UN) /* Underrun */ -- dev->stats.tx_fifo_errors++; -+ fep->stats.tx_fifo_errors++; - if (status & BD_ENET_TX_CSL) /* Carrier lost */ -- dev->stats.tx_carrier_errors++; -+ fep->stats.tx_carrier_errors++; - } else { -- dev->stats.tx_packets++; -+ fep->stats.tx_packets++; - } - --#ifndef final_version -+#ifdef DEBUG - 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) - * 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); -- fep->tx_skbuff[fep->skb_dirty] = NULL; -+ fec_free_skb(fep, bdp, &fep->tx_skbuff[fep->skb_dirty]); - 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) - */ - if (fep->tx_full) { - fep->tx_full = 0; -- if (netif_queue_stopped(dev)) -+ if (netif_queue_stopped(dev)) { -+ DBG(0, "%s: Waking up netif queue\n", __FUNCTION__); - netif_wake_queue(dev); -+ } - } - } -- fep->dirty_tx = (cbd_t *)bdp; -- spin_unlock_irq(&fep->hw_lock); -+ fec_enet_cbd_put(fep); -+ fep->dirty_tx = bdp; -+ spin_unlock(&fep->lock); - } - - -@@ -555,22 +834,22 @@ fec_enet_tx(struct net_device *dev) - static void - fec_enet_rx(struct net_device *dev) - { -- struct fec_enet_private *fep; -- volatile fec_t *fecp; -- volatile cbd_t *bdp; -+ struct fec_enet_private *fep = netdev_priv(dev); -+ cbd_t *bdp; - unsigned short status; -- struct sk_buff *skb; -- ushort pkt_len; -- __u8 *data; -+ struct sk_buff *skb; -+ ushort pkt_len; -+ int rx_index; - - #ifdef CONFIG_M532x -+ /* This is probably nonsense -+ Proper use of dma-mapping functions should make this obsolete -+ */ - flush_cache_all(); - #endif -- -- fep = netdev_priv(dev); -- fecp = (volatile fec_t*)dev->base_addr; -- -- spin_lock_irq(&fep->hw_lock); -+ /* reserve the dual port memory area for our use */ -+ //WARN_ON(fec_reg_read(fep, FEC_RDAR) & RDAR_BUSY); -+ fec_enet_cbd_get(fep); - - /* 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) - bdp = fep->cur_rx; - - while (!((status = bdp->cbd_sc) & BD_ENET_RX_EMPTY)) { -- --#ifndef final_version -+ rx_index = bdp - fep->rx_bd_base; -+#ifdef DEBUG - /* Since we have allocated space to hold a complete frame, - * the last indicator should be set. - */ -- if ((status & BD_ENET_RX_LAST) == 0) -- printk("FEC ENET: rcv is not +last\n"); -+ WARN_ON(!(status & BD_ENET_RX_LAST)); - #endif - -- if (!fep->opened) -+ if (WARN_ON(!fep->opened)) { -+ DBG(0, "%s: Driver not opened; ignoring packet\n", __FUNCTION__); -+#if 0 - goto rx_processing_done; -- -+#endif -+ } - /* Check for errors. */ - if (status & (BD_ENET_RX_LG | BD_ENET_RX_SH | BD_ENET_RX_NO | - BD_ENET_RX_CR | BD_ENET_RX_OV)) { -- dev->stats.rx_errors++; -+ fep->stats.rx_errors++; - if (status & (BD_ENET_RX_LG | BD_ENET_RX_SH)) { - /* Frame too long or too short. */ -- dev->stats.rx_length_errors++; -+ fep->stats.rx_length_errors++; - } - if (status & BD_ENET_RX_NO) /* Frame alignment */ -- dev->stats.rx_frame_errors++; -+ fep->stats.rx_frame_errors++; - if (status & BD_ENET_RX_CR) /* CRC Error */ -- dev->stats.rx_crc_errors++; -+ fep->stats.rx_crc_errors++; - if (status & BD_ENET_RX_OV) /* FIFO overrun */ -- dev->stats.rx_fifo_errors++; -+ fep->stats.rx_fifo_errors++; - } - - /* Report late collisions as a frame error. -@@ -611,39 +892,91 @@ 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) { -- dev->stats.rx_errors++; -- dev->stats.rx_frame_errors++; -+ 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 - /* Process the incoming frame. - */ -- dev->stats.rx_packets++; -+ fep->stats.rx_packets++; - pkt_len = bdp->cbd_datlen; -- dev->stats.rx_bytes += pkt_len; -- data = (__u8*)__va(bdp->cbd_bufaddr); -- -- dma_sync_single(NULL, (unsigned long)__pa(data), -- pkt_len - 4, DMA_FROM_DEVICE); -+ fep->stats.rx_bytes += pkt_len; - - /* This does 16 byte alignment, exactly what we need. - * The packet length includes FCS, but we don't want to - * include that when passing upstream as it messes up - * bridging applications. - */ -- skb = dev_alloc_skb(pkt_len-4); -+ if ((pkt_len - 4) < fec_copy_threshold) { -+ skb = dev_alloc_skb(pkt_len); -+ } else { -+ skb = dev_alloc_skb(FEC_ENET_RX_FRSIZE); -+ } - - if (skb == NULL) { - printk("%s: Memory squeeze, dropping packet.\n", dev->name); -- dev->stats.rx_dropped++; -+ fep->stats.rx_dropped++; - } else { -- skb_put(skb,pkt_len-4); /* Make room */ -- skb_copy_to_linear_data(skb, data, pkt_len-4); -- skb->protocol=eth_type_trans(skb,dev); -+ if ((pkt_len - 4) < fec_copy_threshold) { -+ /* skip 2 bytes, so IP header is on a 4 bytes boundary */ -+ skb_reserve(skb, 2); -+ skb_put(skb, pkt_len - 4); /* Make room */ -+ fec_enet_rxbuf_get(fep, bdp, pkt_len - 4); -+ skb_copy_to_linear_data(skb, -+ fep->rx_skbuff[rx_index]->data, -+ pkt_len - 4); -+ fec_enet_rxbuf_put(fep, bdp, pkt_len - 4); -+ } else { -+ struct sk_buff *pskb = fep->rx_skbuff[rx_index]; -+ -+ /* unmap the skb we are going to hand down to the network layer */ -+ fec_enet_rxbuf_unmap(fep, bdp, FEC_ENET_RX_FRSIZE); -+ -+ /* init the newly allocated skb */ -+ fep->rx_skbuff[rx_index] = skb; -+ skb->data = FEC_ADDR_ALIGNMENT(skb->data); -+ /* map the newly allocated skb's data buffer for DMA */ -+ fec_enet_rxbuf_map(fep, bdp, skb->data, FEC_ENET_RX_FRSIZE); -+ -+ skb_put(pskb, pkt_len - 4); /* Make room */ -+ skb = pskb; -+ } -+ skb->dev = dev; -+ skb->protocol = eth_type_trans(skb, dev); - netif_rx(skb); - } - 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 - status |= BD_ENET_RX_EMPTY; - bdp->cbd_sc = status; - -+ /* release the dual port memory area for use by the FEC hardware */ -+ fec_enet_cbd_put(fep); -+ - /* Update BD pointer to next entry. - */ - if (status & BD_ENET_RX_WRAP) -@@ -665,10 +1001,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. - */ -- fecp->fec_r_des_active = 0; -+ fec_reg_write(fep, FEC_RDAR, DONT_CARE); - #endif - } /* while (!((status = bdp->cbd_sc) & BD_ENET_RX_EMPTY)) */ -- fep->cur_rx = (cbd_t *)bdp; -+ fep->cur_rx = bdp; - - #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 - * our way back to the interrupt return only to come right back - * here. - */ -- fecp->fec_r_des_active = 0; -+ fec_reg_write(fep, FEC_RDAR, DONT_CARE); - #endif -- -- spin_unlock_irq(&fep->hw_lock); - } - -- -+#ifdef CONFIG_PHYLIB - /* called from interrupt context */ -+static void fec_enet_mii(struct net_device *dev) -+{ -+ struct fec_enet_private *fep = netdev_priv(dev); -+ fep->mii_complete = 1; -+} -+#else - static void - fec_enet_mii(struct net_device *dev) - { -- struct fec_enet_private *fep; -- volatile fec_t *ep; -+ struct fec_enet_private *fep = netdev_priv(dev); - mii_list_t *mip; - uint mii_reg; - -- fep = netdev_priv(dev); -- spin_lock_irq(&fep->mii_lock); -+ mii_reg = fec_reg_read(fep, FEC_MMFR); - -- ep = fep->hwp; -- mii_reg = ep->fec_mii_data; -+ spin_lock(&fep->lock); - - if ((mip = mii_head) == NULL) { - printk("MII and no head!\n"); -@@ -713,27 +1050,27 @@ fec_enet_mii(struct net_device *dev) - mii_free = mip; - - if ((mip = mii_head) != NULL) -- ep->fec_mii_data = mip->mii_regval; -+ fec_reg_write(fep, FEC_MMFR, mip->mii_regval); - - unlock: -- spin_unlock_irq(&fep->mii_lock); -+ spin_unlock(&fep->lock); - } - - static int - mii_queue(struct net_device *dev, int regval, void (*func)(uint, struct net_device *)) - { -- struct fec_enet_private *fep; -+ struct fec_enet_private *fep = netdev_priv(dev); - unsigned long flags; - mii_list_t *mip; - int retval; - -+ retval = 0; -+ -+ spin_lock_irqsave(&fep->lock,flags); -+ - /* Add PHY address to register command. - */ -- fep = netdev_priv(dev); -- spin_lock_irqsave(&fep->mii_lock, flags); -- - regval |= fep->phy_addr << 23; -- retval = 0; - - if ((mip = mii_free) != NULL) { - mii_free = mip->mii_next; -@@ -745,32 +1082,32 @@ mii_queue(struct net_device *dev, int re - mii_tail = mip; - } else { - mii_head = mii_tail = mip; -- fep->hwp->fec_mii_data = regval; -+ fec_reg_write(fep, FEC_MMFR, regval); - } - } else { - retval = 1; - } - -- spin_unlock_irqrestore(&fep->mii_lock, flags); -- return retval; -+ spin_unlock_irqrestore(&fep->lock,flags); -+ -+ return(retval); - } - - static void mii_do_cmd(struct net_device *dev, const phy_cmd_t *c) - { -- if(!c) -- return; -+ int k; - -- for (; c->mii_data != mk_mii_end; c++) -- mii_queue(dev, c->mii_data, c->funct); -+ for (k = 0; c != NULL && c[k].mii_data != mk_mii_end; k++) { -+ mii_queue(dev, c[k].mii_data, c[k].funct); -+ } - } - - static void mii_parse_sr(uint mii_reg, struct net_device *dev) - { - struct fec_enet_private *fep = netdev_priv(dev); -- volatile uint *s = &(fep->phy_status); - uint status; - -- status = *s & ~(PHY_STAT_LINK | PHY_STAT_FAULT | PHY_STAT_ANC); -+ status = fep->phy_status & ~(PHY_STAT_LINK | PHY_STAT_FAULT | PHY_STAT_ANC); - - if (mii_reg & 0x0004) - status |= PHY_STAT_LINK; -@@ -778,31 +1115,30 @@ static void mii_parse_sr(uint mii_reg, s - status |= PHY_STAT_FAULT; - if (mii_reg & 0x0020) - status |= PHY_STAT_ANC; -- *s = status; -+ -+ fep->phy_status = status; - } - - static void mii_parse_cr(uint mii_reg, struct net_device *dev) - { - struct fec_enet_private *fep = netdev_priv(dev); -- volatile uint *s = &(fep->phy_status); - uint status; - -- status = *s & ~(PHY_CONF_ANE | PHY_CONF_LOOP); -+ status = fep->phy_status & ~(PHY_CONF_ANE | PHY_CONF_LOOP); - - if (mii_reg & 0x1000) - status |= PHY_CONF_ANE; - if (mii_reg & 0x4000) - status |= PHY_CONF_LOOP; -- *s = status; -+ fep->phy_status = status; - } - - static void mii_parse_anar(uint mii_reg, struct net_device *dev) - { - struct fec_enet_private *fep = netdev_priv(dev); -- volatile uint *s = &(fep->phy_status); - uint status; - -- status = *s & ~(PHY_CONF_SPMASK); -+ status = fep->phy_status & ~(PHY_CONF_SPMASK); - - if (mii_reg & 0x0020) - status |= PHY_CONF_10HDX; -@@ -812,7 +1148,7 @@ static void mii_parse_anar(uint mii_reg, - status |= PHY_CONF_100HDX; - if (mii_reg & 0x00100) - status |= PHY_CONF_100FDX; -- *s = status; -+ fep->phy_status = status; - } - - /* ------------------------------------------------------------------------- */ -@@ -827,10 +1163,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); -- volatile uint *s = &(fep->phy_status); - uint status; - -- status = *s & ~(PHY_STAT_SPMASK); -+ status = fep->phy_status & ~(PHY_STAT_SPMASK); - if (mii_reg & 0x0800) { - if (mii_reg & 0x1000) - status |= PHY_STAT_100FDX; -@@ -842,7 +1177,7 @@ static void mii_parse_lxt970_csr(uint mi - else - status |= PHY_STAT_10HDX; - } -- *s = status; -+ fep->phy_status = status; - } - - static phy_cmd_t const phy_cmd_lxt970_config[] = { -@@ -898,16 +1233,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); -- volatile uint *s = &(fep->phy_status); - uint status; - -- status = *s & ~(PHY_STAT_SPMASK | PHY_STAT_LINK | PHY_STAT_ANC); -+ status = fep->phy_status & ~(PHY_STAT_SPMASK | PHY_STAT_LINK | PHY_STAT_ANC); - - if (mii_reg & 0x0400) { -- fep->link = 1; -+ fep->linkstatus = 1; - status |= PHY_STAT_LINK; - } else { -- fep->link = 0; -+ fep->linkstatus = 0; - } - if (mii_reg & 0x0080) - status |= PHY_STAT_ANC; -@@ -925,7 +1259,7 @@ static void mii_parse_lxt971_sr2(uint mi - if (mii_reg & 0x0008) - status |= PHY_STAT_FAULT; - -- *s = status; -+ fep->phy_status = status; - } - - static phy_cmd_t const phy_cmd_lxt971_config[] = { -@@ -982,10 +1316,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); -- volatile uint *s = &(fep->phy_status); - uint status; - -- status = *s & ~(PHY_STAT_SPMASK); -+ status = fep->phy_status & ~(PHY_STAT_SPMASK); - - switch((mii_reg >> 2) & 7) { - case 1: status |= PHY_STAT_10HDX; break; -@@ -994,7 +1327,7 @@ static void mii_parse_qs6612_pcr(uint mi - case 6: status |= PHY_STAT_100FDX; break; - } - -- *s = status; -+ fep->phy_status = status; - } - - static phy_cmd_t const phy_cmd_qs6612_config[] = { -@@ -1052,10 +1385,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); -- volatile uint *s = &(fep->phy_status); - uint status; - -- status = *s & ~(PHY_STAT_SPMASK | PHY_STAT_ANC); -+ status = fep->phy_status & ~(PHY_STAT_SPMASK | PHY_STAT_ANC); - - if (mii_reg & 0x0080) - status |= PHY_STAT_ANC; -@@ -1064,7 +1396,7 @@ static void mii_parse_am79c874_dr(uint m - else - status |= ((mii_reg & 0x0800) ? PHY_STAT_10FDX : PHY_STAT_10HDX); - -- *s = status; -+ fep->phy_status = status; - } - - static phy_cmd_t const phy_cmd_am79c874_config[] = { -@@ -1107,7 +1439,7 @@ static phy_info_t const phy_info_am79c87 - /* register definitions for the 8721 */ - - #define MII_KS8721BL_RXERCR 21 --#define MII_KS8721BL_ICSR 27 -+#define MII_KS8721BL_ICSR 22 - #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 - static void mii_parse_dp8384x_sr2(uint mii_reg, struct net_device *dev) - { - struct fec_enet_private *fep = netdev_priv(dev); -- volatile uint *s = &(fep->phy_status); - -- *s &= ~(PHY_STAT_SPMASK | PHY_STAT_LINK | PHY_STAT_ANC); -+ fep->phy_status &= ~(PHY_STAT_SPMASK | PHY_STAT_LINK | PHY_STAT_ANC); - - /* Link up */ - if (mii_reg & 0x0001) { -- fep->link = 1; -- *s |= PHY_STAT_LINK; -+ fep->linkstatus = 1; -+ fep->phy_status |= PHY_STAT_LINK; - } else -- fep->link = 0; -+ fep->linkstatus = 0; - /* Status of link */ - if (mii_reg & 0x0010) /* Autonegotioation complete */ -- *s |= PHY_STAT_ANC; -+ fep->phy_status |= PHY_STAT_ANC; - if (mii_reg & 0x0002) { /* 10MBps? */ - if (mii_reg & 0x0004) /* Full Duplex? */ -- *s |= PHY_STAT_10FDX; -+ fep->phy_status |= PHY_STAT_10FDX; - else -- *s |= PHY_STAT_10HDX; -+ fep->phy_status |= PHY_STAT_10HDX; - } else { /* 100 Mbps? */ - if (mii_reg & 0x0004) /* Full Duplex? */ -- *s |= PHY_STAT_100FDX; -+ fep->phy_status |= PHY_STAT_100FDX; - else -- *s |= PHY_STAT_100HDX; -+ fep->phy_status |= PHY_STAT_100HDX; - } - if (mii_reg & 0x0008) -- *s |= PHY_STAT_FAULT; -+ fep->phy_status |= PHY_STAT_FAULT; - } - - static phy_info_t phy_info_dp83848= { -@@ -1211,92 +1542,362 @@ static phy_info_t const * const phy_info - &phy_info_dp83848, - NULL - }; -- --/* ------------------------------------------------------------------------- */ --#ifdef HAVE_mii_link_interrupt --static irqreturn_t --mii_link_interrupt(int irq, void * dev_id); -+#endif - - /* -- * This is specific to the MII interrupt setup of the M5272EVB. -+ * do some initializtion based architecture of this chip -+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; --} --#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) -+ 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__, -+ fep->linkstatus, phydev->link, fep->full_duplex ? "full" : "half", -+ phydev->duplex ? "full" : "half"); -+ if (phydev->link) { -+ fec_restart(dev, phydev->duplex); -+ } else { -+ fec_stop(dev); -+ } -+ if (fep->linkstatus != phydev->link && netif_msg_link(fep)) { -+ phy_print_status(phydev); -+ } -+ fep->linkstatus = phydev->link; -+#if 0 -+ int i; -+ for (i = 0; i < 32; i++) { -+ DBG(0, "%s: PHY reg[%02x]=%04x\n", __FUNCTION__, i, -+ fec_mii_read(fep->mii, fep->phy_addr, i)); -+ } -+#endif -+ } -+} -+#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; -+ 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; -+ } -+ fec_restart(dev, duplex); -+ 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]; -+ 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 fec_phy_timer(unsigned long data) - { -+ struct net_device *dev = (struct net_device *)data; - struct fec_enet_private *fep = netdev_priv(dev); -- volatile uint *s = &(fep->phy_status); -+ 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 -+ -+/* -+ * 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); -+ -+ fep->etn_irq = platform_get_irq(pdev, 0); -+ fep->mii_irq = platform_get_irq(pdev, 1); -+ -+ /* Setup interrupt handlers. */ -+ ret = request_irq(fep->etn_irq, fec_enet_interrupt, 0, "fec", dev); -+ if (ret != 0) { -+ printk(KERN_ERR "FEC: Could not allocate FEC IRQ(%d)!\n", fep->etn_irq); -+ return ret; -+ } -+#ifndef CONFIG_PHYLIB -+ if (fep->mii_irq >= 0) { -+ /* TODO: disable now due to CPLD issue */ -+ ret = request_irq(fep->mii_irq, mii_link_interrupt, 0, "fec(MII)", dev); -+ if (ret != 0) { -+ printk(KERN_ERR "FEC: Could not allocate FEC(MII) IRQ(%d)!\n", -+ fep->mii_irq); -+ free_irq(fep->etn_irq, dev); -+ return ret; -+ } -+ /* -+ * 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. -+ */ -+ fep->phy_int_enabled = 1; -+ } else { -+ fep->phy_timer = kzalloc(sizeof(struct timer_list), GFP_KERNEL); -+ if (fep->phy_timer == NULL) { -+ free_irq(fep->etn_irq, dev); -+ return -ENOMEM; -+ } -+ init_timer(fep->phy_timer); -+ fep->phy_timer->function = fec_phy_timer; -+ fep->phy_timer->data = (unsigned long)dev; -+ fec_link_change(dev); -+ } -+#endif -+ -+ return 0; -+} -+ -+static void fec_release_intrs(struct net_device *dev) -+{ -+ struct fec_enet_private *fep = netdev_priv(dev); -+ -+ free_irq(fep->etn_irq, dev); -+#ifndef CONFIG_PHYLIB -+ if (fep->mii_irq >= 0) { -+ free_irq(fep->mii_irq, dev); -+ } -+#endif -+} -+ -+#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 -+ -+#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) -+ -+#ifndef DEBUG -+static inline unsigned long fec_reg_read16(struct fec_enet_private *fep, unsigned int reg) -+{ -+ return readw(fep->reg_base + reg); -+} -+ -+static inline void fec_reg_write(struct fec_enet_private *fep, unsigned int reg, unsigned long val) -+{ -+ writew(val, fep->reg_base + reg); -+} -+#else -+#define fec_reg_read16(fep, reg) __fec_reg_read16(fep, reg, __FUNCTION__, #reg) -+#define fec_reg_write16(fep, reg, val) __fec_reg_write16(fep, reg, val, __FUNCTION__, #reg) -+ -+static inline u16 __fec_reg_read16(struct fec_enet_private *fep, unsigned int reg, -+ const char *func, const char *reg_name) -+{ -+ u16 val = readw(fep->reg_base + reg); -+ DBG(0, "%s: Read %04x from %s(%03x)\n", func, val, reg_name, reg); -+ return val; -+} -+ -+static inline void __fec_reg_write16(struct fec_enet_private *fep, unsigned int reg, -+ u16 val, const char *func, const char *reg_name) -+{ -+ DBG(0, "%s: Writing %04x to %s(%03x)\n", func, val, reg_name, reg); -+ writew(val, fep->reg_base + reg); -+} -+#endif -+ -+static void fec_localhw_setup(struct net_device *dev) -+{ -+ struct fec_enet_private *fep = netdev_priv(dev); -+ int loops; -+ const int max_loops = 10000; -+ -+ /* -+ * Set up the MII gasket for RMII mode -+ */ -+ dev_dbg(&dev->dev, "enable RMII gasket\n"); -+ -+ /* disable the gasket and wait */ -+ fec_reg_write16(fep, FEC_MIIGSK_ENR, 0); -+ DBG(0, "%s: Waiting for RMII gasket idle\n", __FUNCTION__); -+ while (fec_reg_read16(fep, FEC_MIIGSK_ENR) & FEC_MIIGSK_ENR_READY) -+ udelay(1); -+ DBG(0, "%s: RMII gasket idle\n", __FUNCTION__); -+ -+ /* 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); -+ -+#if 1 -+ DBG(0, "%s: Waiting for RMII gasket ready\n", __FUNCTION__); -+ for (loops = 0; loops < max_loops; loops++) { -+ if (readw(fep->reg_base + FEC_MIIGSK_ENR) & FEC_MIIGSK_ENR_READY) -+ break; -+ udelay(1); -+ } -+ if (fec_reg_read16(fep, FEC_MIIGSK_ENR) & FEC_MIIGSK_ENR_READY) { -+ DBG(0, "%s: RMII gasket ready after %u loops\n", __FUNCTION__, loops); -+ } else { -+ DBG(0, "%s: RMII gasket NOT ready after %u loops\n", __FUNCTION__, loops); -+ } -+#endif -+} -+#else -+static inline void fec_localhw_setup(struct net_device *dev) -+{ -+} -+#endif -+ -+static int fec_set_mii(struct net_device *dev, struct fec_enet_private *fep) -+{ -+ unsigned long rate; -+ struct clk *clk; -+ -+ DBG(0, "%s: \n", __FUNCTION__); -+ -+ fec_reg_write(fep, FEC_RCR, OPT_FRAME_SIZE | RCR_MII_MODE); -+ fec_reg_write(fep, FEC_TCR, 0x00); -+ -+ /* -+ * Set MII speed to 2.5 MHz -+ */ -+ clk = clk_get(fep->dma_dev, NULL); -+ if (!IS_ERR(clk)) { -+ rate = clk_get_rate(clk); -+ clk_put(clk); -+ } else { -+ printk(KERN_ERR "Failed to get fec clock: %ld\n", PTR_ERR(clk)); -+ return PTR_ERR(clk); -+ } -+ fep->phy_speed = ((((rate + 4999999) / 2500000) / 2) & 0x3F) << 1; -+ fec_reg_write(fep, FEC_MSCR, fep->phy_speed); -+ DBG(0, "%s: clkdiv set to %u for MII clock %u at base clock %lu\n", -+ __FUNCTION__, fep->phy_speed >> 1, 2500000, rate); -+ DBG(0, "%s: actual MII clock is: %lu\n", __FUNCTION__, rate / (fep->phy_speed)); -+ -+ return 0; -+} -+ -+static const unsigned char default_mac[ETH_ALEN] = { -+ 0x00, 0x04, 0x9f, 0x00, 0x74, 0x4a, -+}; -+ -+#define FEC_IIM_BASE IO_ADDRESS(IIM_BASE_ADDR) -+static void fec_get_mac(struct net_device *dev) -+{ -+#if 1 -+ // keep bootloader assigned MAC address -+ struct fec_enet_private *fep = netdev_priv(dev); -+ unsigned long eth_addr = fec_reg_read(fep, FEC_PALR); -+ dev->dev_addr[0] = eth_addr >> 24; -+ dev->dev_addr[1] = eth_addr >> 16; -+ dev->dev_addr[2] = eth_addr >> 8; -+ dev->dev_addr[3] = eth_addr >> 0; -+ eth_addr = fec_reg_read(fep, FEC_PAUR); -+ dev->dev_addr[5] = eth_addr >> 16; -+ dev->dev_addr[4] = eth_addr >> 24; -+#else -+ int i; -+ unsigned long fec_mac_base = FEC_IIM_BASE + MXC_IIMKEY0; -+ -+ if (cpu_is_mx27_rev(CHIP_REV_2_0) > 0) { -+ fec_mac_base = FEC_IIM_BASE + MXC_IIMMAC; -+ } -+ -+ DBG(0, "%s: Reading MAC address from %08lx\n", __FUNCTION__, fec_mac_base); -+ for (i = 0; i < ETH_ALEN; i++) { -+ dev->dev_addr[ETH_ALEN - 1 - i] = __raw_readb(fec_mac_base + i * 4); -+ } -+ //memcpy(dev->dev_addr, default_mac, ETH_ALEN); -+#endif -+} -+ -+#ifdef CONFIG_PHYLIB -+static inline void fec_enable_phy_intr(struct fec_enet_private *fep) -+{ -+} -+static inline void fec_disable_phy_intr(struct fec_enet_private *fep) -+{ -+} -+static inline void fec_phy_ack_intr(struct fec_enet_private *fep) -+{ -+} -+#else -+static inline void fec_enable_phy_intr(struct fec_enet_private *fep) -+{ -+ if (!fep->phy_int_enabled) { -+ fep->phy_int_enabled = 1; -+ enable_irq(fep->mii_irq); -+ } -+} -+ -+static inline void fec_disable_phy_intr(struct fec_enet_private *fep) -+{ -+ if (fep->phy_int_enabled) { -+ disable_irq(fep->mii_irq); -+ fep->phy_int_enabled = 0; -+ } -+} -+ -+static inline void fec_phy_ack_intr(struct fec_enet_private *fep) -+{ -+ if (fep->phy_int_enabled) { -+ disable_irq(fep->mii_irq); -+ fep->phy_int_enabled = 0; -+ } -+} -+#endif -+ -+/* ------------------------------------------------------------------------- */ -+ -+#ifndef CONFIG_PHYLIB -+static void mii_display_status(struct net_device *dev) -+{ -+ struct fec_enet_private *fep = netdev_priv(dev); -+ -+ if (!fep->linkstatus && !fep->old_linkstatus) { -+ /* Link is still down - don't print anything */ - return; - } - - printk("%s: status: ", dev->name); - -- if (!fep->link) { -+ if (!fep->linkstatus) { - printk("link down"); - } else { - printk("link up"); - -- switch(*s & PHY_STAT_SPMASK) { -+ 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) -+ if (fep->phy_status & PHY_STAT_ANC) - printk(", auto-negotiation complete"); - } - -- if (*s & PHY_STAT_FAULT) -+ if (fep->phy_status & PHY_STAT_FAULT) - printk(", remote fault"); - - printk(".\n"); - } - --static void mii_display_config(struct work_struct *work) -+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; - - /* -@@ -1326,7 +1926,7 @@ static void mii_display_config(struct wo - ** the workqueue. It is thus safe to allow to reuse it. - */ - fep->mii_phy_task_queued = 0; -- printk("%s: config: auto-negotiation ", dev->name); -+ //printk("%s: config: auto-negotiation ", dev->name); - - if (status & PHY_CONF_ANE) - printk("on"); -@@ -1351,11 +1951,21 @@ static void mii_display_config(struct wo - - fep->sequence_done = 1; - } -+#endif - --static void mii_relink(struct work_struct *work) -+#ifndef CONFIG_PHYLIB -+static inline void *priv_netdev(struct fec_enet_private *fep) - { -- struct fec_enet_private *fep = container_of(work, struct fec_enet_private, phy_task); -- struct net_device *dev = fep->netdev; -+ /* ugly hack, stolen from include linux/netdevice.h */ -+ return (char *)fep - ((sizeof(struct net_device) -+ + NETDEV_ALIGN_CONST) -+ & ~NETDEV_ALIGN_CONST); -+} -+ -+static void mii_relink(struct work_struct *w) -+{ -+ struct fec_enet_private *fep = container_of(w, struct fec_enet_private, phy_task); -+ struct net_device *dev = priv_netdev(fep); - int duplex; - - /* -@@ -1363,23 +1973,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; -- fep->link = (fep->phy_status & PHY_STAT_LINK) ? 1 : 0; -+ fep->linkstatus = (fep->phy_status & PHY_STAT_LINK) ? 1 : 0; - mii_display_status(dev); -- fep->old_link = fep->link; -+ fep->old_linkstatus = fep->linkstatus; - -- if (fep->link) { -+ if (fep->linkstatus) { - duplex = 0; -- if (fep->phy_status -- & (PHY_STAT_100FDX | PHY_STAT_10FDX)) -+ if (fep->phy_status & (PHY_STAT_100FDX | PHY_STAT_10FDX)) { - duplex = 1; -+ } - fec_restart(dev, duplex); -- } else -+ } else { - fec_stop(dev); -- --#if 0 -- enable_irq(fep->mii_irq); --#endif -- -+ } - } - - /* mii_queue_relink is called in interrupt context from mii_link_interrupt */ -@@ -1429,15 +2035,14 @@ phy_cmd_t const phy_cmd_config[] = { - static void - mii_discover_phy3(uint mii_reg, struct net_device *dev) - { -- struct fec_enet_private *fep; -+ struct fec_enet_private *fep = netdev_priv(dev); - int i; - -- fep = netdev_priv(dev); - fep->phy_id |= (mii_reg & 0xffff); - printk("fec: PHY @ 0x%x, ID 0x%08x", fep->phy_addr, fep->phy_id); - -- for(i = 0; phy_info[i]; i++) { -- if(phy_info[i]->id == (fep->phy_id >> 4)) -+ for (i = 0; phy_info[i]; i++) { -+ if (phy_info[i]->id == (fep->phy_id >> 4)) - break; - } - -@@ -1456,13 +2061,9 @@ mii_discover_phy3(uint mii_reg, struct n - static void - mii_discover_phy(uint mii_reg, struct net_device *dev) - { -- struct fec_enet_private *fep; -- volatile fec_t *fecp; -+ struct fec_enet_private *fep = netdev_priv(dev); - uint phytype; - -- fep = netdev_priv(dev); -- fecp = fep->hwp; -- - 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 - */ - fep->phy_id = phytype << 16; - mii_queue(dev, mk_mii_read(MII_REG_PHYIR2), -- mii_discover_phy3); -+ mii_discover_phy3); - } else { - fep->phy_addr++; - mii_queue(dev, mk_mii_read(MII_REG_PHYIR1), -- mii_discover_phy); -+ mii_discover_phy); - } - } else { - printk("FEC: No PHY device found.\n"); - /* Disable external MII interface */ -- fecp->fec_mii_speed = fep->phy_speed = 0; --#ifdef HAVE_mii_link_interrupt -- fec_disable_phy_intr(); --#endif -+ fec_disable_phy_intr(fep); -+ fec_reg_write(fep, FEC_MSCR, 0); - } - } -+#endif - --/* This interrupt occurs when the PHY detects a link change. --*/ --#ifdef HAVE_mii_link_interrupt -+#ifndef CONFIG_PHYLIB - static irqreturn_t --mii_link_interrupt(int irq, void * dev_id) -+mii_link_interrupt(int irq, void *dev_id) - { -- struct net_device *dev = dev_id; -+ struct net_device *dev = dev_id; - struct fec_enet_private *fep = netdev_priv(dev); - -- fec_phy_ack_intr(); -+ DBG(0, "%s: \n", __FUNCTION__); - --#if 0 -- disable_irq(fep->mii_irq); /* disable now, enable later */ --#endif -+ fec_phy_ack_intr(fep); - -- mii_do_cmd(dev, fep->phy->ack_int); -- mii_do_cmd(dev, phy_cmd_relink); /* restart and display status */ -+ /* -+ * Some board will trigger phy interrupt before phy enable. -+ * And at that moment , fep->phy is not initialized. -+ */ -+ if (fep->phy) { -+ mii_do_cmd(dev, fep->phy->ack_int); -+ mii_do_cmd(dev, phy_cmd_relink); /* restart and display status */ -+ } - - return IRQ_HANDLED; - } -@@ -1511,16 +2113,31 @@ mii_link_interrupt(int irq, void * dev_i - static int - fec_enet_open(struct net_device *dev) - { -+ int ret = 0; - struct fec_enet_private *fep = netdev_priv(dev); - - /* I should reset the ring buffers here, but I don't yet know - * a simple way to do that. - */ -- fec_set_mac_address(dev); -+ DBG(0, "%s: \n", __FUNCTION__); -+ _fec_set_mac_address(dev); - -- fep->sequence_done = 0; -- fep->link = 0; -+#ifdef CONFIG_PHYLIB -+ fec_restart(dev, 0); - -+ ret = fec_connect_phy(dev, fep); -+ if (ret != 0) { -+ DBG(0, "%s: Failed to connect to PHY: %d\n", __FUNCTION__, ret); -+ return ret; -+ } -+ phy_start(fep->phy); -+ -+ fep->linkstatus = fep->phy->link; -+ //fec_restart(dev, 0); -+ DBG(0, "%s: Link status is: %d\n", __FUNCTION__, fep->linkstatus); -+#else -+ fep->linkstatus = 0; -+ fep->sequence_done = 0; - 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) - * based on this device does not implement a PHY interrupt, - * so we are never notified of link change. - */ -- fep->link = 1; -+ fep->linkstatus = 1; - } else { -- fep->link = 1; /* lets just try it and see */ -+ fep->linkstatus = 1; /* lets just try it and see */ - /* no phy, go full duplex, it's most likely a hub chip */ - fec_restart(dev, 1); - } -- -- netif_start_queue(dev); -+ fep->old_linkstatus = fep->linkstatus; -+#endif - fep->opened = 1; -- return 0; /* Success */ -+#if 1 -+ /* enable receiver */ -+ fec_reg_write(fep, FEC_RDAR, DONT_CARE); -+#endif -+ return ret; - } - - static int -@@ -1559,15 +2180,46 @@ fec_enet_close(struct net_device *dev) - { - struct fec_enet_private *fep = netdev_priv(dev); - -- /* Don't know what to do yet. -- */ -+ DBG(0, "%s: \n", __FUNCTION__); -+ - fep->opened = 0; -- netif_stop_queue(dev); -- fec_stop(dev); -+ if (fep->linkstatus) { -+ fec_stop(dev); -+ } -+#ifdef CONFIG_PHYLIB -+ if (fep->phy) { -+ DBG(0, "%s: Stopping PHY %p\n", __FUNCTION__, fep->phy); -+ phy_stop(fep->phy); - -+ DBG(0, "%s: Disconnecting PHY %p\n", __FUNCTION__, fep->phy); -+ phy_disconnect(fep->phy); -+ fep->phy = NULL; -+ } -+#endif -+#if 1 -+ /* Whack a reset. We should wait for this. -+ */ -+ fec_reg_write(fep, FEC_ECR, FEC_ECR_RESET); -+ udelay(10); -+ -+ /* Mask and clear outstanding MII command interrupts. -+ */ -+ fec_reg_write(fep, FEC_EIMR, 0); -+ fec_reg_write(fep, FEC_EIR, FEC_ENET_MII); -+ fec_disable_phy_intr(fep); -+ /* Switch off MII */ -+ fec_reg_write(fep, FEC_MSCR, 0); -+#endif - return 0; - } - -+static struct net_device_stats *fec_enet_get_stats(struct net_device *dev) -+{ -+ struct fec_enet_private *fep = netdev_priv(dev); -+ -+ return &fep->stats; -+} -+ - /* 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) - - static void set_multicast_list(struct net_device *dev) - { -- struct fec_enet_private *fep; -- volatile fec_t *ep; -+ struct fec_enet_private *fep = netdev_priv(dev); - struct dev_mc_list *dmi; - unsigned int i, j, bit, data, crc; - unsigned char hash; - -- fep = netdev_priv(dev); -- ep = fep->hwp; -- -- if (dev->flags&IFF_PROMISC) { -- ep->fec_r_cntrl |= 0x0008; -+ if (dev->flags & IFF_PROMISC) { -+ fec_reg_write(fep, FEC_RCR, fec_reg_read(fep, FEC_RCR) | RCR_PROM); - } else { - -- ep->fec_r_cntrl &= ~0x0008; -+ fec_reg_write(fep, FEC_RCR, fec_reg_read(fep, FEC_RCR) & ~RCR_PROM); - - if (dev->flags & IFF_ALLMULTI) { - /* Catch all multicast addresses, so set the - * filter to all 1's. - */ -- ep->fec_grp_hash_table_high = 0xffffffff; -- ep->fec_grp_hash_table_low = 0xffffffff; -+ fec_reg_write(fep, FEC_IAUR, ~0); -+ fec_reg_write(fep, FEC_IALR, ~0); - } else { - /* Clear filter and add the addresses in hash register. - */ -- ep->fec_grp_hash_table_high = 0; -- ep->fec_grp_hash_table_low = 0; -+ fec_reg_write(fep, FEC_IAUR, 0); -+ fec_reg_write(fep, FEC_IALR, 0); - - dmi = dev->mc_list; - -- for (j = 0; j < dev->mc_count; j++, dmi = dmi->next) -- { -+ for (j = 0; j < dev->mc_count; j++, dmi = dmi->next) { - /* Only support group multicast for now. - */ - if (!(dmi->dmi_addr[0] & 1)) -@@ -1621,13 +2268,11 @@ static void set_multicast_list(struct ne - - /* calculate crc32 value of mac address - */ -- crc = 0xffffffff; -+ crc = ~0; - -- for (i = 0; i < dmi->dmi_addrlen; i++) -- { -+ for (i = 0; i < dmi->dmi_addrlen; i++) { - data = dmi->dmi_addr[i]; -- for (bit = 0; bit < 8; bit++, data >>= 1) -- { -+ for (bit = 0; bit < 8; bit++, data >>= 1) { - crc = (crc >> 1) ^ - (((crc ^ data) & 1) ? CRC32_POLY : 0); - } -@@ -1639,9 +2284,13 @@ static void set_multicast_list(struct ne - hash = (crc >> (32 - HASH_BITS)) & 0x3f; - - if (hash > 31) -- ep->fec_grp_hash_table_high |= 1 << (hash - 32); -+ fec_reg_write(fep, FEC_IAUR, -+ fec_reg_read(fep, FEC_IAUR) | -+ (1 << (hash - 32))); - else -- ep->fec_grp_hash_table_low |= 1 << hash; -+ fec_reg_write(fep, FEC_IALR, -+ fec_reg_read(fep, FEC_IALR) | -+ (1 << hash)); - } - } - } -@@ -1650,106 +2299,272 @@ static void set_multicast_list(struct ne - /* Set a MAC change in hardware. - */ - static void --fec_set_mac_address(struct net_device *dev) -+_fec_set_mac_address(struct net_device *dev) - { -- volatile fec_t *fecp; -- -- fecp = ((struct fec_enet_private *)netdev_priv(dev))->hwp; -+ struct fec_enet_private *fep = netdev_priv(dev); - - /* Set station address. */ -- fecp->fec_addr_low = dev->dev_addr[3] | (dev->dev_addr[2] << 8) | -- (dev->dev_addr[1] << 16) | (dev->dev_addr[0] << 24); -- fecp->fec_addr_high = (dev->dev_addr[5] << 16) | -- (dev->dev_addr[4] << 24); -+ fec_reg_write(fep, FEC_PALR, dev->dev_addr[3] | (dev->dev_addr[2] << 8) | -+ (dev->dev_addr[1] << 16) | (dev->dev_addr[0] << 24)); -+ 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) -+{ -+ struct sockaddr *addr = _addr; -+ -+ if (!is_valid_ether_addr((const char *)&addr->sa_data)) { -+ printk(KERN_WARNING "Bad ethernet address: %02x:%02x:%02x:%02x:%02x:%02x\n", -+ addr->sa_data[0], addr->sa_data[1], addr->sa_data[2], addr->sa_data[3], -+ addr->sa_data[4], addr->sa_data[5]); -+ return -EINVAL; -+ } -+ printk(KERN_DEBUG "Setting MAC address to %02x:%02x:%02x:%02x:%02x:%02x\n", -+ addr->sa_data[0], addr->sa_data[1], addr->sa_data[2], addr->sa_data[3], -+ addr->sa_data[4], addr->sa_data[5]); -+ -+ memcpy(&dev->dev_addr, &addr->sa_data, ETH_ALEN); - -+ _fec_set_mac_address(dev); -+ -+ return 0; - } - -- /* -- * XXX: We need to clean up on failure exits here. -- * -- * index is only used in legacy code -- */ --int __init fec_enet_init(struct net_device *dev, int index) -+static void fec_enet_free_buffers(struct fec_enet_private *fep) -+{ -+ cbd_t *bdp = fep->rx_bd_base; -+ int i; -+ -+ DBG(0, "%s: Freeing TX bounce buffers %p\n", __FUNCTION__, fep->tx_bounce[0]); -+ kfree(fep->tx_bounce[0]); -+ memset(fep->tx_bounce, 0, TX_RING_SIZE * sizeof(void*)); -+ for (i = 0; i < RX_RING_SIZE; i++, bdp++) { -+ if (fep->rx_skbuff[i] != NULL) { -+ DBG(0, "%s: Freeing RX skb %p\n", __FUNCTION__, fep->rx_skbuff[i]); -+ fec_enet_rxbuf_unmap(fep, bdp, FEC_ENET_RX_FRSIZE); -+ kfree_skb(fep->rx_skbuff[i]); -+ fep->rx_skbuff[i] = NULL; -+ } -+ } -+} -+ -+#ifdef CONFIG_PHYLIB -+/* called by the generic PHY layer in interrupt context */ -+static int phy_regs[32] = { [0 ... ARRAY_SIZE(phy_regs) - 1] = -1}; -+static int fec_mii_read(struct mii_bus *bus, int phy_id, int regnum) - { -+ int ret; -+ struct net_device *dev = bus->priv; - struct fec_enet_private *fep = netdev_priv(dev); -- unsigned long mem_addr; -- volatile cbd_t *bdp; -- cbd_t *cbd_base; -- volatile fec_t *fecp; -- int i, j; -+ unsigned long regval = mk_mii_read(regnum) | phy_id << 23; -+ unsigned long flags; -+ int loops = 0; - -- /* Allocate memory for buffer descriptors. -- */ -- mem_addr = (unsigned long)dma_alloc_coherent(NULL, PAGE_SIZE, -- &fep->bd_dma, GFP_KERNEL); -- if (mem_addr == 0) { -- printk("FEC: allocate descriptor memory failed?\n"); -+ DBG(1, "%s: \n", __FUNCTION__); -+#if 0 -+ DBG(0, "%s: ECR: %08lx\n", __FUNCTION__, fec_reg_read(fep, FEC_ECR)); -+ DBG(0, "%s: EIR: %08lx\n", __FUNCTION__, fec_reg_read(fep, FEC_EIR)); -+ DBG(0, "%s: EIMR: %08lx\n", __FUNCTION__, fec_reg_read(fep, FEC_EIMR)); -+ DBG(0, "%s: RCR: %08lx\n", __FUNCTION__, fec_reg_read(fep, FEC_RCR)); -+ DBG(0, "%s: TCR: %08lx\n", __FUNCTION__, fec_reg_read(fep, FEC_TCR)); -+#endif -+ spin_lock_irqsave(&fep->lock, flags); -+ fep->mii_complete = 0; -+ fec_reg_write(fep, FEC_MMFR, regval); -+ spin_unlock_irqrestore(&fep->lock, flags); -+ -+ while (!fep->mii_complete) { -+ if (loops++ == 1000) { -+ DBG(1, "%s: Waiting for MII completion\n", __FUNCTION__); -+ } -+ cpu_relax(); -+ } -+ if (loops >= 1000) { -+ DBG(1, "%s: MII transaction completed\n", __FUNCTION__); -+ } -+ ret = fec_reg_read(fep, FEC_MMFR); -+ if (ret < 0) { -+ DBG(0, "%s: Failed to read PHY[%02x] reg %02x: %d\n", __FUNCTION__, -+ phy_id, regnum, ret); -+ return ret; -+ } -+ ret &= 0xffff; -+ if (phy_regs[regnum] != ret) { -+ DBG(1, "%s: Read %04x from PHY[%02x] reg %02x\n", __FUNCTION__, -+ ret, phy_id, regnum); -+ phy_regs[regnum] = ret; -+ } -+ return ret; -+} -+ -+static int fec_mii_write(struct mii_bus *bus, int phy_id, int regnum, u16 val) -+{ -+ struct net_device *dev = bus->priv; -+ struct fec_enet_private *fep = netdev_priv(dev); -+ unsigned long regval = mk_mii_write(regnum, val) | phy_id << 23; -+ unsigned long flags; -+ -+ DBG(0, "%s: \n", __FUNCTION__); -+ -+ spin_lock_irqsave(&fep->lock, flags); -+ fep->mii_complete = 0; -+ fec_reg_write(fep, FEC_MMFR, regval); -+ spin_unlock_irqrestore(&fep->lock, flags); -+ -+ while (!fep->mii_complete) { -+ cpu_relax(); -+ } -+ DBG(1, "%s: Wrote %04x to PHY[%02x] reg %02x\n", __FUNCTION__, val, phy_id, regnum); -+ return 0; -+} -+ -+static int fec_mii_reset(struct mii_bus *bus) -+{ -+ DBG(0, "%s: \n", __FUNCTION__); -+ memset(phy_regs, -1, sizeof(phy_regs)); -+ return 0; -+} -+ -+static int fec_init_phy(struct net_device *dev, struct fec_enet_private *fep) -+{ -+ int ret; -+ int i; -+ struct mii_bus *mii; -+ -+ mii = mdiobus_alloc(); -+ if (mii == NULL) { - return -ENOMEM; - } -+ mii->name = "fec mii"; -+ mii->read = fec_mii_read; -+ mii->write = fec_mii_write; -+ mii->reset = fec_mii_reset; -+ mii->priv = dev; -+ snprintf(mii->id, MII_BUS_ID_SIZE, "%x", 0); -+ mii->irq = kmalloc(sizeof(int) * PHY_MAX_ADDR, GFP_KERNEL); -+ for (i = 0; i < PHY_MAX_ADDR; i++) { -+ mii->irq[i] = fep->mii_irq >= 0 ? fep->mii_irq : PHY_POLL; -+ } -+ -+ ret = mdiobus_register(mii); -+ if (ret != 0) { -+ DBG(0, "%s: Failed to register MII bus: %d\n", __FUNCTION__, ret); -+ kfree(mii->irq); -+ mdiobus_free(mii); -+ return ret; -+ } -+ fep->phy_addr = -1; -+ DBG(0, "%s: MII bus registered\n", __FUNCTION__); -+ for (i = 0; i < PHY_MAX_ADDR; i++) { -+ if (mii->phy_map[i] != NULL) { -+ fep->phy_addr = i; -+ break; -+ } -+ } -+ if (fep->phy_addr == -1) { -+ DBG(0, "%s: No PHY found\n", __FUNCTION__); -+ return -ENODEV; -+ } -+ DBG(0, "%s: Using PHY at addr %02x\n", __FUNCTION__, fep->phy_addr); -+ fep->mii = mii; - -- spin_lock_init(&fep->hw_lock); -- spin_lock_init(&fep->mii_lock); -+ return 0; -+} - -- /* Create an Ethernet device instance. -- */ -- fecp = (volatile fec_t *)dev->base_addr; -+static int fec_connect_phy(struct net_device *dev, struct fec_enet_private *fep) -+{ -+ struct mii_bus *mii = fep->mii; - -- fep->index = index; -- fep->hwp = fecp; -- fep->netdev = dev; -+ DBG(0, "%s: Connecting PHY at addr %02x\n", __FUNCTION__, -+ fep->phy_addr); - -- /* Whack a reset. We should wait for this. -- */ -- fecp->fec_ecntrl = 1; -- udelay(10); -+ fep->phy = phy_connect(dev, dev_name(&mii->phy_map[fep->phy_addr]->dev), -+ fec_link_change, 0, mii->phy_map[fep->phy_addr]->interface); -+ if (IS_ERR(fep->phy)) { -+ int ret = PTR_ERR(fep->phy); -+ printk(KERN_ERR "%s: Could not attach to PHY\n", dev->name); -+ fep->phy = NULL; -+ return ret; -+ } -+ DBG(0, "%s: Registered PHY %s[%02x] IRQ %d with %s\n", __FUNCTION__, -+ dev_name(&fep->phy->dev), fep->phy_addr, fep->phy->irq, dev->name); - -- /* Set the Ethernet address */ --#ifdef CONFIG_M5272 -- fec_get_mac(dev); -+ return 0; -+} - #else -- { -- unsigned long l; -- l = fecp->fec_addr_low; -- dev->dev_addr[0] = (unsigned char)((l & 0xFF000000) >> 24); -- dev->dev_addr[1] = (unsigned char)((l & 0x00FF0000) >> 16); -- dev->dev_addr[2] = (unsigned char)((l & 0x0000FF00) >> 8); -- dev->dev_addr[3] = (unsigned char)((l & 0x000000FF) >> 0); -- l = fecp->fec_addr_high; -- dev->dev_addr[4] = (unsigned char)((l & 0xFF000000) >> 24); -- dev->dev_addr[5] = (unsigned char)((l & 0x00FF0000) >> 16); -- } -+static int fec_init_phy(struct net_device *dev, struct fec_enet_private *fep) -+{ -+ /* Queue up command to detect the PHY and initialize the -+ * remainder of the interface. -+ */ -+ fep->phy_id_done = 0; -+ fep->phy_addr = 0; -+ mii_queue(dev, mk_mii_read(MII_REG_PHYIR1), mii_discover_phy); -+ -+ return 0; -+} - #endif - -- cbd_base = (cbd_t *)mem_addr; -+/* Initialize the FEC Ethernet on 860T (or ColdFire 5272). -+ */ -+ /* -+ * 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; -+ struct fec_enet_private *fep = netdev_priv(dev); -+ cbd_t *bdp; -+ struct sk_buff *pskb; -+ int i; -+ void *mem; -+ -+ spin_lock_init(&fep->lock); -+ -+ /* Whack a reset. We should wait for this. - */ -- fep->rx_bd_base = cbd_base; -- fep->tx_bd_base = cbd_base + RX_RING_SIZE; -+ fec_reg_write(fep, FEC_ECR, FEC_ECR_RESET); -+ udelay(10); -+ -+ /* Set the Ethernet address. If using multiple Enets on the 8xx, -+ * this needs some work to get unique addresses. -+ * -+ * This is our default MAC address unless the user changes -+ * it via eth_mac_addr (our dev->set_mac_addr handler). -+ */ -+ fec_get_mac(dev); - - fep->dirty_tx = fep->cur_tx = fep->tx_bd_base; - fep->cur_rx = fep->rx_bd_base; - - fep->skb_cur = fep->skb_dirty = 0; - -- /* Initialize the receive buffer descriptors. -+ /* allocate memory for TX bounce buffers */ -+ mem = kzalloc(TX_RING_SIZE * FEC_ENET_TX_FRSIZE, GFP_KERNEL); -+ if (mem == NULL) { -+ return -ENOMEM; -+ } -+ -+ fec_enet_cbd_get(fep); -+ -+ /* Initialize the transmit buffer descriptors. - */ -- bdp = fep->rx_bd_base; -- for (i=0; itx_bd_base; - -- /* Allocate a page. -- */ -- mem_addr = __get_free_page(GFP_KERNEL); -- /* XXX: missing check for allocation failure */ -+ DBG(0, "%s: Allocated %d byte of TX buffer memory @ %p\n", __FUNCTION__, -+ TX_RING_SIZE * FEC_ENET_TX_FRSIZE, mem); -+ for (i = 0; i < TX_RING_SIZE; i++) { -+ fep->tx_bounce[i] = mem; -+ DBG(0, "%s: TX bounce buffer[%d]=%p\n", __FUNCTION__, i, fep->tx_bounce[i]); -+ mem = (void *)((unsigned long)(mem + FEC_ENET_TX_FRSIZE)); - - /* Initialize the BD for every fragment in the page. - */ -- for (j=0; jcbd_sc = BD_ENET_RX_EMPTY; -- bdp->cbd_bufaddr = __pa(mem_addr); -- mem_addr += FEC_ENET_RX_FRSIZE; -- bdp++; -- } -+ bdp->cbd_bufaddr = ~0; -+ bdp++; - } - - /* Set the last buffer to wrap. -@@ -1757,87 +2572,88 @@ int __init fec_enet_init(struct net_devi - bdp--; - bdp->cbd_sc |= BD_SC_WRAP; - -- /* ...and the same for transmmit. -+ /* ...and the same for receive. - */ -- bdp = fep->tx_bd_base; -- for (i=0, j=FEC_ENET_TX_FRPPG; i= FEC_ENET_TX_FRPPG) { -- mem_addr = __get_free_page(GFP_KERNEL); -- j = 1; -- } else { -- mem_addr += FEC_ENET_TX_FRSIZE; -- j++; -+ bdp = fep->rx_bd_base; -+ for (i = 0; i < RX_RING_SIZE; i++, bdp++) { -+ pskb = __dev_alloc_skb(FEC_ENET_RX_FRSIZE, GFP_KERNEL); -+ if (pskb == NULL) { -+ DBG(0, "%s: Failed to allocate RX skb; cleaning up\n", __FUNCTION__); -+ ret = -ENOMEM; -+ goto cleanup; - } -- fep->tx_bounce[i] = (unsigned char *) mem_addr; -- -- /* Initialize the BD for every fragment in the page. -- */ -- bdp->cbd_sc = 0; -- bdp->cbd_bufaddr = 0; -- bdp++; -+ DBG(0, "%s: RX skb allocated @ %p\n", __FUNCTION__, pskb); -+ fep->rx_skbuff[i] = pskb; -+ pskb->data = FEC_ADDR_ALIGNMENT(pskb->data); -+ bdp->cbd_sc = BD_ENET_RX_EMPTY; -+ bdp->cbd_bufaddr = ~0; -+ fec_enet_rxbuf_map(fep, bdp, pskb->data, FEC_ENET_RX_FRSIZE); - } -- - /* Set the last buffer to wrap. - */ - bdp--; - bdp->cbd_sc |= BD_SC_WRAP; -+ fec_enet_cbd_put(fep); - - /* Set receive and transmit descriptor base. - */ -- fecp->fec_r_des_start = fep->bd_dma; -- fecp->fec_x_des_start = (unsigned long)fep->bd_dma + sizeof(cbd_t) -- * RX_RING_SIZE; -- --#ifdef HAVE_mii_link_interrupt -- fec_request_mii_intr(dev); --#endif -- -- fecp->fec_grp_hash_table_high = 0; -- fecp->fec_grp_hash_table_low = 0; -- fecp->fec_r_buff_size = PKT_MAXBLR_SIZE; -- fecp->fec_ecntrl = 2; -- fecp->fec_r_des_active = 0; --#ifndef CONFIG_M5272 -- fecp->fec_hash_table_high = 0; -- fecp->fec_hash_table_low = 0; --#endif -+ fec_reg_write(fep, FEC_ERDSR, fep->cbd_phys_base); -+ fec_reg_write(fep, FEC_ETDSR, fep->cbd_phys_base + RX_RING_SIZE * sizeof(cbd_t)); - -+ /* Install our interrupt handlers. This varies depending on -+ * the architecture. -+ */ -+ ret = fec_request_intrs(pdev, dev); -+ if (ret != 0) { -+ goto cleanup; -+ } -+ /* Clear and enable interrupts */ -+ fec_reg_write(fep, FEC_EIR, fec_reg_read(fep, FEC_EIR)); -+ fec_reg_write(fep, FEC_EIMR, FEC_ENET_TXF | FEC_ENET_TXB | -+ FEC_ENET_RXF | FEC_ENET_RXB | FEC_ENET_MII); -+ -+ fec_reg_write(fep, FEC_IAUR, 0); -+ fec_reg_write(fep, FEC_IALR, 0); -+ fec_reg_write(fep, FEC_EMRBR, PKT_MAXBLR_SIZE); -+ fec_reg_write(fep, FEC_ECR, FEC_ECR_ETHER_EN); -+ fec_localhw_setup(dev); -+#if 0 -+ /* do this in enet_open()! */ -+ fec_reg_write(fep, FEC_RDAR, DONT_CARE); -+#endif - /* The FEC Ethernet specific entries in the device structure. */ - dev->open = fec_enet_open; - dev->hard_start_xmit = fec_enet_start_xmit; - dev->tx_timeout = fec_timeout; - dev->watchdog_timeo = TX_TIMEOUT; - dev->stop = fec_enet_close; -+ dev->get_stats = fec_enet_get_stats; - dev->set_multicast_list = set_multicast_list; -+ dev->set_mac_address = fec_set_mac_address; - -- for (i=0; ifec_r_cntrl = OPT_FRAME_SIZE | 0x04; -- fecp->fec_x_cntrl = 0x00; -- -- /* -- * Set MII speed to 2.5 MHz -- */ -- fep->phy_speed = ((((clk_get_rate(fep->clk) / 2 + 4999999) -- / 2500000) / 2) & 0x3F) << 1; -- fecp->fec_mii_speed = fep->phy_speed; -- fec_restart(dev, 0); -- -- /* Clear and enable interrupts */ -- fecp->fec_ievent = 0xffc00000; -- fecp->fec_imask = (FEC_ENET_TXF | FEC_ENET_RXF | FEC_ENET_MII); -- -- /* Queue up command to detect the PHY and initialize the -- * remainder of the interface. -- */ -- fep->phy_id_done = 0; -- fep->phy_addr = 0; -- mii_queue(dev, mk_mii_read(MII_REG_PHYIR1), mii_discover_phy); -+ ret = fec_set_mii(dev, fep); -+ if (ret) { -+ DBG(0, "%s: Failed to initialize MII interface: %d\n", __FUNCTION__, ret); -+ goto cleanup; -+ } - -+ ret = fec_init_phy(dev, fep); -+ if (ret) { -+ DBG(0, "%s: Failed to initialize PHY: %d\n", __FUNCTION__, ret); -+ goto cleanup; -+ } - return 0; -+ cleanup: -+ fec_enet_free_buffers(fep); -+ fec_enet_cbd_put(fep); -+ return ret; - } - - /* 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 - static void - fec_restart(struct net_device *dev, int duplex) - { -- struct fec_enet_private *fep; -- volatile cbd_t *bdp; -- volatile fec_t *fecp; -+ struct fec_enet_private *fep = netdev_priv(dev); -+ cbd_t *bdp; - int i; -+ u32 rcr = OPT_FRAME_SIZE | RCR_MII_MODE; /* MII enable */ -+ u32 tcr = TCR_HBC; - -- fep = netdev_priv(dev); -- fecp = fep->hwp; -- -+ DBG(0, "%s: Restarting FEC in %s-duplex mode\n", __FUNCTION__, -+ duplex ? "full" : "half"); - /* Whack a reset. We should wait for this. -- */ -- fecp->fec_ecntrl = 1; -+ */ -+ fec_reg_write(fep, FEC_ECR, FEC_ECR_RESET); - udelay(10); - -+ /* Enable interrupts we wish to service. -+ */ -+ fec_reg_write(fep, FEC_EIMR, FEC_ENET_TXF | FEC_ENET_TXB | -+ FEC_ENET_RXF | FEC_ENET_RXB | FEC_ENET_MII); -+ - /* Clear any outstanding interrupt. -- */ -- fecp->fec_ievent = 0xffc00000; -+ * -+ */ -+ fec_reg_write(fep, FEC_EIR, FEC_ENET_MASK); -+ -+ fec_enable_phy_intr(fep); - - /* Set station address. -- */ -- fec_set_mac_address(dev); -+ */ -+ _fec_set_mac_address(dev); - - /* Reset all multicast. -- */ -- fecp->fec_grp_hash_table_high = 0; -- fecp->fec_grp_hash_table_low = 0; -+ */ -+ fec_reg_write(fep, FEC_IAUR, 0); -+ fec_reg_write(fep, FEC_IALR, 0); - - /* Set maximum receive buffer size. -- */ -- fecp->fec_r_buff_size = PKT_MAXBLR_SIZE; -+ */ -+ fec_reg_write(fep, FEC_EMRBR, PKT_MAXBLR_SIZE); - - /* Set receive and transmit descriptor base. -- */ -- fecp->fec_r_des_start = fep->bd_dma; -- fecp->fec_x_des_start = (unsigned long)fep->bd_dma + sizeof(cbd_t) -- * RX_RING_SIZE; -+ */ -+ fec_reg_write(fep, FEC_ERDSR, fep->cbd_phys_base); -+ fec_reg_write(fep, FEC_ETDSR, fep->cbd_phys_base + RX_RING_SIZE * sizeof(cbd_t)); - - fep->dirty_tx = fep->cur_tx = fep->tx_bd_base; - fep->cur_rx = fep->rx_bd_base; - - /* Reset SKB transmit buffers. -- */ -+ */ - fep->skb_cur = fep->skb_dirty = 0; -- for (i=0; i<=TX_RING_MOD_MASK; i++) { -+ bdp = fep->tx_bd_base; -+ for (i = 0; i <= TX_RING_MOD_MASK; i++) { - if (fep->tx_skbuff[i] != NULL) { -- dev_kfree_skb_any(fep->tx_skbuff[i]); -- fep->tx_skbuff[i] = NULL; -+ fec_free_skb(fep, bdp, &fep->tx_skbuff[i]); -+ bdp++; - } - } - - /* Initialize the receive buffer descriptors. -- */ -+ */ - bdp = fep->rx_bd_base; -- for (i=0; icbd_sc = BD_ENET_RX_EMPTY; -@@ -1908,246 +2731,366 @@ fec_restart(struct net_device *dev, int - } - - /* Set the last buffer to wrap. -- */ -+ */ - bdp--; - bdp->cbd_sc |= BD_SC_WRAP; - - /* ...and the same for transmmit. -- */ -+ */ - bdp = fep->tx_bd_base; -- for (i=0; icbd_sc = 0; -- bdp->cbd_bufaddr = 0; -+ bdp->cbd_bufaddr = ~0; - bdp++; - } - - /* Set the last buffer to wrap. -- */ -+ */ - bdp--; - bdp->cbd_sc |= BD_SC_WRAP; - - /* Enable MII mode. -- */ -+ */ - if (duplex) { -- fecp->fec_r_cntrl = OPT_FRAME_SIZE | 0x04;/* MII enable */ -- fecp->fec_x_cntrl = 0x04; /* FD enable */ -+ tcr |= TCR_FDEN; /* FD enable */ - } else { -- /* MII enable|No Rcv on Xmit */ -- fecp->fec_r_cntrl = OPT_FRAME_SIZE | 0x06; -- fecp->fec_x_cntrl = 0x00; -+ rcr |= RCR_DRT; /* No Rcv on Xmit */ - } -+ fec_reg_write(fep, FEC_RCR, rcr); -+ fec_reg_write(fep, FEC_TCR, tcr); - fep->full_duplex = duplex; - - /* Set MII speed. -- */ -- fecp->fec_mii_speed = fep->phy_speed; -+ */ -+ fec_reg_write(fep, FEC_MSCR, fep->phy_speed); - - /* And last, enable the transmit and receive processing. -- */ -- fecp->fec_ecntrl = 2; -- fecp->fec_r_des_active = 0; -+ */ -+ fec_reg_write(fep, FEC_ECR, FEC_ECR_ETHER_EN); -+ fec_localhw_setup(dev); -+ fec_reg_write(fep, FEC_RDAR, DONT_CARE); - -- /* Enable interrupts we wish to service. -- */ -- fecp->fec_imask = (FEC_ENET_TXF | FEC_ENET_RXF | FEC_ENET_MII); -+ DBG(0, "%s: Starting netif queue\n", __FUNCTION__); -+ netif_start_queue(dev); - } - - static void - fec_stop(struct net_device *dev) - { -- volatile fec_t *fecp; -- struct fec_enet_private *fep; -+ struct fec_enet_private *fep = netdev_priv(dev); - -- fep = netdev_priv(dev); -- fecp = fep->hwp; -+ DBG(0, "%s: Stopping netif queue\n", __FUNCTION__); -+ netif_stop_queue(dev); - - /* -- ** We cannot expect a graceful transmit stop without link !!! -- */ -- if (fep->link) -- { -- fecp->fec_x_cntrl = 0x01; /* Graceful transmit stop */ -+ * We cannot expect a graceful transmit stop without link! -+ */ -+ if (fep->linkstatus) { -+ fec_reg_write(fep, FEC_TCR, 0x01); /* Graceful transmit stop */ - udelay(10); -- if (!(fecp->fec_ievent & FEC_ENET_GRA)) -- printk("fec_stop : Graceful transmit stop did not complete !\n"); -- } -- -+ if (!(fec_reg_read(fep, FEC_EIR) & FEC_ENET_GRA)) -+ dev_warn(&dev->dev, "Graceful transmit stop did not complete!\n"); -+ } -+#if 0 - /* Whack a reset. We should wait for this. -- */ -- fecp->fec_ecntrl = 1; -+ */ -+ fec_reg_write(fep, FEC_ECR, FEC_ECR_RESET); - udelay(10); -- -- /* Clear outstanding MII command interrupts. -- */ -- fecp->fec_ievent = FEC_ENET_MII; -- -- fecp->fec_imask = FEC_ENET_MII; -- fecp->fec_mii_speed = fep->phy_speed; -+ /* Mask and clear outstanding MII command interrupts. -+ */ -+ fec_reg_write(fep, FEC_EIMR, 0); -+ fec_reg_write(fep, FEC_EIR, FEC_ENET_MII); -+ fec_enable_phy_intr(fep); -+ fec_reg_write(fep, FEC_MSCR, fep->phy_speed); -+#endif - } - --static int __devinit --fec_probe(struct platform_device *pdev) -+static int __devinit fec_enet_probe(struct platform_device *pdev) - { -+ int ret; - struct fec_enet_private *fep; -- struct net_device *ndev; -- int i, irq, ret = 0; -- struct resource *r; -- -- r = platform_get_resource(pdev, IORESOURCE_MEM, 0); -- if (!r) -- return -ENXIO; -+ struct net_device *dev; -+ struct fec_enet_platform_data *pdata = pdev->dev.platform_data; -+ struct resource *res_mem1; -+ struct resource *res_mem2; -+ -+ res_mem1 = platform_get_resource(pdev, IORESOURCE_MEM, 0); -+ if (res_mem1 == NULL) { -+ return -ENODEV; -+ } - -- r = request_mem_region(r->start, resource_size(r), pdev->name); -- if (!r) -+ res_mem1 = request_mem_region(res_mem1->start, -+ resource_size(res_mem1), -+ DRV_NAME); -+ if (res_mem1 == NULL) { - return -EBUSY; -+ } -+ res_mem2 = platform_get_resource(pdev, IORESOURCE_MEM, 1); -+ if (res_mem2 != NULL) { -+ res_mem2 = request_mem_region(res_mem2->start, -+ resource_size(res_mem2), -+ DRV_NAME); -+ if (res_mem2 == NULL) { -+ ret = -EBUSY; -+ goto release1; -+ } -+ } - -- /* Init network device */ -- ndev = alloc_etherdev(sizeof(struct fec_enet_private)); -- if (!ndev) -- return -ENOMEM; -- -- SET_NETDEV_DEV(ndev, &pdev->dev); -- -- /* setup board info structure */ -- fep = netdev_priv(ndev); -- memset(fep, 0, sizeof(*fep)); -+ dev = alloc_etherdev(sizeof(struct fec_enet_private)); -+ if (dev == NULL) { -+ ret = -ENOMEM; -+ goto release2; -+ } -+ platform_set_drvdata(pdev, dev); -+ fep = netdev_priv(dev); -+ fep->res_mem1 = res_mem1; -+ fep->res_mem2 = res_mem2; -+ fep->dma_dev = &pdev->dev; -+ -+ fep->reg_base = ioremap(res_mem1->start, resource_size(res_mem1)); -+ if (fep->reg_base == NULL) { -+ printk("FEC: Mapping FEC registers failed\n"); -+ ret = -ENOMEM; -+ goto free_netdev; -+ } -+ DBG(0, "%s: FEC registers @ %08lx mapped to %p\n", __FUNCTION__, -+ (unsigned long)res_mem1->start, fep->reg_base); - -- ndev->base_addr = (unsigned long)ioremap(r->start, resource_size(r)); -+ fep->mib_base = ioremap(res_mem2->start, resource_size(res_mem2)); -+ if (fep->mib_base == NULL) { -+ printk("FEC: Mapping FEC registers failed\n"); -+ ret = -ENOMEM; -+ goto unmap1; -+ } -+ DBG(0, "%s: FEC registers @ %08lx mapped to %p\n", __FUNCTION__, -+ (unsigned long)res_mem2->start, fep->mib_base); - -- if (!ndev->base_addr) { -+ /* Allocate memory for buffer descriptors. */ -+ fep->cbd_mem_base = dma_alloc_coherent(&pdev->dev, CBD_BUF_SIZE, -+ &fep->cbd_phys_base, -+ GFP_KERNEL); -+ if (fep->cbd_mem_base == NULL) { -+ printk("FEC: allocate descriptor memory failed\n"); - ret = -ENOMEM; -- goto failed_ioremap; -+ goto unmap2; - } -+ DBG(0, "%s: Allocated %lu [(%u + %lu) * %d] byte for CBD buffer @ %p[%08lx]\n", -+ __FUNCTION__, CBD_BUF_SIZE, TX_RING_SIZE, RX_RING_SIZE, -+ sizeof(cbd_t), fep->cbd_mem_base, -+ (unsigned long)fep->cbd_phys_base); - -- platform_set_drvdata(pdev, ndev); -+ /* Set receive and transmit descriptor base. -+ */ -+ fep->rx_bd_base = fep->cbd_mem_base; -+ fep->tx_bd_base = fep->rx_bd_base + RX_RING_SIZE; - -- /* This device has up to three irqs on some platforms */ -- for (i = 0; i < 3; i++) { -- irq = platform_get_irq(pdev, i); -- if (i && irq < 0) -- break; -- ret = request_irq(irq, fec_enet_interrupt, IRQF_DISABLED, pdev->name, ndev); -- if (ret) { -- while (i >= 0) { -- irq = platform_get_irq(pdev, i); -- free_irq(irq, ndev); -- i--; -- } -- goto failed_irq; -- } -+ printk("FEC ENET Driver\n"); -+ ret = platform_func(pdata->arch_init, pdev); -+ if (ret != 0) { -+ dev_err(&pdev->dev, "platform init failed: %d\n", ret); -+ goto free_dma; - } - -- fep->clk = clk_get(&pdev->dev, "fec_clk"); -- if (IS_ERR(fep->clk)) { -- ret = PTR_ERR(fep->clk); -- goto failed_clk; -+ ret = fec_enet_init(pdev, dev); -+ if (ret != 0) { -+ goto fec_disable; - } -- clk_enable(fep->clk); - -- ret = fec_enet_init(ndev, 0); -- if (ret) -- goto failed_init; -+ /* Enable most messages by default */ -+ fep->msg_enable = (NETIF_MSG_IFUP << 1) - 1; -+ ret = register_netdev(dev); -+ if (ret != 0) { -+ /* XXX: missing cleanup here */ -+ goto free_buffers; -+ } - -- ret = register_netdev(ndev); -- if (ret) -- goto failed_register; -+ printk(KERN_INFO "%s: ethernet %02x:%02x:%02x:%02x:%02x:%02x\n", dev->name, -+ dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2], -+ dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5]); - - return 0; - --failed_register: --failed_init: -- clk_disable(fep->clk); -- clk_put(fep->clk); --failed_clk: -- for (i = 0; i < 3; i++) { -- irq = platform_get_irq(pdev, i); -- if (irq > 0) -- free_irq(irq, ndev); -- } --failed_irq: -- iounmap((void __iomem *)ndev->base_addr); --failed_ioremap: -- free_netdev(ndev); -+ free_buffers: -+ fec_enet_free_buffers(fep); -+ -+ fec_disable: -+ platform_func(pdata->arch_exit, pdev); -+ -+ free_dma: -+ dma_free_coherent(&pdev->dev, CBD_BUF_SIZE, fep->cbd_mem_base, fep->cbd_phys_base); -+ -+ unmap2: -+ if (fep->mib_base) -+ iounmap(fep->mib_base); -+ -+ unmap1: -+ iounmap(fep->reg_base); -+ -+ free_netdev: -+ free_netdev(dev); -+ -+ release2: -+ if (res_mem2 != NULL) { -+ release_resource(res_mem2); -+ } -+ -+ release1: -+ release_resource(res_mem1); - - return ret; - } - --static int __devexit --fec_drv_remove(struct platform_device *pdev) -+static int __devexit fec_enet_remove(struct platform_device *pdev) - { -- struct net_device *ndev = platform_get_drvdata(pdev); -- struct fec_enet_private *fep = netdev_priv(ndev); -+ struct net_device *dev = platform_get_drvdata(pdev); -+ 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); -+ mdiobus_unregister(fep->mii); -+ } -+ mdiobus_free(fep->mii); -+#endif -+ fec_release_intrs(dev); -+ -+ DBG(0, "%s: Unmapping FEC registers %p\n", __FUNCTION__, fep->reg_base); -+ iounmap(fep->reg_base); -+ if (fep->mib_base) -+ iounmap(fep->mib_base); -+ -+ fec_enet_free_buffers(fep); - -- platform_set_drvdata(pdev, NULL); -+ DBG(0, "%s: Freeing CBD buffer area %p[%08lx]\n", __FUNCTION__, -+ fep->cbd_mem_base, (unsigned long)fep->cbd_phys_base); -+ dma_free_coherent(&pdev->dev, CBD_BUF_SIZE, fep->cbd_mem_base, fep->cbd_phys_base); - -- fec_stop(ndev); -- clk_disable(fep->clk); -- clk_put(fep->clk); -- iounmap((void __iomem *)ndev->base_addr); -- unregister_netdev(ndev); -- free_netdev(ndev); -+ release_resource(fep->res_mem1); -+ if (fep->res_mem2 != NULL) { -+ release_resource(fep->res_mem2); -+ } - return 0; - } - --static int --fec_suspend(struct platform_device *dev, pm_message_t state) -+static void fec_enet_shutdown(struct platform_device *pdev) - { -- struct net_device *ndev = platform_get_drvdata(dev); -- struct fec_enet_private *fep; -+ struct fec_enet_platform_data *pdata = pdev->dev.platform_data; -+ -+ DBG(0, "%s: Shutting down FEC Hardware\n", __FUNCTION__); -+ platform_func(pdata->arch_exit, pdev); -+} -+ -+#ifdef CONFIG_PM -+static int fec_enet_suspend(struct platform_device *pdev, pm_message_t state) -+{ -+ int ret; -+ struct fec_enet_platform_data *pdata = pdev->dev.platform_data; -+ struct net_device *ndev = platform_get_drvdata(pdev); -+ struct fec_enet_private *fep = netdev_priv(ndev); - -- if (ndev) { -- fep = netdev_priv(ndev); -- if (netif_running(ndev)) { -- netif_device_detach(ndev); -- fec_stop(ndev); -+ if (netif_running(ndev)) { -+ DBG(0, "%s: Detaching netif\n", __FUNCTION__); -+ netif_device_detach(ndev); -+#ifdef CONFIG_PHYLIB -+ DBG(0, "%s: Disconnecting PHY %p\n", __FUNCTION__, fep->phy); -+ phy_disconnect(fep->phy); -+ fep->phy = NULL; -+#endif -+ } -+#ifndef CONFIG_PHYLIB -+ if (fep->phy_timer) { -+ ret = del_timer_sync(fep->phy_timer); -+ if (ret != 0) { -+ DBG(0, "%s: Failed to delete PHY timer: %d\n", __FUNCTION__, ret); -+ return ret; - } - } -- return 0; -+#endif -+ DBG(0, "%s: Shutting down FEC Hardware %d\n", __FUNCTION__, -+ netif_running(ndev)); -+ ret = platform_func(pdata->suspend, pdev); -+ if (ret != 0 && netif_running(ndev)) { -+ DBG(0, "%s: Failed to suspend: %d\n", __FUNCTION__, ret); -+ /* Undo suspend */ -+#ifdef CONFIG_PHYLIB -+ DBG(0, "%s: Reconnecting PHY\n", __FUNCTION__); -+ if (fec_connect_phy(ndev, fep) != 0) { -+ DBG(0, "%s: Failed to connect to PHY\n", __FUNCTION__); -+ return ret; -+ } -+ phy_start(fep->phy); -+#endif -+ fec_link_change(ndev); -+ netif_device_attach(ndev); -+ } -+ return ret; - } - --static int --fec_resume(struct platform_device *dev) -+static int fec_enet_resume(struct platform_device *pdev) - { -- struct net_device *ndev = platform_get_drvdata(dev); -+ int ret; -+ struct fec_enet_platform_data *pdata = pdev->dev.platform_data; -+ struct net_device *ndev = platform_get_drvdata(pdev); - -- if (ndev) { -- if (netif_running(ndev)) { -- fec_enet_init(ndev, 0); -- netif_device_attach(ndev); -+ DBG(0, "%s: Powering up FEC Hardware %d\n", __FUNCTION__, -+ netif_running(ndev)); -+ ret = platform_func(pdata->resume, pdev); -+ if (ret != 0) { -+ DBG(0, "%s: Failed to resume: %d\n", __FUNCTION__, ret); -+ return ret; -+ } -+ if (netif_running(ndev)) { -+#ifdef CONFIG_PHYLIB -+ struct fec_enet_private *fep = netdev_priv(ndev); -+ -+ DBG(0, "%s: Reconnecting PHY\n", __FUNCTION__); -+ ret = fec_connect_phy(ndev, fep); -+ if (ret != 0) { -+ DBG(0, "%s: Failed to connect to PHY: %d\n", __FUNCTION__, ret); -+ return ret; - } -+ phy_start(fep->phy); -+#endif -+ fec_link_change(ndev); -+ netif_device_attach(ndev); - } - return 0; - } -+#else -+#define fec_enet_suspend NULL -+#define fec_enet_resume NULL -+#endif - --static struct platform_driver fec_driver = { -- .driver = { -- .name = "fec", -- .owner = THIS_MODULE, -+static struct platform_driver fec_enet_driver = { -+ .driver = { -+ .name = DRV_NAME, - }, -- .probe = fec_probe, -- .remove = __devexit_p(fec_drv_remove), -- .suspend = fec_suspend, -- .resume = fec_resume, -+ .probe = fec_enet_probe, -+ .remove = __devexit_p(fec_enet_remove), -+ .shutdown = fec_enet_shutdown, -+ .suspend = fec_enet_suspend, -+ .resume = fec_enet_resume, - }; - --static int __init --fec_enet_module_init(void) -+static int __init fec_enet_module_init(void) - { -- printk(KERN_INFO "FEC Ethernet Driver\n"); -+ int ret; -+ -+ ret = platform_driver_register(&fec_enet_driver); - -- return platform_driver_register(&fec_driver); -+ return ret; - } -+module_init(fec_enet_module_init); - --static void __exit --fec_enet_cleanup(void) -+static void __exit fec_enet_module_cleanup(void) - { -- platform_driver_unregister(&fec_driver); -+ platform_driver_unregister(&fec_enet_driver); - } -- --module_exit(fec_enet_cleanup); --module_init(fec_enet_module_init); -+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 18:43:03.000000000 +0200 -@@ -13,6 +13,15 @@ - #define FEC_H - /****************************************************************************/ - -+/* -+ * dummy value to write into RDAR,TDAR. FEC hardware will scan the TX/RX -+ * descriptors in memory upon any write access to those registers. -+ * The actual value written to those registers does not matter. -+*/ -+#define DONT_CARE 0 -+#define RDAR_BUSY (1 << 24) -+#define TDAR_BUSY (1 << 24) -+ - #if defined(CONFIG_M523x) || defined(CONFIG_M527x) || defined(CONFIG_M528x) || \ - defined(CONFIG_M520x) || defined(CONFIG_M532x) || defined(CONFIG_ARCH_MXC) - /* -@@ -20,6 +29,36 @@ - * registers in the same peripheral device on different models - * of the ColdFire! - */ -+// relying on structure alignment for hardware register is just evil -+#ifndef GARBAGE -+#define FEC_EIR 0x004 -+#define FEC_EIMR 0x008 -+#define FEC_RDAR 0x010 -+#define FEC_TDAR 0x014 -+#define FEC_ECR 0x024 -+#define FEC_MMFR 0x040 -+#define FEC_MSCR 0x044 -+#define FEC_MIBC 0x064 -+#define FEC_RCR 0x084 -+#define FEC_TCR 0x0c4 -+#define FEC_PALR 0x0e4 -+#define FEC_PAUR 0x0e8 -+#define FEC_OPD 0x0ec -+#define FEC_IAUR 0x118 -+#define FEC_IALR 0x11c -+#define FEC_GAUR 0x120 -+#define FEC_GALR 0x124 -+#define FEC_TFWR 0x144 -+#define FEC_FRBR 0x14c -+#define FEC_FRSR 0x150 -+#define FEC_ERDSR 0x180 -+#define FEC_ETDSR 0x184 -+#define FEC_EMRBR 0x188 -+ -+#define FEC_ECR_RESET (1 << 0) -+#define FEC_ECR_ETHER_EN (1 << 1) -+#else -+ - typedef struct fec { - unsigned long fec_reserved0; - unsigned long fec_ievent; /* Interrupt event reg */ -@@ -57,6 +96,7 @@ typedef struct fec { - unsigned long fec_x_des_start; /* Transmit descriptor ring */ - unsigned long fec_r_buff_size; /* Maximum receive buff size */ - } fec_t; -+#endif - - #else - -@@ -88,8 +128,8 @@ typedef struct fec { - unsigned long fec_reserved7[158]; - unsigned long fec_addr_low; /* Low 32bits MAC address */ - unsigned long fec_addr_high; /* High 16bits MAC address */ -- unsigned long fec_grp_hash_table_high;/* High 32bits hash table */ -- unsigned long fec_grp_hash_table_low; /* Low 32bits hash table */ -+ unsigned long fec_hash_table_high; /* High 32bits hash table */ -+ unsigned long fec_hash_table_low; /* Low 32bits hash table */ - unsigned long fec_r_des_start; /* Receive descriptor ring */ - unsigned long fec_x_des_start; /* Transmit descriptor ring */ - unsigned long fec_r_buff_size; /* Maximum receive buff size */ -@@ -103,17 +143,20 @@ typedef struct fec { - /* - * Define the buffer descriptor structure. - */ --#ifdef CONFIG_ARCH_MXC -+/* Please see "Receive Buffer Descriptor Field Definitions" in Specification. -+ * It's LE. -+ */ -+#if defined(CONFIG_ARCH_MXC) - typedef struct bufdesc { -- unsigned short cbd_datlen; /* Data length */ -- unsigned short cbd_sc; /* Control and status info */ -- unsigned long cbd_bufaddr; /* Buffer address */ -+ unsigned short cbd_datlen; /* Data length */ -+ unsigned short cbd_sc; /* Control and status info */ -+ dma_addr_t cbd_bufaddr; /* Buffer address as seen by FEC Hardware */ - } cbd_t; - #else - typedef struct bufdesc { - unsigned short cbd_sc; /* Control and status info */ - unsigned short cbd_datlen; /* Data length */ -- unsigned long cbd_bufaddr; /* Buffer address */ -+ dma_addr_t cbd_bufaddr; /* Buffer address */ - } cbd_t; - #endif - -@@ -121,7 +164,7 @@ typedef struct bufdesc { - * The following definitions courtesy of commproc.h, which where - * Copyright (c) 1997 Dan Malek (dmalek@jlc.net). - */ --#define BD_SC_EMPTY ((ushort)0x8000) /* Recieve is empty */ -+#define BD_SC_EMPTY ((ushort)0x8000) /* Receive is empty */ - #define BD_SC_READY ((ushort)0x8000) /* Transmit is ready */ - #define BD_SC_WRAP ((ushort)0x2000) /* Last buffer descriptor */ - #define BD_SC_INTRPT ((ushort)0x1000) /* Interrupt on change */ -@@ -168,5 +211,22 @@ typedef struct bufdesc { - #define BD_ENET_TX_STATS ((ushort)0x03ff) /* All status bits */ - - -+#define RCR_LOOP (1 << 0) -+#define RCR_DRT (1 << 1) -+#define RCR_MII_MODE (1 << 2) -+#define RCR_PROM (1 << 3) -+#define RCR_BC_REJ (1 << 4) -+#define RCR_FCE (1 << 5) -+#define RCR_MAX_FL_SHIFT 16 -+#define RCR_MAX_FL_MASK (0x7ff << (RCR_MAX_FL_SHIFT)) -+#define RCR_MAX_FL_set(n) (((n) << (RCR_MAX_FL_SHIFT)) & (RCR_MAX_FL_MASK)) -+#define RCR_MAX_FL_get(n) (((n) & (RCR_MAX_FL_MASK)) >> (RCR_MAX_FL_SHIFT)) -+ -+#define TCR_GTS (1 << 0) -+#define TCR_HBC (1 << 1) -+#define TCR_FDEN (1 << 2) -+#define TCR_TFCPAUSE (1 << 3) -+#define TCR_RFCPAUSE (1 << 4) -+ - /****************************************************************************/ - #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 18:58:52.000000000 +0200 -@@ -570,7 +570,7 @@ static int imxfb_resume(struct platform_ - #define imxfb_resume NULL - #endif - --static int __init imxfb_init_fbinfo(struct platform_device *pdev) -+static int __devinit imxfb_init_fbinfo(struct platform_device *pdev) - { - struct imx_fb_platform_data *pdata = pdev->dev.platform_data; - struct fb_info *info = dev_get_drvdata(&pdev->dev); -@@ -636,7 +636,7 @@ static int __init imxfb_init_fbinfo(stru - return 0; - } - --static int __init imxfb_probe(struct platform_device *pdev) -+static int __devinit imxfb_probe(struct platform_device *pdev) - { - struct imxfb_info *fbi; - struct fb_info *info; -@@ -754,7 +754,7 @@ failed_map: - failed_getclock: - iounmap(fbi->regs); - failed_ioremap: -- release_mem_region(res->start, res->end - res->start); -+ release_mem_region(res->start, resource_size(res)); - failed_req: - kfree(info->pseudo_palette); - failed_init: -@@ -763,7 +763,7 @@ failed_init: - return ret; - } - --static int __devexit imxfb_remove(struct platform_device *pdev) -+static int imxfb_remove(struct platform_device *pdev) - { - struct imx_fb_platform_data *pdata; - struct fb_info *info = platform_get_drvdata(pdev); -@@ -785,7 +785,7 @@ static int __devexit imxfb_remove(struct - framebuffer_release(info); - - iounmap(fbi->regs); -- release_mem_region(res->start, res->end - res->start + 1); -+ release_mem_region(res->start, resource_size(res)); - clk_disable(fbi->clk); - clk_put(fbi->clk); - -@@ -794,7 +794,7 @@ static int __devexit imxfb_remove(struct - return 0; - } - --void imxfb_shutdown(struct platform_device * dev) -+void imxfb_shutdown(struct platform_device *dev) - { - struct fb_info *info = platform_get_drvdata(dev); - struct imxfb_info *fbi = info->par; -@@ -804,7 +804,8 @@ void imxfb_shutdown(struct platform_dev - static struct platform_driver imxfb_driver = { - .suspend = imxfb_suspend, - .resume = imxfb_resume, -- .remove = __devexit_p(imxfb_remove), -+// .remove = __devexit_p(imxfb_remove), -+ .remove = imxfb_remove, - .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-03-16 12:49:03.000000000 +0100 -@@ -0,0 +1,26 @@ -+/* -+ * Copyright (C) 2007 Lothar Wassmann -+ * -+ * platform_data definitions for fec_enet device -+ * -+ * 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 -+ */ -+ -+struct fec_enet_platform_data { -+ /* callback for platform specific initialization */ -+ int (*arch_init)(struct platform_device *dev); -+ void (*arch_exit)(struct platform_device *dev); -+ 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 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"; - static int recursion_bug; --static int new_text_line = 1; -+ static int new_text_line = 1; - static char printk_buf[1024]; - -+#ifdef CONFIG_DEBUG_LL -+extern void asmlinkage printascii(const char *); -+#endif - asmlinkage int vprintk(const char *fmt, va_list args) - { - int printed_len = 0; -@@ -687,6 +690,9 @@ asmlinkage int vprintk(const char *fmt, - sizeof(printk_buf) - printed_len, fmt, args); - - -+#ifdef CONFIG_DEBUG_LL -+ printascii(printk_buf); -+#endif - /* - * Copy the output into log_buf. If the caller didn't provide - * appropriate log level tags, we insert them here diff --git a/recipes/linux/linux_2.6.30-rc4.bb b/recipes/linux/linux_2.6.30-rc4.bb index 05af05c72d..d4f7fdd8fe 100644 --- a/recipes/linux/linux_2.6.30-rc4.bb +++ b/recipes/linux/linux_2.6.30-rc4.bb @@ -1,8 +1,8 @@ require linux.inc -PR = "r0" +PV = "2.6.29+2.6.30-rc4" -S = "${WORKDIR}/linux-${PV}" +S = "${WORKDIR}/linux-2.6.30-rc4" # Mark archs/machines that this kernel supports DEFAULT_PREFERENCE = "-1" -- cgit v1.2.3 From 8c98bd62b1b22ad22f1557b96480d8634e802687 Mon Sep 17 00:00:00 2001 From: Elena Grandi Date: Wed, 1 Jul 2009 10:37:14 +0200 Subject: sugar: updated recipe for version 0.84.6 --- conf/checksums.ini | 4 ++++ recipes/sugar/sugar_0.84.6.bb | 26 ++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 recipes/sugar/sugar_0.84.6.bb diff --git a/conf/checksums.ini b/conf/checksums.ini index 3f68a7440b..a9baa940cf 100644 --- a/conf/checksums.ini +++ b/conf/checksums.ini @@ -22602,6 +22602,10 @@ sha256=2172bfed8fdeab4279dad7712390fd98ae0a993c42c2c4eec98cf3d30d1a11aa md5=6b981c63bb5d8b23b43831ece79884e6 sha256=254ac13ceeba17749ff6416b33fd038f8db7aaf6fab2e0a9d2303dd07314b186 +[http://download.sugarlabs.org/sources/sucrose/glucose/sugar/sugar-0.84.6.tar.bz2] +md5=1747f7f35519b273e6c27bbcd8513d4b +sha256=f5db9c1caf5cd57abfccb12ab1f5ba508cbf0f90ec9bad03de3fb38063775b83 + [http://dev.laptop.org/pub/sugar/sources/sugar-artwork/sugar-artwork-0.82.0.tar.bz2] md5=3d271bf9f0d412afb9a5618ba5496fb8 sha256=dbe36fa758a49dd8526885e2025b51d6e1e6e32458168e420c955b633ee3b100 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 +} + -- cgit v1.2.3 From 719ac90a32b7345724285449f46b45d224bac63f Mon Sep 17 00:00:00 2001 From: Elena Grandi Date: Wed, 1 Jul 2009 10:39:30 +0200 Subject: sugar-artwork: updated recipe for version 0.84.1 --- conf/checksums.ini | 4 ++++ recipes/sugar/sugar-artwork_0.84.1.bb | 28 ++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 recipes/sugar/sugar-artwork_0.84.1.bb diff --git a/conf/checksums.ini b/conf/checksums.ini index a9baa940cf..64c4b84a78 100644 --- a/conf/checksums.ini +++ b/conf/checksums.ini @@ -22610,6 +22610,10 @@ sha256=f5db9c1caf5cd57abfccb12ab1f5ba508cbf0f90ec9bad03de3fb38063775b83 md5=3d271bf9f0d412afb9a5618ba5496fb8 sha256=dbe36fa758a49dd8526885e2025b51d6e1e6e32458168e420c955b633ee3b100 +[http://download.sugarlabs.org/sources/sucrose/glucose/sugar-artwork/sugar-artwork-0.84.1.tar.bz2] +md5=d28b847a24aa23a1b6949aa6a7873560 +sha256=2dc71acc88da545e6a217fd4749dc39a9d59e9f2f768bd67ea201999e55f302a + [http://dev.laptop.org/pub/sugar/sources/sugar-base/sugar-base-0.82.0.tar.bz2] md5=5c568166761af4839cbc78db5dcd0061 sha256=124db55b59cdf5731096276e30d07b3537bc217ae63607f1394c2bb118cfe694 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 +} + -- cgit v1.2.3 From cf5d5cfa6b997f37ca6aac471be2a1b867f8a8df Mon Sep 17 00:00:00 2001 From: Elena Grandi Date: Wed, 1 Jul 2009 10:41:52 +0200 Subject: sugar-base: updated recipe for version 0.84.1 --- conf/checksums.ini | 4 +++ recipes/sugar/sugar-base_0.84.1.bb | 53 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 recipes/sugar/sugar-base_0.84.1.bb diff --git a/conf/checksums.ini b/conf/checksums.ini index 64c4b84a78..1147e6c8a8 100644 --- a/conf/checksums.ini +++ b/conf/checksums.ini @@ -22626,6 +22626,10 @@ sha256=430b27a0510a50fb66ee211e35565be7e1e522bcde7d1adde5c63a1d18ad7f1d md5=0f05d95eaf0f8e3174a3b3e3b0afe995 sha256=64ece8bb8e6eddb4c7b8b4ce0aa30f07f00a86ed7b113a7957661e73616a8dc3 +[http://download.sugarlabs.org/sources/sucrose/glucose/sugar-base/sugar-base-0.84.1.tar.bz2] +md5=0ef47ff5a8931e0e7c732d22a514d297 +sha256=e67eab2d058a3410d8fe82a2161d0c268b6445648c5901a8bd2c26690c45addd + [http://dev.laptop.org/pub/sugar/sources/sugar-datastore/sugar-datastore-0.82.0.tar.bz2] md5=7a6bbb387c1f7cd3ddd6663869df3b88 sha256=3fc7ed937865773089d146f0fce72ee556f0655c612ae840a08dbd1a13d92d39 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 +} + -- cgit v1.2.3 From d9348bc345dc5874a96c235d1c603c2c7693b311 Mon Sep 17 00:00:00 2001 From: Elena Grandi Date: Wed, 1 Jul 2009 10:43:47 +0200 Subject: sugar-datastore: updated recipe for version 0.84.0 --- conf/checksums.ini | 4 ++++ recipes/sugar/sugar-datastore_0.84.0.bb | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 recipes/sugar/sugar-datastore_0.84.0.bb diff --git a/conf/checksums.ini b/conf/checksums.ini index 1147e6c8a8..f7142ccbe7 100644 --- a/conf/checksums.ini +++ b/conf/checksums.ini @@ -22634,6 +22634,10 @@ sha256=e67eab2d058a3410d8fe82a2161d0c268b6445648c5901a8bd2c26690c45addd md5=7a6bbb387c1f7cd3ddd6663869df3b88 sha256=3fc7ed937865773089d146f0fce72ee556f0655c612ae840a08dbd1a13d92d39 +[http://download.sugarlabs.org/sources/sucrose/glucose/sugar-datastore/sugar-datastore-0.84.0.tar.bz2] +md5=e57580e9fd44ecc2cb7a947dd8854817 +sha256=6049dddd3863110b95ec7c7b53c15f6ef8c7b627e3a04f0e9053978685a699db + [http://dev.laptop.org/pub/sugar/sources/sugar-presence-service/sugar-presence-service-0.82.1.tar.bz2] md5=361bf10937908a638442b562ebb26d0b sha256=6aceb2140c44ada61c9deba9215a12b9a1025fabecc07907edfdcf0ba8ca341b 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" + -- cgit v1.2.3 From b1cd10046779238c3878b32d800f9cb9ee2e9ff7 Mon Sep 17 00:00:00 2001 From: Elena Grandi Date: Wed, 1 Jul 2009 10:46:05 +0200 Subject: sugar-presence-service: updated recipe for version 0.84.0 --- conf/checksums.ini | 4 ++++ recipes/sugar/sugar-presence-service_0.84.0.bb | 31 ++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 recipes/sugar/sugar-presence-service_0.84.0.bb diff --git a/conf/checksums.ini b/conf/checksums.ini index f7142ccbe7..c16c490bc1 100644 --- a/conf/checksums.ini +++ b/conf/checksums.ini @@ -22646,6 +22646,10 @@ sha256=6aceb2140c44ada61c9deba9215a12b9a1025fabecc07907edfdcf0ba8ca341b md5=0b50a2467e4e9eedd22f51bf2fe6e6f3 sha256=3b33c9689fb9faaeaf4308cd66794b02951249253ac96df99bd308c4b6d38850 +[http://download.sugarlabs.org/sources/sucrose/glucose/sugar-presence-service/sugar-presence-service-0.84.0.tar.bz2] +md5=bf292605b6c2d0ef3761a957acc8a95e +sha256=15afba51ef2c34b86ae2c4b8ecfe612e37a7024ae9ccf42a3b612d70e3034d48 + [http://dev.laptop.org/pub/sugar/sources/sugar-toolkit/sugar-toolkit-0.82.1.tar.bz2] md5=885bd339331209d2771ca614723518a3 sha256=68f1a10298f34ea133a679085b3b54bdb990c49324779f79e40aff0f274b6a9a 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 +} + -- cgit v1.2.3 From ef127ce31b24b990bef2174b372697e945f56df0 Mon Sep 17 00:00:00 2001 From: Elena Grandi Date: Wed, 1 Jul 2009 10:47:38 +0200 Subject: sugar-toolkit: updated recipe for version 0.84.4 --- conf/checksums.ini | 4 ++++ recipes/sugar/sugar-toolkit_0.84.4.bb | 22 ++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 recipes/sugar/sugar-toolkit_0.84.4.bb diff --git a/conf/checksums.ini b/conf/checksums.ini index c16c490bc1..cbcf8331b9 100644 --- a/conf/checksums.ini +++ b/conf/checksums.ini @@ -22662,6 +22662,10 @@ sha256=a0fae53f396c6223365c28c8cda0538f2cb20c660bffd9cfcc37ee00b57c2a7b md5=f6882ee56ed327c6680738133e911bf3 sha256=243a9d699af072b4cb79334b62638463d9f39437e7a886a14a95b7a8250983bd +[http://download.sugarlabs.org/sources/sucrose/glucose/sugar-toolkit/sugar-toolkit-0.84.4.tar.bz2] +md5=5ad76015d382ec4125c2ef01022dc898 +sha256=bc489eb0feacfd68cd29f1556e2d1c4b4eb8f01c9add7ceb878b605521eb9f92 + [http://ssel.vub.ac.be/Members/DennisWagelaar/download/zaurus/supertux-0.1.2-fp.patch.gz] md5=05787c6553316940873e8bce192a4fe0 sha256=ab958a3cc04858ab72f3fe2844362f249897c3bb2149208be22da2ce5d46c9c0 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 +} + -- cgit v1.2.3 From 0bc63dc0d9fa22f7a4b8a70b91b0450d9f65d024 Mon Sep 17 00:00:00 2001 From: Elena Grandi Date: Wed, 1 Jul 2009 10:49:56 +0200 Subject: etoys: updated recipe for version 4.0.2212 This is the sugarlabs release of etoys. --- conf/checksums.ini | 4 ++++ recipes/sugar/etoys_4.0.2212.bb | 24 ++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 recipes/sugar/etoys_4.0.2212.bb diff --git a/conf/checksums.ini b/conf/checksums.ini index cbcf8331b9..33aad14695 100644 --- a/conf/checksums.ini +++ b/conf/checksums.ini @@ -5678,6 +5678,10 @@ sha256=5046f573e7dd77f689c33c5f0aa0f2b7f96c79e0b37d6ecc78bae74c094fb4c6 md5=9cd0026f5bc89c96cafbd6d1d3500a3b sha256=4a2a9f54f3fc68250a92eab43a030b6b96c4b6e251b698b3378bfee751f1cbd8 +[http://download.sugarlabs.org/sources/sucrose/glucose/etoys/etoys-4.0.2212.tar.gz] +md5=3eeb43af8c6bc0a30b46739707e27259 +sha256=8b5499c26860c8a11750e9e03b9a7d70dd8e7ffce16457e9ee9d7850d554e7ab + [http://downloads.sourceforge.net/ettercap/ettercap-0.6.b.tar.gz] md5=f665cf82347a91f216184537f8f2c4bd sha256=2b6b0d1af5b8af63eb5edf7052fdc9f46c55b6f7b607c8772b18927cb481ecf9 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} " + -- cgit v1.2.3 From 5ffd81ea6e75aecbfe1ed994d3f593039b7b24aa Mon Sep 17 00:00:00 2001 From: Elena Grandi Date: Wed, 1 Jul 2009 10:51:44 +0200 Subject: task-sugar-sucrose: new recipe for a complete sugar environment --- recipes/tasks/task-sugar-sucrose.bb | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 recipes/tasks/task-sugar-sucrose.bb 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 \ +" -- cgit v1.2.3 From ff806d26a17abb2ef743325bcd2b8a2319e648de Mon Sep 17 00:00:00 2001 From: Elena Grandi Date: Wed, 1 Jul 2009 10:52:58 +0200 Subject: sugar-image: updated to use the task-sugar-sucrose recipe --- recipes/images/sugar-image.bb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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}" -- cgit v1.2.3 From 14fb948e604f4c2a7243fb235355d9ece8e04238 Mon Sep 17 00:00:00 2001 From: Elena Grandi Date: Wed, 1 Jul 2009 11:00:25 +0200 Subject: xapian-core, xapian-core-native: updated recipes for version 1.0.13 --- conf/checksums.ini | 4 ++++ recipes/xapian/xapian-core-native_1.0.13.bb | 6 ++++++ recipes/xapian/xapian-core_1.0.13.bb | 16 ++++++++++++++++ 3 files changed, 26 insertions(+) create mode 100644 recipes/xapian/xapian-core-native_1.0.13.bb create mode 100644 recipes/xapian/xapian-core_1.0.13.bb diff --git a/conf/checksums.ini b/conf/checksums.ini index 33aad14695..f85cd0218a 100644 --- a/conf/checksums.ini +++ b/conf/checksums.ini @@ -24878,6 +24878,10 @@ sha256=18b38aff8e019f35bfee810831535685e69dcf91283e50bc62efa82e3a8dbc21 md5=fc805051f0fe505c7a4b1b5c8db9b9e3 sha256=fa52aa629bb882335d45d67401d270c3f21b5131aaea005ac0d4590f2ce8b043 +[http://www.oligarchy.co.uk/xapian/1.0.13/xapian-core-1.0.13.tar.gz] +md5=5442e7ffc75abd853d1ab1d12667a3e9 +sha256=a474be06657bd83200231d938d48d4d2a83cff0252c618421f835604c5548dce + [http://www.oligarchy.co.uk/xapian/1.0.5/xapian-core-1.0.5.tar.gz] md5=5fbfec7f23b0f539d32b50de4a278b95 sha256=277e30cbd4a4d9355e9b2c02489d34cbaed87754bbdeb8956e5463e9fb592658 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 +} + -- cgit v1.2.3 From a2ba9341af9cbb19593f120b52dee81788f03b9c Mon Sep 17 00:00:00 2001 From: Elena Grandi Date: Wed, 1 Jul 2009 12:26:32 +0200 Subject: python-cjson 1.0.5: new recipe python-cjson is a Fast JSON encoder/decoder for Python --- conf/checksums.ini | 4 ++++ recipes/python/python-cjson_1.0.5.bb | 8 ++++++++ 2 files changed, 12 insertions(+) create mode 100644 recipes/python/python-cjson_1.0.5.bb diff --git a/conf/checksums.ini b/conf/checksums.ini index f85cd0218a..6fc3c42211 100644 --- a/conf/checksums.ini +++ b/conf/checksums.ini @@ -20426,6 +20426,10 @@ sha256=7d17f07aa470cac6afc1b7e68745c1bf1767913ce52b401296e21cab245fe26b md5=8a7763e31e4cc3fdf9154c793dda3bc0 sha256=7d17f07aa470cac6afc1b7e68745c1bf1767913ce52b401296e21cab245fe26b +[http://pypi.python.org/packages/source/p/python-cjson/python-cjson-1.0.5.tar.gz] +md5=4d55b66ecdf0300313af9d030d9644a3 +sha256=85bbe7a9fb6617e24bb4dbef528af8ef6eae07f8809dcd05ec926142feca7714 + [http://labix.org/download/python-constraint/python-constraint-1.1.tar.bz2] md5=975e5449d6670dd19498bb9ec4856d39 sha256=0d904161351a8e55b272ed9691b12dca4278bed62fde53ba2a36f479996db910 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 -- cgit v1.2.3 From 6d13b52b667b3318b1da6522d462532649907a18 Mon Sep 17 00:00:00 2001 From: Koen Kooi Date: Wed, 1 Jul 2009 12:47:47 +0200 Subject: cwiid: add svn version --- recipes/cwiid/cwiid_svn.bb | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 recipes/cwiid/cwiid_svn.bb 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 +} + + -- cgit v1.2.3 From 935f6044f699e8b4f803346a158b46cc79fb39da Mon Sep 17 00:00:00 2001 From: Florian Boor Date: Wed, 1 Jul 2009 12:46:47 +0200 Subject: linux: Merge tx25 support into the correct recipe. --- .../linux-2.6.30-rc4/tx25/defconfig | 1211 - .../tx25/linux-2.6.30-rc4-git.patch | 55110 ------------------- .../tx25/linux-2.6.30-rc4-karo.diff | 15337 ------ .../linux/linux-2.6.29+2.6.30-rc4/tx25/defconfig | 1211 + .../tx25/linux-2.6.30-rc4-git.patch | 55110 +++++++++++++++++++ .../tx25/linux-2.6.30-rc4-karo.diff | 15337 ++++++ recipes/linux/linux_2.6.29+2.6.30-rc4.bb | 6 +- 7 files changed, 71663 insertions(+), 71659 deletions(-) delete mode 100644 recipes/linux/linux-2.6.29+2.6.30-rc4/linux-2.6.30-rc4/tx25/defconfig delete mode 100644 recipes/linux/linux-2.6.29+2.6.30-rc4/linux-2.6.30-rc4/tx25/linux-2.6.30-rc4-git.patch delete mode 100644 recipes/linux/linux-2.6.29+2.6.30-rc4/linux-2.6.30-rc4/tx25/linux-2.6.30-rc4-karo.diff create mode 100644 recipes/linux/linux-2.6.29+2.6.30-rc4/tx25/defconfig create mode 100644 recipes/linux/linux-2.6.29+2.6.30-rc4/tx25/linux-2.6.30-rc4-git.patch create mode 100644 recipes/linux/linux-2.6.29+2.6.30-rc4/tx25/linux-2.6.30-rc4-karo.diff diff --git a/recipes/linux/linux-2.6.29+2.6.30-rc4/linux-2.6.30-rc4/tx25/defconfig b/recipes/linux/linux-2.6.29+2.6.30-rc4/linux-2.6.30-rc4/tx25/defconfig deleted file mode 100644 index 290f8df24c..0000000000 --- a/recipes/linux/linux-2.6.29+2.6.30-rc4/linux-2.6.30-rc4/tx25/defconfig +++ /dev/null @@ -1,1211 +0,0 @@ -# -# Automatically generated make config: don't edit -# Linux kernel version: 2.6.30-rc4 -# Tue Jun 30 22:46:56 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 is not set -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=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 - -# -# 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_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 - -# -# 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=y -CONFIG_NETCONSOLE_DYNAMIC=y -CONFIG_NETPOLL=y -# CONFIG_NETPOLL_TRAP is not set -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 -# 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 is not set -# CONFIG_LOGO_LINUX_VGA16 is not set -CONFIG_LOGO_LINUX_CLUT224=y -# CONFIG_SOUND 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_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=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 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 --git a/recipes/linux/linux-2.6.29+2.6.30-rc4/linux-2.6.30-rc4/tx25/linux-2.6.30-rc4-git.patch b/recipes/linux/linux-2.6.29+2.6.30-rc4/linux-2.6.30-rc4/tx25/linux-2.6.30-rc4-git.patch deleted file mode 100644 index b030555df6..0000000000 --- a/recipes/linux/linux-2.6.29+2.6.30-rc4/linux-2.6.30-rc4/tx25/linux-2.6.30-rc4-git.patch +++ /dev/null @@ -1,55110 +0,0 @@ -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 -+#ifdef __KERNEL__ - --#endif -+#include -+#include -+#include -+#include -+ -+#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 -+#include - #include - -+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. -+ * -+ * 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 -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+ -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#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 */ -+ .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. -- * -- * 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 --#include --#include --#include --#include --#include --#include -- --#include --#include --#include -- --#include --#include --#include --#include -- --#include --#include -- --#include --#include --#include -- --#include --#include --#include -- --/* 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 */ -- .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 - #include - #include -+#include - #include - #include - #include -@@ -21,98 +23,50 @@ - #include - - #include -+#include - #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 = ""; -+ -+ /* name */ -+ 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 -+#include -+ -+#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 - #include - #include -+#include -+#include -+ -+#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 -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#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 -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#include -+#include -+#include -+ -+ -+/* 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 - #include - -+#include - #include - #include - #include -@@ -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 - #include - --#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 -+ -+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 -+#include -+ -+#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 - #include --#include -+ - #include - -+#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. -+ * 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 .h, -+ * and the chip/board init code should then explicitly include -+ * .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. - * -+ * 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 - --#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 - - #include -+#include - #include - - #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. - * -+ * 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 -+#include - #include - - #include -- - #include - --/* 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. -+ * -+ * 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 -+ -+#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 - #include - -+#include - #include - #include - #include - -+#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 - #include - #include -+#include -+#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 - #include - #include -+#include -+#include -+#include - - #include - #include -@@ -24,8 +27,11 @@ - #include - #include - #include -+#include -+#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 - #include - -+#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 , 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 --#include --#include --#include --#include --#include -- --#include -- --/* -- * 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 -- * Copyright (C) 2006 Inky Lung -- * Copyright (C) 2006 Pavel Pisa, PiKRON -- * -- * 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 --#include --#include --#include --#include --#include --#include -- --#include -- --#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 -- * initial version heavily inspired by -- * linux/arch/arm/mach-pxa/dma.c -- * -- * 2005-04-17 Pavel Pisa -- * Changed to support scatter gather DMA -- * by taking Russell's code from RiscPC -- * -- * 2006-05-31 Pavel Pisa -- * Corrected error handling code. -- * -- */ -- --#undef DEBUG -- --#include --#include --#include --#include --#include -- --#include --#include --#include --#include --#include --#include -- --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 --#include --#include --#include --#include -- --#include --#include --#include -- --#include --#include --#include -- --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<> 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 -- * 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 -- -- .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 --#include --#include -- --#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 /* 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 --#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 -- --#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 -- --/* -- * 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 -- --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 -- * -- * 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 -- * Copied from the motorola bsp package and added gpio demux -- * interrupt handler -- */ -- --#include --#include --#include --#include -- --#include --#include -- --#include -- --/* -- * -- * 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 -- * -- * -- * 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 --#include -- --#include --#include -- --#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 -- * -- * 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 -- * -- * 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 --#include --#include --#include --#include --#include --#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 -- * -- * 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 --#include --#include --#include --#include --#include --#include --#include -- --#include --#include -- --#include --#include --#include --#include --#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 --#include --#include --#include --#include --#include --#include --#include --#include --#include -- --#include --#include --#include --#include -- --/* 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 - -+#include - #include - - 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 -+#include -+#include - #include -+#include - #include - #include --#include --#include - - #include - #include - #include - --#include --#include - #include --#include --#include -+#include - #include -+#include - #include -+#include -+ - #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 -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#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 - #include - #include -+#include -+#include - #include - #include - #include -@@ -33,9 +35,117 @@ - #include - #include - #include -+#include -+#include -+#include -+#include - - #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 -+ * -+ * 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 -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#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 --#include --#include --#include - #include - #include -+#include -+#include -+#include -+#include - --#include - #include -+#include -+#include -+ -+#include - #include - #include --#include --#ifdef CONFIG_I2C_IMX - #include --#endif --#include -+#include - #include --#include - #include - - #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 - #include - #include -+#include - - #include - --#include - #include --#include --#include - #include -+#include -+#include -+#include - - #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 - #include - #include - #include - #include -+#include - #include - #include -+#include - #include -+#include - - #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 - #include - #include --#include - #include - #include - #include -@@ -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 - #include - #include -+#include -+#include -+#include - - #include - #include -@@ -32,11 +35,58 @@ - #include - #include - #include -+#include -+#include -+#include -+#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 -+#include - #include -- --#include -+#include -+#include - #include - #include --#include -+#include -+#include - --#include - #include - #include - #include - #include -+#include - #include -+#include - #include - #include --#include -+#include -+#include - - #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 -+#include -+#include - #include -- -+#include - #include -+#include - --#include - #include - #include - #include -+#include -+#include - - #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 -+#include -+#include - #include -- -+#include - #include -+#include - --#include - #include -+#include - #include - #include -+#include - - #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 - #include - #include -+#include -+#include -+#include -+#include - - #include - #include -@@ -37,7 +41,9 @@ - #include - #include - #include -+#include - #include -+#include - #include - #include - #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 -+#include -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#if defined CONFIG_I2C_IMX || defined CONFIG_I2C_IMX_MODULE -+#include -+#endif -+#include -+#include -+#include -+ -+#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 - #include - --#include - #include - #include - #include - #include --#include - #include - #include - #include -@@ -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 - #include --#include - #include - #include --#include - #include - #include - #include -@@ -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 - #include - #include -+#include - - #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 - #include - #include --#include - #include - - #include -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 - #include - #include --#include - #include - - #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. - * Copyright (C) 2007 MontaVista Software, Inc. -@@ -36,8 +38,13 @@ - #include - #include - -+/* 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 - #include - #include -+#include - - #include - #include -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 - #endif -+#ifdef CONFIG_MACH_MX21ADS -+#include -+#endif - #ifdef CONFIG_MACH_PCM038 - #include - #endif -@@ -34,6 +37,12 @@ - #ifdef CONFIG_MACH_QONG - #include - #endif -+#ifdef CONFIG_MACH_PCM043 -+#include -+#endif -+#ifdef CONFIG_MACH_MX27_3DS -+#include -+#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 -+ * -+ * 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 -+ -+/* -+ * The naming convention for the pad modes is MX35_PAD___ -+ * If or refers to a GPIO, it is named -+ * GPIO__ 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, -+ * -+ * -+ * 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___ -+ * If or refers to a GPIO, it is named -+ * GPIO__ -+ * -+ */ -+ -+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 --#include -- --#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 -+ * Copyright (C) 2009 by Jan Weitzel Phytec Messtechnik 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., 51 Franklin Street, Fifth Floor, Boston, -+ * MA 02110-1301, USA. -+ */ -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+ -+#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 - #include - --#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 - #include - #include -+#include -+ -+ -+/* 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 "); -- -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 - #include - #include --#include -+ -+/* 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 -- * -- * 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 --#include --#include -- --#include -- --/* 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 -+ -+#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 , 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, ®_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 , 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 , 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] \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 \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 \n"); -- fprintf(stderr, "\t-O \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 \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 \n"); -- fprintf(stderr, "\t\tMake space for reserve map entries (relevant for \n\t\tdtb and asm output only)\n"); -- fprintf(stderr, "\t-S \n"); -- fprintf(stderr, "\t\tMake the blob at least long (extra space)\n"); -- fprintf(stderr, "\t-p \n"); -- fprintf(stderr, "\t\tAdd padding to the blob of long (extra space)\n"); -- fprintf(stderr, "\t-b \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 , 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 --#include --#include --#include --#include --#include --#include --#include --#include -- --#include --#include -- --#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 , 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("\n"); \ -- BEGIN(INITIAL); \ -- } else { \ -- DPRINT("\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); -- } -- --<*><> { -- 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; -- } -- --[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; -- } -- --[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; -- } -- --[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; -- } -- --"&/"{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; -- } -- --[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; -- } -- --"]" { -- yylloc.file = srcpos_file; -- yylloc.first_line = yylineno; -- DPRINT("/BYTESTRING\n"); -- BEGIN_DEFAULT(); -- return ']'; -- } -- --{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("\n"); -- BEGIN(BYTESTRING); -- } -- if ((yytext[0] == '{') -- || (yytext[0] == ';')) { -- DPRINT("\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 --#include --#include --#include -- --/* end standard C headers. */ -- --/* flex integer type definitions */ -- --#ifndef FLEXINT_H --#define FLEXINT_H -- --/* C99 systems have . 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 --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 , 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("\n"); \ -- BEGIN(INITIAL); \ -- } else { \ -- DPRINT("\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 --#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("\n"); -- BEGIN(BYTESTRING); -- } -- if ((yytext[0] == '{') -- || (yytext[0] == ';')) { -- DPRINT("\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 -- --#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 /* 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 /* 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 /* INFRINGES ON USER NAME SPACE */ --# elif defined _AIX --# define YYSTACK_ALLOC __alloca --# elif defined _MSC_VER --# include /* 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 /* 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 /* 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 /* 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 : ""; -- 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 , 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 -- --#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 DT_PROPNODENAME --%token DT_LITERAL --%token DT_LEGACYLITERAL --%token DT_BASE --%token DT_BYTE --%token DT_STRING --%token DT_LABEL --%token DT_REF --%token DT_INCBIN -- --%type propdata --%type propdataprefix --%type memreserve --%type memreserves --%type v0_memreserve --%type v0_memreserves --%type addr --%type celllist --%type cellbase --%type cellval --%type bytestring --%type propdef --%type proplist -- --%type devicetree --%type nodedef --%type subnode --%type subnodes --%type 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 : ""; -- 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 , 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 , 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 --#include -- --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 --#include --#include -- --#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 , 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 -- --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 , 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 --#include -- --#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 --#include -- --#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 --#include -- --#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 --#include -- --#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 ""; -- else if (errval == 0) -- return ""; -- else if (errval > -FDT_ERRTABSIZE) { -- const char *s = fdt_errtable[-errval].str; -- -- if (s) -- return s; -- } -- -- return ""; --} -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 --#include -- --#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 --#include -- --#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 --#include -- --#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 -- --#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 - - 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 '

Linux Kernel HTML Documentation

' >> $(main_idx) && \ - echo '

Kernel Version: $(KERNELVERSION)

' >> $(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 -+ -+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 -+ -+ -+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 -+ */ -+ -+/* -+ * 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 -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+/* 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 -+ * Copyright (C) 2007-2009 Arjan Opmeer - * - * 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 -+ * Copyright (C) 2007-2009 Arjan Opmeer - * - * 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 - * Copyright (c) 2001 Frederic Lepied - * Copyright (c) 2004 Panagiotis Issaris -- * Copyright (c) 2002-2008 Ping Cheng -+ * Copyright (c) 2002-2009 Ping Cheng - * - * 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 " - #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 */ - 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 handler: unexpected completion 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 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 " - #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 - #include - #include -+#include - - #include - #include -@@ -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 - #include - #include --#include - #include - #include - #include -+#include -+#include -+#include -+#include -+#include - --#include - #include - #include - #include --#include - - #include - -@@ -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 -+#include - - #include - - 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 - - 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 , 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, ®_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 , 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 , 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] \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 \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 \n"); -+ fprintf(stderr, "\t-O \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 \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 \n"); -+ fprintf(stderr, "\t\tMake space for reserve map entries (relevant for \n\t\tdtb and asm output only)\n"); -+ fprintf(stderr, "\t-S \n"); -+ fprintf(stderr, "\t\tMake the blob at least long (extra space)\n"); -+ fprintf(stderr, "\t-p \n"); -+ fprintf(stderr, "\t\tAdd padding to the blob of long (extra space)\n"); -+ fprintf(stderr, "\t-b \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 , 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 -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+ -+#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 , 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("\n"); \ -+ BEGIN(INITIAL); \ -+ } else { \ -+ DPRINT("\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); -+ } -+ -+<*><> { -+ 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; -+ } -+ -+[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; -+ } -+ -+[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; -+ } -+ -+[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; -+ } -+ -+"&/"{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; -+ } -+ -+[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; -+ } -+ -+"]" { -+ yylloc.file = srcpos_file; -+ yylloc.first_line = yylineno; -+ DPRINT("/BYTESTRING\n"); -+ BEGIN_DEFAULT(); -+ return ']'; -+ } -+ -+{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("\n"); -+ BEGIN(BYTESTRING); -+ } -+ if ((yytext[0] == '{') -+ || (yytext[0] == ';')) { -+ DPRINT("\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 -+#include -+#include -+#include -+ -+/* end standard C headers. */ -+ -+/* flex integer type definitions */ -+ -+#ifndef FLEXINT_H -+#define FLEXINT_H -+ -+/* C99 systems have . 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 -+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 , 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("\n"); \ -+ BEGIN(INITIAL); \ -+ } else { \ -+ DPRINT("\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 -+#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("\n"); -+ BEGIN(BYTESTRING); -+ } -+ if ((yytext[0] == '{') -+ || (yytext[0] == ';')) { -+ DPRINT("\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 -+ -+#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 /* 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 /* 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 /* INFRINGES ON USER NAME SPACE */ -+# elif defined _AIX -+# define YYSTACK_ALLOC __alloca -+# elif defined _MSC_VER -+# include /* 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 /* 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 /* 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 /* 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 : ""; -+ 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 , 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 -+ -+#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 DT_PROPNODENAME -+%token DT_LITERAL -+%token DT_LEGACYLITERAL -+%token DT_BASE -+%token DT_BYTE -+%token DT_STRING -+%token DT_LABEL -+%token DT_REF -+%token DT_INCBIN -+ -+%type propdata -+%type propdataprefix -+%type memreserve -+%type memreserves -+%type v0_memreserve -+%type v0_memreserves -+%type addr -+%type celllist -+%type cellbase -+%type cellval -+%type bytestring -+%type propdef -+%type proplist -+ -+%type devicetree -+%type nodedef -+%type subnode -+%type subnodes -+%type 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 : ""; -+ 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 , 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 , 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 -+#include -+ -+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 -+#include -+ -+#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 -+#include -+ -+#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 -+#include -+ -+#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 -+#include -+ -+#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 ""; -+ else if (errval == 0) -+ return ""; -+ else if (errval > -FDT_ERRTABSIZE) { -+ const char *s = fdt_errtable[-errval].str; -+ -+ if (s) -+ return s; -+ } -+ -+ return ""; -+} -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 -+#include -+ -+#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 -+#include -+ -+#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 -+#include -+#include -+ -+#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 -+#include -+ -+#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 -+ -+#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 , 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 -+ -+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 , 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 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 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.29+2.6.30-rc4/linux-2.6.30-rc4/tx25/linux-2.6.30-rc4-karo.diff b/recipes/linux/linux-2.6.29+2.6.30-rc4/linux-2.6.30-rc4/tx25/linux-2.6.30-rc4-karo.diff deleted file mode 100644 index 17765b46f6..0000000000 --- a/recipes/linux/linux-2.6.29+2.6.30-rc4/linux-2.6.30-rc4/tx25/linux-2.6.30-rc4-karo.diff +++ /dev/null @@ -1,15337 +0,0 @@ -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-08 13:11:18.000000000 +0200 -@@ -0,0 +1,1203 @@ -+# -+# Automatically generated make config: don't edit -+# Linux kernel version: 2.6.30-rc4 -+# Fri Jun 5 21:17: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_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 is not set -+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=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 -+ -+# -+# 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_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 -+ -+# -+# 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=y -+CONFIG_NETCONSOLE_DYNAMIC=y -+CONFIG_NETPOLL=y -+# CONFIG_NETPOLL_TRAP is not set -+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 -+# 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-08 13:11:18.000000000 +0200 -@@ -0,0 +1,1203 @@ -+# -+# Automatically generated make config: don't edit -+# Linux kernel version: 2.6.30-rc4 -+# Fri Jun 5 21:17: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_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 is not set -+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=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 -+ -+# -+# 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_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 -+ -+# -+# 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=y -+CONFIG_NETCONSOLE_DYNAMIC=y -+CONFIG_NETPOLL=y -+# CONFIG_NETPOLL_TRAP is not set -+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 -+# 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/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-08 12:45:22.000000000 +0200 -@@ -6,14 +6,26 @@ choice - - config MACH_MX21 - bool "i.MX21 support" -+ select ARCH_MXC_IOMUX_V2 -+ select ARCH_MXC_HAS_NFC_V1 - help - This enables support for Freescale's MX2 based i.MX21 processor. - - config MACH_MX27 - bool "i.MX27 support" -+ select ARCH_MXC_IOMUX_V2 -+ select ARCH_MXC_HAS_NFC_V1 - 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_V1_1 -+ select PHYLIB if FEC -+ help -+ This enables support for Freescale's MX2 based i.MX25 processor. -+ - endchoice - - comment "MX2 platforms:" -@@ -39,6 +51,26 @@ config MACH_PCM038 - Include support for phyCORE-i.MX27 (aka pcm038) platform. This - includes specific configurations for the module and its peripherals. - -+config MACH_TX25 -+ bool "Support Ka-Ro electronics TX25 module" -+ depends on MACH_MX25 -+ help -+ Include support for Ka-Ro TX25 processor module -+ -+config KARO_DEBUG -+ bool "Enable Ka-Ro specific debug messages" -+ depends on MACH_TX25 || MACH_TX27 -+ help -+ Compile the architecture specific files with -DDEBUG to enable -+ additional debug messages -+ -+config MACH_STK5_BASEBOARD -+ bool "Ka-Ro Starterkit-5 (STK5) development board" -+ depends on MACH_TX27 || MACH_TX25 -+ help -+ This adds board specific devices that can be found on Ka-Ro's -+ STK5 evaluation board. -+ - choice - prompt "Baseboard" - depends on MACH_PCM038 -@@ -60,3 +92,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:59:14.000000000 +0200 -@@ -2,17 +2,31 @@ - # Makefile for the linux kernel. - # - -+ifeq ($(CONFIG_KARO_DEBUG),y) -+ EXTRA_CFLAGS += -DDEBUG -+endif -+ - # Object file lists. - --obj-y := generic.o devices.o serial.o -+obj-y := generic.o serial.o -+obj-$(CONFIG_MACH_MX25) += devices_mx25.o -+ifeq ($(CONFIG_MACH_MX25),) -+obj-y += devices.o -+endif -+ -+obj-$(CONFIG_MACH_MX21) += clock_imx21.o - --obj-$(CONFIG_MACH_MX21) += clock_imx21.o -+obj-$(CONFIG_MACH_MX25) += clock_imx25.o -+obj-$(CONFIG_MACH_MX25) += cpu_imx25.o - --obj-$(CONFIG_MACH_MX27) += cpu_imx27.o --obj-$(CONFIG_MACH_MX27) += clock_imx27.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 -+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 -+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: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 - initrd_phys-$(CONFIG_MACH_MX27) := 0xA0800000 -+ -+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:59:15.000000000 +0200 -@@ -890,7 +890,7 @@ static struct clk clko_clk = { - .con_id = n, \ - .clk = &c, \ - }, --static struct clk_lookup lookups[] __initdata = { -+static struct clk_lookup lookups[] = { - /* 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-08 12:46:51.000000000 +0200 -@@ -0,0 +1,1848 @@ -+/* -+ * Copyright 2008 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 -+ */ -+ -+/* based on mach-mx27/clock.c */ -+ -+#include -+#include -+#include -+//#include -+ -+#include -+//#include -+ -+#include -+#include -+#include -+ -+/* Register offsets */ -+#define MXC_CCM_MPCTL (IO_ADDRESS(CCM_BASE_ADDR) + 0x00) -+#define MXC_CCM_UPCTL (IO_ADDRESS(CCM_BASE_ADDR) + 0x04) -+#define MXC_CCM_CCTL (IO_ADDRESS(CCM_BASE_ADDR) + 0x08) -+#define MXC_CCM_CGCR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x0C) -+#define MXC_CCM_CGCR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x10) -+#define MXC_CCM_CGCR2 (IO_ADDRESS(CCM_BASE_ADDR) + 0x14) -+#define MXC_CCM_PCDR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x18) -+#define MXC_CCM_PCDR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x1C) -+#define MXC_CCM_PCDR2 (IO_ADDRESS(CCM_BASE_ADDR) + 0x20) -+#define MXC_CCM_PCDR3 (IO_ADDRESS(CCM_BASE_ADDR) + 0x24) -+#define MXC_CCM_RCSR (IO_ADDRESS(CCM_BASE_ADDR) + 0x28) -+#define MXC_CCM_CRDR (IO_ADDRESS(CCM_BASE_ADDR) + 0x2C) -+#define MXC_CCM_DCVR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x30) -+#define MXC_CCM_DCVR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x34) -+#define MXC_CCM_DCVR2 (IO_ADDRESS(CCM_BASE_ADDR) + 0x38) -+#define MXC_CCM_DCVR3 (IO_ADDRESS(CCM_BASE_ADDR) + 0x3C) -+#define MXC_CCM_LTR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x40) -+#define MXC_CCM_LTR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x44) -+#define MXC_CCM_LTR2 (IO_ADDRESS(CCM_BASE_ADDR) + 0x48) -+#define MXC_CCM_LTR3 (IO_ADDRESS(CCM_BASE_ADDR) + 0x4C) -+#define MXC_CCM_LTBR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x50) -+#define MXC_CCM_LTBR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x54) -+#define MXC_CCM_PMCR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x58) -+#define MXC_CCM_PMCR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x5C) -+#define MXC_CCM_PMCR2 (IO_ADDRESS(CCM_BASE_ADDR) + 0x60) -+#define MXC_CCM_MCR (IO_ADDRESS(CCM_BASE_ADDR) + 0x64) -+ -+#define MXC_CCM_MPCTL_BRMO (1 << 31) -+#define MXC_CCM_MPCTL_PD_OFFSET 26 -+#define MXC_CCM_MPCTL_PD_MASK (0xf << 26) -+#define MXC_CCM_MPCTL_MFD_OFFSET 16 -+#define MXC_CCM_MPCTL_MFD_MASK (0x3ff << 16) -+#define MXC_CCM_MPCTL_MFI_OFFSET 10 -+#define MXC_CCM_MPCTL_MFI_MASK (0xf << 10) -+#define MXC_CCM_MPCTL_MFN_OFFSET 0 -+#define MXC_CCM_MPCTL_MFN_MASK 0x3ff -+#define MXC_CCM_MPCTL_LF (1 << 15) -+ -+#define MXC_CCM_UPCTL_BRMO (1 << 31) -+#define MXC_CCM_UPCTL_PD_OFFSET 26 -+#define MXC_CCM_UPCTL_PD_MASK (0xf << 26) -+#define MXC_CCM_UPCTL_MFD_OFFSET 16 -+#define MXC_CCM_UPCTL_MFD_MASK (0x3ff << 16) -+#define MXC_CCM_UPCTL_MFI_OFFSET 10 -+#define MXC_CCM_UPCTL_MFI_MASK (0xf << 10) -+#define MXC_CCM_UPCTL_MFN_OFFSET 0 -+#define MXC_CCM_UPCTL_MFN_MASK 0x3ff -+#define MXC_CCM_UPCTL_LF (1 << 15) -+ -+#define MXC_CCM_CCTL_ARM_OFFSET 30 -+#define MXC_CCM_CCTL_ARM_MASK (0x3 << 30) -+#define MXC_CCM_CCTL_AHB_OFFSET 28 -+#define MXC_CCM_CCTL_AHB_MASK (0x3 << 28) -+#define MXC_CCM_CCTL_MPLL_RST (1 << 27) -+#define MXC_CCM_CCTL_UPLL_RST (1 << 26) -+#define MXC_CCM_CCTL_LP_CTL_OFFSET 24 -+#define MXC_CCM_CCTL_LP_CTL_MASK (0x3 << 24) -+#define MXC_CCM_CCTL_LP_MODE_RUN (0x0 << 24) -+#define MXC_CCM_CCTL_LP_MODE_WAIT (0x1 << 24) -+#define MXC_CCM_CCTL_LP_MODE_DOZE (0x2 << 24) -+#define MXC_CCM_CCTL_LP_MODE_STOP (0x3 << 24) -+#define MXC_CCM_CCTL_UPLL_DISABLE (1 << 23) -+#define MXC_CCM_CCTL_MPLL_BYPASS (1 << 22) -+#define MXC_CCM_CCTL_USB_DIV_OFFSET 16 -+#define MXC_CCM_CCTL_USB_DIV_MASK (0x3 << 16) -+#define MXC_CCM_CCTL_CG_CTRL (1 << 15) -+#define MXC_CCM_CCTL_ARM_SRC (1 << 14) -+ -+#define MXC_CCM_CGCR0_HCLK_ATA_OFFSET (16 + 0) -+#define MXC_CCM_CGCR0_HCLK_BROM_OFFSET (16 + 1) -+#define MXC_CCM_CGCR0_HCLK_CSI_OFFSET (16 + 2) -+#define MXC_CCM_CGCR0_HCLK_EMI_OFFSET (16 + 3) -+#define MXC_CCM_CGCR0_HCLK_ESAI_OFFSET (16 + 4) -+#define MXC_CCM_CGCR0_HCLK_ESDHC1_OFFSET (16 + 5) -+#define MXC_CCM_CGCR0_HCLK_ESDHC2_OFFSET (16 + 6) -+#define MXC_CCM_CGCR0_HCLK_FEC_OFFSET (16 + 7) -+#define MXC_CCM_CGCR0_HCLK_LCDC_OFFSET (16 + 8) -+#define MXC_CCM_CGCR0_HCLK_RTIC_OFFSET (16 + 9) -+#define MXC_CCM_CGCR0_HCLK_SDMA_OFFSET (16 + 10) -+#define MXC_CCM_CGCR0_HCLK_SLCDC_OFFSET (16 + 11) -+#define MXC_CCM_CGCR0_HCLK_USBOTG_OFFSET (16 + 12) -+ -+#define MXC_CCM_CGCR0_PER_CSI_OFFSET 0 -+#define MXC_CCM_CGCR0_PER_EPIT_OFFSET 1 -+#define MXC_CCM_CGCR0_PER_ESAI_OFFSET 2 -+#define MXC_CCM_CGCR0_PER_ESDHC1_OFFSET 3 -+#define MXC_CCM_CGCR0_PER_ESDHC2_OFFSET 4 -+#define MXC_CCM_CGCR0_PER_GPT_OFFSET 5 -+#define MXC_CCM_CGCR0_PER_I2C_OFFSET 6 -+#define MXC_CCM_CGCR0_PER_LCDC_OFFSET 7 -+#define MXC_CCM_CGCR0_PER_NFC_OFFSET 8 -+#define MXC_CCM_CGCR0_PER_OWIRE_OFFSET 9 -+#define MXC_CCM_CGCR0_PER_PWM_OFFSET 10 -+#define MXC_CCM_CGCR0_PER_SIM1_OFFSET 11 -+#define MXC_CCM_CGCR0_PER_SIM2_OFFSET 12 -+#define MXC_CCM_CGCR0_PER_SSI1_OFFSET 13 -+#define MXC_CCM_CGCR0_PER_SSI2_OFFSET 14 -+#define MXC_CCM_CGCR0_PER_UART_OFFSET 15 -+ -+#define MXC_CCM_CGCR1_AUDMUX_OFFSET 0 -+#define MXC_CCM_CGCR1_ATA_OFFSET 1 -+#define MXC_CCM_CGCR1_CAN1_OFFSET 2 -+#define MXC_CCM_CGCR1_CAN2_OFFSET 3 -+#define MXC_CCM_CGCR1_CSI_OFFSET 4 -+#define MXC_CCM_CGCR1_CSPI1_OFFSET 5 -+#define MXC_CCM_CGCR1_CSPI2_OFFSET 6 -+#define MXC_CCM_CGCR1_CSPI3_OFFSET 7 -+#define MXC_CCM_CGCR1_DRYICE_OFFSET 8 -+#define MXC_CCM_CGCR1_ECT_OFFSET 9 -+#define MXC_CCM_CGCR1_EPIT1_OFFSET 10 -+#define MXC_CCM_CGCR1_EPIT2_OFFSET 11 -+#define MXC_CCM_CGCR1_ESAI_OFFSET 12 -+#define MXC_CCM_CGCR1_ESDHC1_OFFSET 13 -+#define MXC_CCM_CGCR1_ESDHC2_OFFSET 14 -+#define MXC_CCM_CGCR1_FEC_OFFSET 15 -+#define MXC_CCM_CGCR1_GPIO1_OFFSET 16 -+#define MXC_CCM_CGCR1_GPIO2_OFFSET 17 -+#define MXC_CCM_CGCR1_GPIO3_OFFSET 18 -+#define MXC_CCM_CGCR1_GPT1_OFFSET 19 -+#define MXC_CCM_CGCR1_GPT2_OFFSET 20 -+#define MXC_CCM_CGCR1_GPT3_OFFSET 21 -+#define MXC_CCM_CGCR1_GPT4_OFFSET 22 -+#define MXC_CCM_CGCR1_I2C1_OFFSET 23 -+#define MXC_CCM_CGCR1_I2C2_OFFSET 24 -+#define MXC_CCM_CGCR1_I2C3_OFFSET 25 -+#define MXC_CCM_CGCR1_IIM_OFFSET 26 -+#define MXC_CCM_CGCR1_IOMUXC_OFFSET 27 -+#define MXC_CCM_CGCR1_KPP_OFFSET 28 -+#define MXC_CCM_CGCR1_LCDC_OFFSET 29 -+#define MXC_CCM_CGCR1_OWIRE_OFFSET 30 -+#define MXC_CCM_CGCR1_PWM1_OFFSET 31 -+ -+#define MXC_CCM_CGCR2_PWM2_OFFSET (32 - 32) -+#define MXC_CCM_CGCR2_PWM3_OFFSET (33 - 32) -+#define MXC_CCM_CGCR2_PWM4_OFFSET (34 - 32) -+#define MXC_CCM_CGCR2_RNGB_OFFSET (35 - 32) -+#define MXC_CCM_CGCR2_RTIC_OFFSET (36 - 32) -+#define MXC_CCM_CGCR2_SCC_OFFSET (37 - 32) -+#define MXC_CCM_CGCR2_SDMA_OFFSET (38 - 32) -+#define MXC_CCM_CGCR2_SIM1_OFFSET (39 - 32) -+#define MXC_CCM_CGCR2_SIM2_OFFSET (40 - 32) -+#define MXC_CCM_CGCR2_SLCDC_OFFSET (41 - 32) -+#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_UART1_OFFSET (46 - 32) -+#define MXC_CCM_CGCR2_UART2_OFFSET (47 - 32) -+#define MXC_CCM_CGCR2_UART3_OFFSET (48 - 32) -+#define MXC_CCM_CGCR2_UART4_OFFSET (49 - 32) -+#define MXC_CCM_CGCR2_UART5_OFFSET (50 - 32) -+#define MXC_CCM_CGCR2_WDOG_OFFSET (51 - 32) -+ -+#define MXC_CCM_PCDR1_PERDIV1_MASK 0x3f -+ -+#define MXC_CCM_MCR_USB_XTAL_MUX_OFFSET 31 -+#define MXC_CCM_MCR_CLKO_EN_OFFSET 30 -+#define MXC_CCM_MCR_CLKO_DIV_OFFSET 24 -+#define MXC_CCM_MCR_CLKO_DIV_MASK (0x3F << 24) -+#define MXC_CCM_MCR_CLKO_SEL_OFFSET 20 -+#define MXC_CCM_MCR_CLKO_SEL_MASK (0xF << 20) -+#define MXC_CCM_MCR_ESAI_CLK_MUX_OFFSET 19 -+#define MXC_CCM_MCR_SSI2_CLK_MUX_OFFSET 18 -+#define MXC_CCM_MCR_SSI1_CLK_MUX_OFFSET 17 -+#define MXC_CCM_MCR_USB_CLK_MUX_OFFSET 16 -+ -+#define MXC_CCM_MCR_PER_CLK_MUX_MASK (0xFFFF << 0) -+ -+#define OSC24M_CLK_FREQ 24000000 /* 24MHz reference clk */ -+#define OSC32K_CLK_FREQ 32768 /* 32.768kHz oscillator in */ -+ -+static struct clk mpll_clk; -+static struct clk upll_clk; -+static struct clk ahb_clk; -+static struct clk upll_24610k_clk; -+ -+static int _clk_enable(struct clk *clk) -+{ -+ unsigned long reg; -+ -+ if (!clk->enable_reg) -+ return 0; -+ -+ reg = __raw_readl(clk->enable_reg); -+ reg |= 1 << clk->enable_shift; -+ __raw_writel(reg, clk->enable_reg); -+ -+ return 0; -+} -+ -+static void _clk_disable(struct clk *clk) -+{ -+ unsigned long reg; -+ -+ if (!clk->enable_reg) -+ return; -+ -+ reg = __raw_readl(clk->enable_reg); -+ reg &= ~(1 << clk->enable_shift); -+ __raw_writel(reg, clk->enable_reg); -+} -+ -+static int _clk_upll_enable(struct clk *clk) -+{ -+ unsigned long reg; -+ -+ reg = __raw_readl(MXC_CCM_CCTL); -+ reg &= ~MXC_CCM_CCTL_UPLL_DISABLE; -+ __raw_writel(reg, MXC_CCM_CCTL); -+ -+ while (!(__raw_readl(MXC_CCM_UPCTL) & MXC_CCM_UPCTL_LF)) -+ cpu_relax(); -+ -+ return 0; -+} -+ -+static void _clk_upll_disable(struct clk *clk) -+{ -+ unsigned long reg; -+ -+ reg = __raw_readl(MXC_CCM_CCTL); -+ reg |= MXC_CCM_CCTL_UPLL_DISABLE; -+ __raw_writel(reg, MXC_CCM_CCTL); -+} -+ -+static int _perclk_enable(struct clk *clk) -+{ -+ unsigned long reg; -+ -+ reg = __raw_readl(MXC_CCM_CGCR0); -+ reg |= 1 << clk->id; -+ __raw_writel(reg, MXC_CCM_CGCR0); -+ -+ return 0; -+} -+ -+static void _perclk_disable(struct clk *clk) -+{ -+ unsigned long reg; -+ -+ reg = __raw_readl(MXC_CCM_CGCR0); -+ reg &= ~(1 << clk->id); -+ __raw_writel(reg, MXC_CCM_CGCR0); -+} -+ -+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) */ -+ signed long mfn; /* Multiplication Factor (Integer part) */ -+ signed long mfd; /* Multiplication Factor (Denominator Part) */ -+ signed long tmp; -+ unsigned long ref_freq = clk_get_rate(clk->parent); -+ -+ 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; -+ 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); -+ -+ mfn = (mfn + ((mfn < 0) ? 1024 : 0)) & 0x3ff; -+ pd--; -+ mfd--; -+ -+ /* Change the Pll value */ -+ reg = (mfi << MXC_CCM_MPCTL_MFI_OFFSET) | -+ (mfn << MXC_CCM_MPCTL_MFN_OFFSET) | -+ (mfd << MXC_CCM_MPCTL_MFD_OFFSET) | -+ (pd << MXC_CCM_MPCTL_PD_OFFSET); -+ -+ if (clk == &mpll_clk) { -+ printk(KERN_DEBUG "Changing MPCTL from %08x to %08lx\n", -+ __raw_readl(MXC_CCM_MPCTL), reg); -+ } else if (clk == &upll_clk) { -+ printk(KERN_DEBUG "Changing UPCTL from %08x to %08lx\n", -+ __raw_readl(MXC_CCM_UPCTL), reg); -+ } -+ if (clk == &mpll_clk) -+ __raw_writel(reg, MXC_CCM_MPCTL); -+ else if (clk == &upll_clk) -+ __raw_writel(reg, MXC_CCM_UPCTL); -+ return 0; -+} -+ -+static unsigned long _clk_pll_getrate(struct clk *clk) -+{ -+ unsigned long rate; -+ signed long mfi, mfn, mfd, pdf; -+ unsigned long ref_clk; -+ unsigned long reg; -+ -+ ref_clk = clk_get_rate(clk->parent); -+ -+ if (clk == &mpll_clk) { -+ reg = __raw_readl(MXC_CCM_MPCTL); -+ pdf = (reg & MXC_CCM_MPCTL_PD_MASK) >> MXC_CCM_MPCTL_PD_OFFSET; -+ mfd = (reg & MXC_CCM_MPCTL_MFD_MASK) >> MXC_CCM_MPCTL_MFD_OFFSET; -+ mfi = (reg & MXC_CCM_MPCTL_MFI_MASK) >> MXC_CCM_MPCTL_MFI_OFFSET; -+ mfn = (reg & MXC_CCM_MPCTL_MFN_MASK) >> MXC_CCM_MPCTL_MFN_OFFSET; -+ } else if (clk == &upll_clk) { -+ reg = __raw_readl(MXC_CCM_UPCTL); -+ pdf = (reg & MXC_CCM_UPCTL_PD_MASK) >> MXC_CCM_UPCTL_PD_OFFSET; -+ mfd = (reg & MXC_CCM_UPCTL_MFD_MASK) >> MXC_CCM_UPCTL_MFD_OFFSET; -+ mfi = (reg & MXC_CCM_UPCTL_MFI_MASK) >> MXC_CCM_UPCTL_MFI_OFFSET; -+ mfn = (reg & MXC_CCM_UPCTL_MFN_MASK) >> MXC_CCM_UPCTL_MFN_OFFSET; -+ } else { -+ BUG(); /* oops */ -+ } -+ -+ mfi = (mfi < 5) ? 5 : mfi; -+ rate = 2LL * ref_clk * mfn; -+ do_div(rate, mfd + 1); -+ rate = 2LL * ref_clk * mfi + rate; -+ do_div(rate, pdf + 1); -+ -+ return rate; -+} -+ -+static unsigned long _clk_cpu_round_rate(struct clk *clk, unsigned long rate) -+{ -+ int div = clk_get_rate(clk->parent) / rate; -+ -+ if (clk_get_rate(clk->parent) % rate) -+ div++; -+ -+ if (div > 4) -+ div = 4; -+ -+ return clk_get_rate(clk->parent) / div; -+} -+ -+static int _clk_cpu_set_rate(struct clk *clk, unsigned long rate) -+{ -+ int div, reg; -+ unsigned long cctl = __raw_readl(MXC_CCM_CCTL); -+ -+ div = clk_get_rate(clk->parent) / rate; -+ -+ if (div > 4 || div < 1 || ((clk_get_rate(clk->parent) / div) != rate)) -+ return -EINVAL; -+ div--; -+ -+ reg = (cctl & ~MXC_CCM_CCTL_ARM_MASK) | -+ (div << MXC_CCM_CCTL_ARM_OFFSET); -+ __raw_writel(reg, MXC_CCM_CCTL); -+ -+ return 0; -+} -+ -+static unsigned long _clk_cpu_getrate(struct clk *clk) -+{ -+ unsigned long div; -+ unsigned long cctl = __raw_readl(MXC_CCM_CCTL); -+ unsigned long rate; -+ -+ div = (cctl & MXC_CCM_CCTL_ARM_MASK) >> MXC_CCM_CCTL_ARM_OFFSET; -+ -+ rate = clk_get_rate(clk->parent) / (div + 1); -+ -+ if (cctl & MXC_CCM_CCTL_ARM_SRC) { -+ rate *= 3; -+ rate /= 4; -+ } -+ return rate; -+} -+ -+static unsigned long _clk_ahb_getrate(struct clk *clk) -+{ -+ unsigned long div; -+ unsigned long cctl = __raw_readl(MXC_CCM_CCTL); -+ -+ div = (cctl & MXC_CCM_CCTL_AHB_MASK) >> MXC_CCM_CCTL_AHB_OFFSET; -+ -+ return clk_get_rate(clk->parent) / (div + 1); -+} -+ -+static void __iomem *pcdr_a[4] = { -+ MXC_CCM_PCDR0, MXC_CCM_PCDR1, MXC_CCM_PCDR2, MXC_CCM_PCDR3 -+}; -+ -+static unsigned long _clk_perclkx_getrate(struct clk *clk) -+{ -+ unsigned long perclk_pdf; -+ unsigned long pcdr; -+ -+ if (clk->id < 0 || clk->id > 15) -+ return 0; -+ -+ pcdr = __raw_readl(pcdr_a[clk->id >> 2]); -+ -+ perclk_pdf = -+ (pcdr >> ((clk->id & 3) << 3)) & MXC_CCM_PCDR1_PERDIV1_MASK; -+ -+ return clk_get_rate(clk->parent) / (perclk_pdf + 1); -+} -+ -+static unsigned long _clk_perclkx_round_rate(struct clk *clk, -+ unsigned long rate) -+{ -+ unsigned long div; -+ -+ div = clk_get_rate(clk->parent) / rate; -+ if (clk_get_rate(clk->parent) % rate) -+ div++; -+ -+ if (div > 64) -+ div = 64; -+ -+ return clk_get_rate(clk->parent) / div; -+} -+ -+static int _clk_perclkx_set_rate(struct clk *clk, unsigned long rate) -+{ -+ unsigned long reg; -+ unsigned long div; -+ -+ if (clk->id < 0 || clk->id > 15) -+ 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--; -+ -+ reg = -+ __raw_readl(pcdr_a[clk->id >> 2]) & ~(MXC_CCM_PCDR1_PERDIV1_MASK << -+ ((clk->id & 3) << 3)); -+ reg |= div << ((clk->id & 3) << 3); -+ __raw_writel(reg, pcdr_a[clk->id >> 2]); -+ -+ return 0; -+} -+ -+static int _clk_perclkx_set_parent(struct clk *clk, struct clk *parent) -+{ -+ unsigned long mcr; -+ -+ if (clk->parent == parent) -+ return 0; -+ if (parent != &upll_clk && parent != &ahb_clk) -+ return -EINVAL; -+ -+ clk->parent = parent; -+ mcr = __raw_readl(MXC_CCM_MCR); -+ if (parent == &upll_clk) -+ mcr |= (1 << clk->id); -+ else -+ mcr &= ~(1 << clk->id); -+ -+ __raw_writel(mcr, MXC_CCM_MCR); -+ -+ return 0; -+} -+ -+static int _clk_perclkx_set_parent3(struct clk *clk, struct clk *parent) -+{ -+ unsigned long mcr = __raw_readl(MXC_CCM_MCR); -+ int bit; -+ -+ if (clk->parent == parent) -+ return 0; -+ if (parent != &upll_clk && parent != &ahb_clk && -+ parent != &upll_24610k_clk) -+ return -EINVAL; -+ -+ switch (clk->id) { -+ case 2: -+ bit = MXC_CCM_MCR_ESAI_CLK_MUX_OFFSET; -+ break; -+ case 13: -+ bit = MXC_CCM_MCR_SSI1_CLK_MUX_OFFSET; -+ break; -+ case 14: -+ bit = MXC_CCM_MCR_SSI2_CLK_MUX_OFFSET; -+ break; -+ default: -+ return -EINVAL; -+ } -+ -+ if (parent == &upll_24610k_clk) { -+ mcr |= bit; -+ __raw_writel(mcr, MXC_CCM_MCR); -+ clk->parent = parent; -+ } else { -+ mcr &= ~bit; -+ __raw_writel(mcr, MXC_CCM_MCR); -+ return _clk_perclkx_set_parent(clk, parent); -+ } -+ -+ return 0; -+} -+ -+static unsigned long _clk_ipg_getrate(struct clk *clk) -+{ -+ return clk_get_rate(clk->parent) / 2; /* Always AHB / 2 */ -+} -+ -+/* Top-level clocks */ -+static unsigned long ckih_rate = OSC24M_CLK_FREQ; -+ -+static unsigned long clk_ckih_get_rate(struct clk *clk) -+{ -+ return ckih_rate; -+} -+ -+static unsigned long clk_ckil_get_rate(struct clk *clk) -+{ -+ return OSC32K_CLK_FREQ; -+} -+ -+static struct clk osc24m_clk = { -+ .get_rate = clk_ckih_get_rate, -+}; -+ -+static struct clk osc32k_clk = { -+ .get_rate = clk_ckil_get_rate, -+}; -+ -+static struct clk mpll_clk = { -+ .parent = &osc24m_clk, -+ .get_rate = _clk_pll_getrate, -+ .set_rate = _clk_pll_set_rate, -+}; -+ -+static struct clk upll_clk = { -+ .parent = &osc24m_clk, -+ .get_rate = _clk_pll_getrate, -+ .set_rate = _clk_pll_set_rate, -+ .enable = _clk_upll_enable, -+ .disable = _clk_upll_disable, -+}; -+ -+static unsigned long _clk_24610k_getrate(struct clk *clk) -+{ -+ long long rate = clk_get_rate(clk->parent) * 2461LL; -+ -+ do_div(rate, 24000); -+ -+ return rate; /* Always (UPLL * 24.61 / 240) */ -+} -+ -+static struct clk upll_24610k_clk = { -+ .parent = &upll_clk, -+ .get_rate = _clk_24610k_getrate, -+}; -+ -+/* Mid-level clocks */ -+ -+static struct clk cpu_clk = { /* ARM clock */ -+ .parent = &mpll_clk, -+ .set_rate = _clk_cpu_set_rate, -+ .get_rate = _clk_cpu_getrate, -+ .round_rate = _clk_cpu_round_rate, -+}; -+ -+static struct clk ahb_clk = { /* a.k.a. HCLK */ -+ .parent = &cpu_clk, -+ .get_rate = _clk_ahb_getrate, -+}; -+ -+static struct clk ipg_clk = { -+ .parent = &ahb_clk, -+ .get_rate = _clk_ipg_getrate, -+}; -+ -+/* Bottom-level clocks */ -+ -+struct clk usbotg_clk = { -+ .id = 0, -+ .parent = &ahb_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR0, -+ .enable_shift = MXC_CCM_CGCR0_HCLK_USBOTG_OFFSET, -+ .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, -+}; -+ -+struct clk emi_clk = { -+ .id = 0, -+ .parent = &ahb_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR0, -+ .enable_shift = MXC_CCM_CGCR0_HCLK_EMI_OFFSET, -+ .disable = _clk_disable, -+}; -+ -+struct clk brom_clk = { -+ .id = 0, -+ .parent = &ahb_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR0, -+ .enable_shift = MXC_CCM_CGCR0_HCLK_BROM_OFFSET, -+ .disable = _clk_disable, -+}; -+ -+static struct clk per_clk[] = { -+ { -+ .id = 0, -+ .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, -+ .get_rate = _clk_perclkx_getrate, -+ .enable = _perclk_enable, -+ .disable = _perclk_disable, -+ }, -+ { -+ .id = 1, -+ .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, -+ .get_rate = _clk_perclkx_getrate, -+ .enable = _perclk_enable, -+ .disable = _perclk_disable, -+ }, -+ { -+ .id = 2, -+ .parent = &ahb_clk, /* can be AHB or UPLL or 24.61MHz */ -+ .round_rate = _clk_perclkx_round_rate, -+ .set_rate = _clk_perclkx_set_rate, -+ .set_parent = _clk_perclkx_set_parent3, -+ .get_rate = _clk_perclkx_getrate, -+ .enable = _perclk_enable, -+ .disable = _perclk_disable, -+ }, -+ { -+ .id = 3, -+ .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, -+ .get_rate = _clk_perclkx_getrate, -+ .enable = _perclk_enable, -+ }, -+ { -+ .id = 4, -+ .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, -+ .get_rate = _clk_perclkx_getrate, -+ .enable = _perclk_enable, -+ .disable = _perclk_disable, -+ }, -+ { -+ .id = 5, -+ .parent = &upll_clk, /* can be AHB or UPLL */ -+ .round_rate = _clk_perclkx_round_rate, -+ .set_rate = _clk_perclkx_set_rate, -+ .set_parent = _clk_perclkx_set_parent, -+ .get_rate = _clk_perclkx_getrate, -+ .enable = _perclk_enable, -+ .disable = _perclk_disable, -+ }, -+ { -+ .id = 6, -+ .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, -+ .get_rate = _clk_perclkx_getrate, -+ .enable = _perclk_enable, -+ .disable = _perclk_disable, -+ }, -+ { -+ .id = 7, -+ .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, -+ .get_rate = _clk_perclkx_getrate, -+ .enable = _perclk_enable, -+ .disable = _perclk_disable, -+ }, -+ { -+ .id = 8, -+ .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, -+ .get_rate = _clk_perclkx_getrate, -+ .enable = _perclk_enable, -+ .disable = _perclk_disable, -+ }, -+ { -+ .id = 9, -+ .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, -+ .get_rate = _clk_perclkx_getrate, -+ .enable = _perclk_enable, -+ .disable = _perclk_disable, -+ }, -+ { -+ .id = 10, -+ .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, -+ .get_rate = _clk_perclkx_getrate, -+ .enable = _perclk_enable, -+ .disable = _perclk_disable, -+ }, -+ { -+ .id = 11, -+ .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, -+ .get_rate = _clk_perclkx_getrate, -+ .enable = _perclk_enable, -+ .disable = _perclk_disable, -+ }, -+ { -+ .id = 12, -+ .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, -+ .get_rate = _clk_perclkx_getrate, -+ .enable = _perclk_enable, -+ .disable = _perclk_disable, -+ }, -+ { -+ .id = 13, -+ .parent = &ahb_clk, /* can be AHB or UPLL or 24.61MHz */ -+ .round_rate = _clk_perclkx_round_rate, -+ .set_rate = _clk_perclkx_set_rate, -+ .set_parent = _clk_perclkx_set_parent3, -+ .get_rate = _clk_perclkx_getrate, -+ .enable = _perclk_enable, -+ .disable = _perclk_disable, -+ }, -+ { -+ .id = 14, -+ .parent = &ahb_clk, /* can be AHB or UPLL or 24.61MHz */ -+ .round_rate = _clk_perclkx_round_rate, -+ .set_rate = _clk_perclkx_set_rate, -+ .set_parent = _clk_perclkx_set_parent3, -+ .get_rate = _clk_perclkx_getrate, -+ .enable = _perclk_enable, -+ .disable = _perclk_disable, -+ }, -+ { -+ .id = 15, -+ .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, -+ .get_rate = _clk_perclkx_getrate, -+ .enable = _perclk_enable, -+ .disable = _perclk_disable, -+ }, -+}; -+ -+struct clk nfc_clk = { -+ .id = 0, -+ .parent = &per_clk[8], -+}; -+ -+struct clk audmux_clk = { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_AUDMUX_OFFSET, -+ .disable = _clk_disable, -+}; -+ -+struct clk ata_clk[] = { -+ { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_ATA_OFFSET, -+ .disable = _clk_disable, -+ .secondary = &ata_clk[1], -+ }, -+ { -+ .id = 0, -+ .parent = &ahb_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR0, -+ .enable_shift = MXC_CCM_CGCR0_HCLK_ATA_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk can_clk[] = { -+ { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_CAN1_OFFSET, -+ .disable = _clk_disable, -+ }, -+ { -+ .id = 1, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_CAN2_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk csi_clk[] = { -+ { -+ .id = 0, -+ .parent = &per_clk[0], -+ .secondary = &csi_clk[1], -+ }, -+ { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_CSI_OFFSET, -+ .disable = _clk_disable, -+ .secondary = &csi_clk[2], -+ }, -+ { -+ .id = 0, -+ .parent = &ahb_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR0, -+ .enable_shift = MXC_CCM_CGCR0_HCLK_CSI_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk cspi_clk[] = { -+ { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_CSPI1_OFFSET, -+ .disable = _clk_disable, -+ }, -+ { -+ .id = 1, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_CSPI2_OFFSET, -+ .disable = _clk_disable, -+ }, -+ { -+ .id = 2, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_CSPI3_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk dryice_clk = { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_DRYICE_OFFSET, -+ .disable = _clk_disable, -+}; -+ -+struct clk ect_clk = { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_ECT_OFFSET, -+ .disable = _clk_disable, -+}; -+ -+struct clk epit1_clk[] = { -+ { -+ .id = 0, -+ .parent = &per_clk[1], -+ .secondary = &epit1_clk[1], -+ }, -+ { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_EPIT1_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk epit2_clk[] = { -+ { -+ .id = 1, -+ .parent = &per_clk[1], -+ .secondary = &epit2_clk[1], -+ }, -+ { -+ .id = 1, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_EPIT2_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk esai_clk[] = { -+ { -+ .id = 0, -+ .parent = &per_clk[2], -+ .secondary = &esai_clk[1], -+ }, -+ { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_ESAI_OFFSET, -+ .disable = _clk_disable, -+ .secondary = &esai_clk[2], -+ }, -+ { -+ .id = 0, -+ .parent = &ahb_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR0, -+ .enable_shift = MXC_CCM_CGCR0_HCLK_ESAI_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk esdhc1_clk[] = { -+ { -+ .id = 0, -+ .parent = &per_clk[3], -+ .secondary = &esdhc1_clk[1], -+ }, -+ { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_ESDHC1_OFFSET, -+ .disable = _clk_disable, -+ .secondary = &esdhc1_clk[2], -+ }, -+ { -+ .id = 0, -+ .parent = &ahb_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR0, -+ .enable_shift = MXC_CCM_CGCR0_HCLK_ESDHC1_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk esdhc2_clk[] = { -+ { -+ .id = 1, -+ .parent = &per_clk[4], -+ .secondary = &esdhc2_clk[1], -+ }, -+ { -+ .id = 1, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_ESDHC2_OFFSET, -+ .disable = _clk_disable, -+ .secondary = &esdhc2_clk[2], -+ }, -+ { -+ .id = 1, -+ .parent = &ahb_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR0, -+ .enable_shift = MXC_CCM_CGCR0_HCLK_ESDHC2_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk fec_clk[] = { -+ { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_FEC_OFFSET, -+ .disable = _clk_disable, -+ .secondary = &fec_clk[1], -+ }, -+ { -+ .id = 0, -+ .parent = &ahb_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR0, -+ .enable_shift = MXC_CCM_CGCR0_HCLK_FEC_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk gpio_clk[] = { -+ { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_GPIO1_OFFSET, -+ .disable = _clk_disable, -+ }, -+ { -+ .id = 1, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_GPIO2_OFFSET, -+ .disable = _clk_disable, -+ }, -+ { -+ .id = 2, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_GPIO3_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+static struct clk gpt1_clk[] = { -+ { -+ .id = 0, -+ .parent = &per_clk[5], -+ .secondary = &gpt1_clk[1], -+ }, -+ { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_GPT1_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+static struct clk gpt2_clk[] = { -+ { -+ .id = 1, -+ .parent = &per_clk[5], -+ .secondary = &gpt1_clk[1], -+ }, -+ { -+ .id = 1, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_GPT2_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+static struct clk gpt3_clk[] = { -+ { -+ .id = 2, -+ .parent = &per_clk[5], -+ .secondary = &gpt1_clk[1], -+ }, -+ { -+ .id = 2, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_GPT3_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+static struct clk gpt4_clk[] = { -+ { -+ .id = 3, -+ .parent = &per_clk[5], -+ .secondary = &gpt1_clk[1], -+ }, -+ { -+ .id = 3, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_GPT4_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk i2c_clk[] = { -+ { -+ .id = 0, -+ .parent = &per_clk[6], -+ }, -+ { -+ .id = 1, -+ .parent = &per_clk[6], -+ }, -+ { -+ .id = 2, -+ .parent = &per_clk[6], -+ }, -+}; -+ -+struct clk iim_clk = { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_IIM_OFFSET, -+ .disable = _clk_disable, -+}; -+ -+struct clk iomuxc_clk = { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_IOMUXC_OFFSET, -+ .disable = _clk_disable, -+}; -+ -+struct clk kpp_clk = { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_KPP_OFFSET, -+ .disable = _clk_disable, -+}; -+ -+struct clk lcdc_clk[] = { -+ { -+ .id = 0, -+ .parent = &per_clk[7], -+ .secondary = &lcdc_clk[1], -+ }, -+ { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_LCDC_OFFSET, -+ .disable = _clk_disable, -+ .secondary = &lcdc_clk[2], -+ }, -+ { -+ .id = 0, -+ .parent = &ahb_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR0, -+ .enable_shift = MXC_CCM_CGCR0_HCLK_LCDC_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk owire_clk[] = { -+ { -+ .id = 0, -+ .parent = &per_clk[9], -+ .secondary = &owire_clk[1], -+ }, -+ { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_OWIRE_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk pwm1_clk[] = { -+ { -+ .id = 0, -+ .parent = &per_clk[10], -+ .secondary = &pwm1_clk[1], -+ }, -+ { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR1, -+ .enable_shift = MXC_CCM_CGCR1_PWM1_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk pwm2_clk[] = { -+ { -+ .id = 1, -+ .parent = &per_clk[10], -+ .secondary = &pwm2_clk[1], -+ }, -+ { -+ .id = 1, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR2, -+ .enable_shift = MXC_CCM_CGCR2_PWM2_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk pwm3_clk[] = { -+ { -+ .id = 2, -+ .parent = &per_clk[10], -+ .secondary = &pwm3_clk[1], -+ }, -+ { -+ .id = 2, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR2, -+ .enable_shift = MXC_CCM_CGCR2_PWM3_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk pwm4_clk[] = { -+ { -+ .id = 3, -+ .parent = &per_clk[10], -+ .secondary = &pwm4_clk[1], -+ }, -+ { -+ .id = 3, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR2, -+ .enable_shift = MXC_CCM_CGCR2_PWM3_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk rngb_clk = { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR2, -+ .enable_shift = MXC_CCM_CGCR2_RNGB_OFFSET, -+ .disable = _clk_disable, -+}; -+ -+struct clk scc_clk = { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR2, -+ .enable_shift = MXC_CCM_CGCR2_SCC_OFFSET, -+ .disable = _clk_disable, -+}; -+ -+struct clk sdma_clk[] = { -+ { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR2, -+ .enable_shift = MXC_CCM_CGCR2_SDMA_OFFSET, -+ .disable = _clk_disable, -+ .secondary = &sdma_clk[1], -+ }, -+ { -+ .id = 0, -+ .parent = &ahb_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR0, -+ .enable_shift = MXC_CCM_CGCR0_HCLK_SDMA_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk sim1_clk[] = { -+ { -+ .id = 0, -+ .parent = &per_clk[11], -+ .secondary = &sim1_clk[1], -+ }, -+ { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR2, -+ .enable_shift = MXC_CCM_CGCR2_SIM1_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk sim2_clk[] = { -+ { -+ .id = 1, -+ .parent = &per_clk[12], -+ .secondary = &sim2_clk[1], -+ }, -+ { -+ .id = 1, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR2, -+ .enable_shift = MXC_CCM_CGCR2_SIM2_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk slcdc_clk[] = { -+ { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR2, -+ .enable_shift = MXC_CCM_CGCR2_SLCDC_OFFSET, -+ .disable = _clk_disable, -+ .secondary = &slcdc_clk[1], -+ }, -+ { -+ .id = 0, -+ .parent = &ahb_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR0, -+ .enable_shift = MXC_CCM_CGCR0_HCLK_SLCDC_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk spba_clk = { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR2, -+ .enable_shift = MXC_CCM_CGCR2_SPBA_OFFSET, -+ .disable = _clk_disable, -+}; -+ -+struct clk ssi1_clk[] = { -+ { -+ .id = 0, -+ .parent = &per_clk[13], -+ .secondary = &ssi1_clk[1], -+ }, -+ { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR2, -+ .enable_shift = MXC_CCM_CGCR2_SSI1_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk ssi2_clk[] = { -+ { -+ .id = 1, -+ .parent = &per_clk[14], -+ .secondary = &ssi2_clk[1], -+ }, -+ { -+ .id = 1, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR2, -+ .enable_shift = MXC_CCM_CGCR2_SSI2_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk tchscrn_clk = { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR2, -+ .enable_shift = MXC_CCM_CGCR2_TCHSCRN_OFFSET, -+ .disable = _clk_disable, -+}; -+ -+struct clk uart1_clk[] = { -+ { -+ .id = 0, -+ .parent = &per_clk[15], -+ .secondary = &uart1_clk[1], -+ }, -+ { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR2, -+ .enable_shift = MXC_CCM_CGCR2_UART1_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk uart2_clk[] = { -+ { -+ .id = 1, -+ .parent = &per_clk[15], -+ .secondary = &uart2_clk[1], -+ }, -+ { -+ .id = 1, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR2, -+ .enable_shift = MXC_CCM_CGCR2_UART2_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk uart3_clk[] = { -+ { -+ .id = 2, -+ .parent = &per_clk[15], -+ .secondary = &uart3_clk[1], -+ }, -+ { -+ .id = 2, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR2, -+ .enable_shift = MXC_CCM_CGCR2_UART3_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk uart4_clk[] = { -+ { -+ .id = 3, -+ .parent = &per_clk[15], -+ .secondary = &uart4_clk[1], -+ }, -+ { -+ .id = 3, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR2, -+ .enable_shift = MXC_CCM_CGCR2_UART4_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk uart5_clk[] = { -+ { -+ .id = 4, -+ .parent = &per_clk[15], -+ .secondary = &uart5_clk[1], -+ }, -+ { -+ .id = 4, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR2, -+ .enable_shift = MXC_CCM_CGCR2_UART5_OFFSET, -+ .disable = _clk_disable, -+ }, -+}; -+ -+struct clk wdog_clk = { -+ .id = 0, -+ .parent = &ipg_clk, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_CGCR2, -+ .enable_shift = MXC_CCM_CGCR2_WDOG_OFFSET, -+ .disable = _clk_disable, -+}; -+ -+static unsigned long _clk_usb_round_rate(struct clk *clk, unsigned long rate) -+{ -+ unsigned long div; -+ -+ div = clk_get_rate(clk->parent) / rate; -+ if (clk_get_rate(clk->parent) % rate) -+ div++; -+ -+ if (div > 64) -+ return -EINVAL; -+ -+ return clk_get_rate(clk->parent) / div; -+} -+ -+static int _clk_usb_set_rate(struct clk *clk, unsigned long rate) -+{ -+ unsigned long reg; -+ unsigned long div; -+ -+ div = clk_get_rate(clk->parent) / rate; -+ -+ if (clk_get_rate(clk->parent) / div != rate) -+ return -EINVAL; -+ if (div > 64) -+ return -EINVAL; -+ -+ reg = __raw_readl(MXC_CCM_CCTL) & ~MXC_CCM_CCTL_USB_DIV_MASK; -+ reg |= (div - 1) << MXC_CCM_CCTL_USB_DIV_OFFSET; -+ __raw_writel(reg, MXC_CCM_MCR); -+ -+ return 0; -+} -+ -+static unsigned long _clk_usb_getrate(struct clk *clk) -+{ -+ unsigned long 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); -+} -+ -+static int _clk_usb_set_parent(struct clk *clk, struct clk *parent) -+{ -+ unsigned long mcr; -+ -+ if (clk->parent == parent) -+ return 0; -+ if (parent != &upll_clk && parent != &ahb_clk) -+ return -EINVAL; -+ -+ clk->parent = parent; -+ mcr = __raw_readl(MXC_CCM_MCR); -+ if (parent == &ahb_clk) -+ mcr |= (1 << MXC_CCM_MCR_USB_CLK_MUX_OFFSET); -+ else -+ mcr &= ~(1 << MXC_CCM_MCR_USB_CLK_MUX_OFFSET); -+ -+ __raw_writel(mcr, MXC_CCM_MCR); -+ -+ return 0; -+} -+ -+static struct clk usb_clk = { -+ .parent = &upll_clk, -+ .get_rate = _clk_usb_getrate, -+ .set_rate = _clk_usb_set_rate, -+ .round_rate = _clk_usb_round_rate, -+ .set_parent = _clk_usb_set_parent, -+}; -+ -+/* CLKO */ -+ -+static unsigned long _clk_clko_round_rate(struct clk *clk, unsigned long rate) -+{ -+ unsigned long div; -+ -+ div = clk_get_rate(clk->parent) / rate; -+ if (clk_get_rate(clk->parent) % rate) -+ div++; -+ -+ if (div > 64) -+ return -EINVAL; -+ -+ return clk_get_rate(clk->parent) / div; -+} -+ -+static int _clk_clko_set_rate(struct clk *clk, unsigned long rate) -+{ -+ unsigned long reg; -+ unsigned long div; -+ -+ div = clk_get_rate(clk->parent) / rate; -+ -+ if ((clk_get_rate(clk->parent) / div) != rate) -+ return -EINVAL; -+ if (div > 64) -+ return -EINVAL; -+ -+ reg = __raw_readl(MXC_CCM_MCR) & ~MXC_CCM_MCR_CLKO_DIV_MASK; -+ reg |= (div - 1) << MXC_CCM_MCR_CLKO_DIV_OFFSET; -+ __raw_writel(reg, MXC_CCM_MCR); -+ -+ return 0; -+} -+ -+static unsigned long _clk_clko_getrate(struct clk *clk) -+{ -+ unsigned long div = __raw_readl(MXC_CCM_MCR); -+ -+ div &= MXC_CCM_MCR_CLKO_DIV_MASK; -+ div >>= MXC_CCM_MCR_CLKO_DIV_OFFSET; -+ -+ return clk_get_rate(clk->parent) / (div + 1); -+} -+ -+static struct clk *clko_sources[] = { -+ &osc32k_clk, /* 0x0 */ -+ &osc24m_clk, /* 0x1 */ -+ &cpu_clk, /* 0x2 */ -+ &ahb_clk, /* 0x3 */ -+ &ipg_clk, /* 0x4 */ -+ NULL, /* 0x5 */ -+ NULL, /* 0x6 */ -+ NULL, /* 0x7 */ -+ NULL, /* 0x8 */ -+ NULL, /* 0x9 */ -+ &per_clk[0], /* 0xA */ -+ &per_clk[2], /* 0xB */ -+ &per_clk[13], /* 0xC */ -+ &per_clk[14], /* 0xD */ -+ &usb_clk, /* 0xE */ -+ NULL, /* 0xF */ -+}; -+ -+#define NR_CLKO_SOURCES (sizeof(clko_sources) / sizeof(struct clk *)) -+ -+static int _clk_clko_set_parent(struct clk *clk, struct clk *parent) -+{ -+ unsigned long reg; -+ struct clk **src; -+ int i; -+ -+ if (clk->parent == parent) -+ return 0; -+ for (i = 0, src = clko_sources; i < NR_CLKO_SOURCES; i++, src++) -+ if (*src == parent) -+ break; -+ -+ if (i == NR_CLKO_SOURCES) -+ return -EINVAL; -+ -+ clk->parent = parent; -+ -+ reg = __raw_readl(MXC_CCM_MCR) & ~MXC_CCM_MCR_CLKO_SEL_MASK; -+ reg |= i << MXC_CCM_MCR_CLKO_SEL_OFFSET; -+ __raw_writel(reg, MXC_CCM_MCR); -+ -+ return 0; -+} -+ -+static struct clk clko_clk = { -+ .set_rate = _clk_clko_set_rate, -+ .round_rate = _clk_clko_round_rate, -+ .set_parent = _clk_clko_set_parent, -+ .get_rate = _clk_clko_getrate, -+ .enable = _clk_enable, -+ .enable_reg = MXC_CCM_MCR, -+ .enable_shift = MXC_CCM_MCR_CLKO_EN_OFFSET, -+ .disable = _clk_disable, -+}; -+ -+#define _REGISTER_CLOCK(d, n, c) \ -+ { \ -+ .dev_id = d, \ -+ .con_id = n, \ -+ .clk = &c, \ -+ }, -+ -+static struct clk_lookup lookups[] = { -+ _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(NULL, "csi", csi_clk[0]) -+ _REGISTER_CLOCK(NULL, "cspi.0", cspi_clk[0]) -+ _REGISTER_CLOCK(NULL, "cspi.1", cspi_clk[1]) -+ _REGISTER_CLOCK(NULL, "cspi.2", cspi_clk[2]) -+ _REGISTER_CLOCK(NULL, "dryice", dryice_clk) -+ _REGISTER_CLOCK(NULL, "ect", ect_clk) -+ _REGISTER_CLOCK(NULL, "epit1", epit1_clk[0]) -+ _REGISTER_CLOCK(NULL, "epit2", epit2_clk[0]) -+ _REGISTER_CLOCK(NULL, "esai", esai_clk[0]) -+ _REGISTER_CLOCK("mxc-mmc.0", NULL, esdhc1_clk[0]) -+ _REGISTER_CLOCK("mxc-mmc.1", NULL, esdhc2_clk[0]) -+ _REGISTER_CLOCK("fec.0", NULL, fec_clk[0]) -+ _REGISTER_CLOCK(NULL, "gpio0", gpio_clk[0]) -+ _REGISTER_CLOCK(NULL, "gpio1", gpio_clk[1]) -+ _REGISTER_CLOCK(NULL, "gpio2", gpio_clk[2]) -+ _REGISTER_CLOCK(NULL, "gpt1", gpt1_clk[0]) -+ _REGISTER_CLOCK(NULL, "gpt2", gpt2_clk[0]) -+ _REGISTER_CLOCK(NULL, "gpt3", gpt3_clk[0]) -+ _REGISTER_CLOCK(NULL, "gpt4", gpt4_clk[0]) -+ _REGISTER_CLOCK("imx-i2c.0", NULL, i2c_clk[0]) -+ _REGISTER_CLOCK("imx-i2c.1", NULL, i2c_clk[1]) -+ _REGISTER_CLOCK("imx-i2c.2", NULL, i2c_clk[2]) -+ _REGISTER_CLOCK(NULL, "iim", iim_clk) -+ _REGISTER_CLOCK(NULL, "iomuxc", iomuxc_clk) -+ _REGISTER_CLOCK(NULL, "kpp", kpp_clk) -+ _REGISTER_CLOCK("imx-fb.0", NULL, lcdc_clk[0]) -+ _REGISTER_CLOCK(NULL, "owire", owire_clk[0]) -+ _REGISTER_CLOCK("mxc_pwm.0", NULL, pwm1_clk[0]) -+ _REGISTER_CLOCK("mxc_pwm.1", NULL, pwm2_clk[0]) -+ _REGISTER_CLOCK("mxc_pwm.2", NULL, pwm3_clk[0]) -+ _REGISTER_CLOCK("mxc_pwm.3", NULL, pwm4_clk[0]) -+ _REGISTER_CLOCK(NULL, "rngb", rngb_clk) -+ _REGISTER_CLOCK(NULL, "scc", scc_clk) -+ _REGISTER_CLOCK(NULL, "sdma", sdma_clk[0]) -+ _REGISTER_CLOCK(NULL, "sim1", sim1_clk[0]) -+ _REGISTER_CLOCK(NULL, "sim2", sim2_clk[0]) -+ _REGISTER_CLOCK(NULL, "slcdc", slcdc_clk[0]) -+ _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("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("imx-wdt.0", NULL, wdog_clk) -+ _REGISTER_CLOCK(NULL, "usb", usb_clk) -+ _REGISTER_CLOCK(NULL, "clko", clko_clk) -+ _REGISTER_CLOCK(NULL, "brom", brom_clk) -+}; -+ -+int __init mx25_clocks_init(unsigned long fref) -+{ -+ int i; -+ -+ 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 : ""); -+ clkdev_add(&lookups[i]); -+ } -+ -+ ckih_rate = fref; -+#ifndef CONFIG_DEBUG_LL -+ /* Turn off all possible clocks */ -+ __raw_writel((1 << MXC_CCM_CGCR0_HCLK_EMI_OFFSET), MXC_CCM_CGCR0); -+ -+ __raw_writel((1 << MXC_CCM_CGCR1_GPT1_OFFSET) | -+ (1 << MXC_CCM_CGCR1_IIM_OFFSET), MXC_CCM_CGCR1); -+ __raw_writel(1 << MXC_CCM_CGCR2_SCC_OFFSET, MXC_CCM_CGCR2); -+#endif -+#if 1 -+ /* Set all perclk sources to upll */ -+ for (i = 0; i < ARRAY_SIZE(per_clk); i++) { -+ int ret; -+ unsigned long rate = per_clk[i].get_rate(&per_clk[i]); -+ -+#ifdef CONFIG_DEBUG_LL -+ if (i == 15) { -+ printk(KERN_DEBUG "skipping per_clk[%d] rate=%lu\n", i, rate); -+ continue; -+ } -+#endif -+ { -+ unsigned long new_rate; -+ -+ 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); -+ clk_set_rate(&per_clk[8], clk_get_rate(&ahb_clk) / 6); -+ -+ /* This will propagate to all children and init all the clock rates */ -+#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)); -+ -+ pr_info("CPU: %lu.%03luMHz\n", -+ clk_get_rate(&cpu_clk) / 1000000, clk_get_rate(&cpu_clk) / 1000 % 1000); -+ pr_info("AHB: %lu.%03luMHz\n", -+ clk_get_rate(&ahb_clk) / 1000000, clk_get_rate(&ahb_clk) / 1000 % 1000); -+ pr_info("MPLL: %lu.%03luMHz\n", -+ clk_get_rate(&mpll_clk) / 1000000, clk_get_rate(&mpll_clk) / 1000 % 1000); -+ pr_info("UPLL: %lu.%03luMHz\n", -+ clk_get_rate(&upll_clk) / 1000000, clk_get_rate(&upll_clk) / 1000 % 1000); -+ 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]); -+ 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:59:15.000000000 +0200 -@@ -621,7 +621,7 @@ DEFINE_CLOCK1(csi_clk, 0, 0, 0, - .clk = &c, \ - }, - --static struct clk_lookup lookups[] __initdata = { -+static struct clk_lookup lookups[] = { - _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:59:17.000000000 +0200 -@@ -0,0 +1,65 @@ -+/* -+ * arch/arm/mach-mx2/cpu_mx25.c -+ * -+ * Copyright 2009 Lothar Wassmann -+ * derived from: cpu_mx27.c -+ * Copyright 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., 51 Franklin Street, Fifth Floor, Boston, -+ * MA 02110-1301, USA. -+ */ -+ -+/* -+ * i.MX25 specific CPU detection code -+ */ -+ -+#include -+#include -+ -+#include -+ -+static int cpu_silicon_rev = -1; -+static int cpu_partnumber; -+ -+#define IIM_PREV_REG IO_ADDRESS(IIM_BASE_ADDR + 0x20) -+#define IIM_SREV_REG IO_ADDRESS(IIM_BASE_ADDR + 0x24) -+ -+static void query_silicon_parameter(void) -+{ -+ cpu_partnumber = __raw_readl(IIM_PREV_REG) >> 3; -+ cpu_silicon_rev = __raw_readl(IIM_SREV_REG); -+ -+ printk(KERN_DEBUG "CPU rev: 0x%02x chip_rev: 0x%02x\n", -+ cpu_partnumber, cpu_silicon_rev); -+ if (WARN_ON(cpu_partnumber != 0x1f)) { -+ printk(KERN_WARNING "Unsupported CPU rev: 0x%02x\n", cpu_partnumber); -+ } -+} -+ -+/* -+ * Returns: -+ * the silicon revision of the cpu -+ * -EINVAL - not a mx25 -+ */ -+int mx25_revision(void) -+{ -+ if (cpu_silicon_rev == -1) -+ query_silicon_parameter(); -+ -+ if (cpu_partnumber != 0x1f) -+ return -EINVAL; -+ -+ 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:59:17.000000000 +0200 -@@ -0,0 +1,190 @@ -+/* -+ * Copyright 2008 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 __ARCH_ARM_MACH_MX25_CRM_REGS_H__ -+#define __ARCH_ARM_MACH_MX25_CRM_REGS_H__ -+ -+#include -+ -+/* Register offsets */ -+#define MXC_CCM_MPCTL (IO_ADDRESS(CCM_BASE_ADDR) + 0x00) -+#define MXC_CCM_UPCTL (IO_ADDRESS(CCM_BASE_ADDR) + 0x04) -+#define MXC_CCM_CCTL (IO_ADDRESS(CCM_BASE_ADDR) + 0x08) -+#define MXC_CCM_CGCR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x0C) -+#define MXC_CCM_CGCR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x10) -+#define MXC_CCM_CGCR2 (IO_ADDRESS(CCM_BASE_ADDR) + 0x14) -+#define MXC_CCM_PCDR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x18) -+#define MXC_CCM_PCDR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x1C) -+#define MXC_CCM_PCDR2 (IO_ADDRESS(CCM_BASE_ADDR) + 0x20) -+#define MXC_CCM_PCDR3 (IO_ADDRESS(CCM_BASE_ADDR) + 0x24) -+#define MXC_CCM_RCSR (IO_ADDRESS(CCM_BASE_ADDR) + 0x28) -+#define MXC_CCM_CRDR (IO_ADDRESS(CCM_BASE_ADDR) + 0x2C) -+#define MXC_CCM_DCVR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x30) -+#define MXC_CCM_DCVR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x34) -+#define MXC_CCM_DCVR2 (IO_ADDRESS(CCM_BASE_ADDR) + 0x38) -+#define MXC_CCM_DCVR3 (IO_ADDRESS(CCM_BASE_ADDR) + 0x3C) -+#define MXC_CCM_LTR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x40) -+#define MXC_CCM_LTR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x44) -+#define MXC_CCM_LTR2 (IO_ADDRESS(CCM_BASE_ADDR) + 0x48) -+#define MXC_CCM_LTR3 (IO_ADDRESS(CCM_BASE_ADDR) + 0x4C) -+#define MXC_CCM_LTBR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x50) -+#define MXC_CCM_LTBR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x54) -+#define MXC_CCM_PMCR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x58) -+#define MXC_CCM_PMCR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x5C) -+#define MXC_CCM_PMCR2 (IO_ADDRESS(CCM_BASE_ADDR) + 0x60) -+#define MXC_CCM_MCR (IO_ADDRESS(CCM_BASE_ADDR) + 0x64) -+ -+#define MXC_CCM_MPCTL_BRMO (1 << 31) -+#define MXC_CCM_MPCTL_PD_OFFSET 26 -+#define MXC_CCM_MPCTL_PD_MASK (0xf << 26) -+#define MXC_CCM_MPCTL_MFD_OFFSET 16 -+#define MXC_CCM_MPCTL_MFD_MASK (0x3ff << 16) -+#define MXC_CCM_MPCTL_MFI_OFFSET 10 -+#define MXC_CCM_MPCTL_MFI_MASK (0xf << 10) -+#define MXC_CCM_MPCTL_MFN_OFFSET 0 -+#define MXC_CCM_MPCTL_MFN_MASK 0x3ff -+#define MXC_CCM_MPCTL_LF (1 << 15) -+ -+#define MXC_CCM_UPCTL_BRMO (1 << 31) -+#define MXC_CCM_UPCTL_PD_OFFSET 26 -+#define MXC_CCM_UPCTL_PD_MASK (0xf << 26) -+#define MXC_CCM_UPCTL_MFD_OFFSET 16 -+#define MXC_CCM_UPCTL_MFD_MASK (0x3ff << 16) -+#define MXC_CCM_UPCTL_MFI_OFFSET 10 -+#define MXC_CCM_UPCTL_MFI_MASK (0xf << 10) -+#define MXC_CCM_UPCTL_MFN_OFFSET 0 -+#define MXC_CCM_UPCTL_MFN_MASK 0x3ff -+#define MXC_CCM_UPCTL_LF (1 << 15) -+ -+#define MXC_CCM_CCTL_ARM_OFFSET 30 -+#define MXC_CCM_CCTL_ARM_MASK (0x3 << 30) -+#define MXC_CCM_CCTL_AHB_OFFSET 28 -+#define MXC_CCM_CCTL_AHB_MASK (0x3 << 28) -+#define MXC_CCM_CCTL_MPLL_RST (1 << 27) -+#define MXC_CCM_CCTL_UPLL_RST (1 << 26) -+#define MXC_CCM_CCTL_LP_CTL_OFFSET 24 -+#define MXC_CCM_CCTL_LP_CTL_MASK (0x3 << 24) -+#define MXC_CCM_CCTL_LP_MODE_RUN (0x0 << 24) -+#define MXC_CCM_CCTL_LP_MODE_WAIT (0x1 << 24) -+#define MXC_CCM_CCTL_LP_MODE_DOZE (0x2 << 24) -+#define MXC_CCM_CCTL_LP_MODE_STOP (0x3 << 24) -+#define MXC_CCM_CCTL_UPLL_DISABLE (1 << 23) -+#define MXC_CCM_CCTL_MPLL_BYPASS (1 << 22) -+#define MXC_CCM_CCTL_USB_DIV_OFFSET 16 -+#define MXC_CCM_CCTL_USB_DIV_MASK (0x3 << 16) -+#define MXC_CCM_CCTL_CG_CTRL (1 << 15) -+#define MXC_CCM_CCTL_ARM_SRC (1 << 14) -+ -+#define MXC_CCM_CGCR0_HCLK_ATA_OFFSET 16 -+#define MXC_CCM_CGCR0_HCLK_BROM_OFFSET 17 -+#define MXC_CCM_CGCR0_HCLK_CSI_OFFSET 18 -+#define MXC_CCM_CGCR0_HCLK_EMI_OFFSET 19 -+#define MXC_CCM_CGCR0_HCLK_ESAI_OFFSET 20 -+#define MXC_CCM_CGCR0_HCLK_ESDHC1_OFFSET 21 -+#define MXC_CCM_CGCR0_HCLK_ESDHC2_OFFSET 22 -+#define MXC_CCM_CGCR0_HCLK_FEC_OFFSET 23 -+#define MXC_CCM_CGCR0_HCLK_LCDC_OFFSET 24 -+#define MXC_CCM_CGCR0_HCLK_RTIC_OFFSET 25 -+#define MXC_CCM_CGCR0_HCLK_SDMA_OFFSET 26 -+#define MXC_CCM_CGCR0_HCLK_SLCDC_OFFSET 27 -+#define MXC_CCM_CGCR0_HCLK_USBOTG_OFFSET 28 -+ -+#define MXC_CCM_CGCR0_PER_CSI_OFFSET 0 -+#define MXC_CCM_CGCR0_PER_EPIT_OFFSET 1 -+#define MXC_CCM_CGCR0_PER_ESAI_OFFSET 2 -+#define MXC_CCM_CGCR0_PER_ESDHC1_OFFSET 3 -+#define MXC_CCM_CGCR0_PER_ESDHC2_OFFSET 4 -+#define MXC_CCM_CGCR0_PER_GPT_OFFSET 5 -+#define MXC_CCM_CGCR0_PER_I2C_OFFSET 6 -+#define MXC_CCM_CGCR0_PER_LCDC_OFFSET 7 -+#define MXC_CCM_CGCR0_PER_NFC_OFFSET 8 -+#define MXC_CCM_CGCR0_PER_OWIRE_OFFSET 9 -+#define MXC_CCM_CGCR0_PER_PWM_OFFSET 10 -+#define MXC_CCM_CGCR0_PER_SIM1_OFFSET 11 -+#define MXC_CCM_CGCR0_PER_SIM2_OFFSET 12 -+#define MXC_CCM_CGCR0_PER_SSI1_OFFSET 13 -+#define MXC_CCM_CGCR0_PER_SSI2_OFFSET 14 -+#define MXC_CCM_CGCR0_PER_UART_OFFSET 15 -+ -+#define MXC_CCM_CGCR1_AUDMUX_OFFSET 0 -+#define MXC_CCM_CGCR1_ATA_OFFSET 1 -+#define MXC_CCM_CGCR1_CAN1_OFFSET 2 -+#define MXC_CCM_CGCR1_CAN2_OFFSET 3 -+#define MXC_CCM_CGCR1_CSI_OFFSET 4 -+#define MXC_CCM_CGCR1_CSPI1_OFFSET 5 -+#define MXC_CCM_CGCR1_CSPI2_OFFSET 6 -+#define MXC_CCM_CGCR1_CSPI3_OFFSET 7 -+#define MXC_CCM_CGCR1_DRYICE_OFFSET 8 -+#define MXC_CCM_CGCR1_ECT_OFFSET 9 -+#define MXC_CCM_CGCR1_EPIT1_OFFSET 10 -+#define MXC_CCM_CGCR1_EPIT2_OFFSET 11 -+#define MXC_CCM_CGCR1_ESAI_OFFSET 12 -+#define MXC_CCM_CGCR1_ESDHC1_OFFSET 13 -+#define MXC_CCM_CGCR1_ESDHC2_OFFSET 14 -+#define MXC_CCM_CGCR1_FEC_OFFSET 15 -+#define MXC_CCM_CGCR1_GPIO1_OFFSET 16 -+#define MXC_CCM_CGCR1_GPIO2_OFFSET 17 -+#define MXC_CCM_CGCR1_GPIO3_OFFSET 18 -+#define MXC_CCM_CGCR1_GPT1_OFFSET 19 -+#define MXC_CCM_CGCR1_GPT2_OFFSET 20 -+#define MXC_CCM_CGCR1_GPT3_OFFSET 21 -+#define MXC_CCM_CGCR1_GPT4_OFFSET 22 -+#define MXC_CCM_CGCR1_I2C1_OFFSET 23 -+#define MXC_CCM_CGCR1_I2C2_OFFSET 24 -+#define MXC_CCM_CGCR1_I2C3_OFFSET 25 -+#define MXC_CCM_CGCR1_IIM_OFFSET 26 -+#define MXC_CCM_CGCR1_IOMUXC_OFFSET 27 -+#define MXC_CCM_CGCR1_KPP_OFFSET 28 -+#define MXC_CCM_CGCR1_LCDC_OFFSET 29 -+#define MXC_CCM_CGCR1_OWIRE_OFFSET 30 -+#define MXC_CCM_CGCR1_PWM1_OFFSET 31 -+ -+#define MXC_CCM_CGCR2_PWM2_OFFSET (32-32) -+#define MXC_CCM_CGCR2_PWM3_OFFSET (33-32) -+#define MXC_CCM_CGCR2_PWM4_OFFSET (34-32) -+#define MXC_CCM_CGCR2_RNGB_OFFSET (35-32) -+#define MXC_CCM_CGCR2_RTIC_OFFSET (36-32) -+#define MXC_CCM_CGCR2_SCC_OFFSET (37-32) -+#define MXC_CCM_CGCR2_SDMA_OFFSET (38-32) -+#define MXC_CCM_CGCR2_SIM1_OFFSET (39-32) -+#define MXC_CCM_CGCR2_SIM2_OFFSET (40-32) -+#define MXC_CCM_CGCR2_SLCDC_OFFSET (41-32) -+#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_UART1_OFFSET (46-32) -+#define MXC_CCM_CGCR2_UART2_OFFSET (47-32) -+#define MXC_CCM_CGCR2_UART3_OFFSET (48-32) -+#define MXC_CCM_CGCR2_UART4_OFFSET (49-32) -+#define MXC_CCM_CGCR2_UART5_OFFSET (50-32) -+#define MXC_CCM_CGCR2_WDOG_OFFSET (51-32) -+ -+#define MXC_CCM_PCDR1_PERDIV1_MASK 0x3f -+ -+#define MXC_CCM_RCSR_NF16B (1 << 14) -+ -+#define MXC_CCM_MCR_USB_XTAL_MUX_OFFSET 31 -+#define MXC_CCM_MCR_CLKO_EN_OFFSET 30 -+#define MXC_CCM_MCR_CLKO_DIV_OFFSET 24 -+#define MXC_CCM_MCR_CLKO_DIV_MASK (0x3F << 24) -+#define MXC_CCM_MCR_CLKO_SEL_OFFSET 20 -+#define MXC_CCM_MCR_CLKO_SEL_MASK (0xF << 20) -+#define MXC_CCM_MCR_ESAI_CLK_MUX_OFFSET 19 -+#define MXC_CCM_MCR_SSI2_CLK_MUX_OFFSET 18 -+#define MXC_CCM_MCR_SSI1_CLK_MUX_OFFSET 17 -+#define MXC_CCM_MCR_USB_CLK_MUX_OFFSET 16 -+ -+#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:59:16.000000000 +0200 -@@ -20,3 +20,9 @@ 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; -+#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:59:17.000000000 +0200 -@@ -0,0 +1,402 @@ -+/* -+ * Copyright 2008 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 -+ */ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#include -+#include -+ -+#include "sdma_script_code.h" -+ -+#include "karo.h" -+ -+void mx25_sdma_get_script_info(sdma_script_start_addrs * sdma_script_addr) -+{ -+ sdma_script_addr->mxc_sdma_ap_2_ap_addr = ap_2_ap_ADDR; -+ sdma_script_addr->mxc_sdma_ap_2_bp_addr = -1; -+ sdma_script_addr->mxc_sdma_bp_2_ap_addr = -1; -+ sdma_script_addr->mxc_sdma_loopback_on_dsp_side_addr = -1; -+ sdma_script_addr->mxc_sdma_mcu_interrupt_only_addr = -1; -+ -+ sdma_script_addr->mxc_sdma_firi_2_per_addr = -1; -+ sdma_script_addr->mxc_sdma_firi_2_mcu_addr = -1; -+ sdma_script_addr->mxc_sdma_per_2_firi_addr = -1; -+ sdma_script_addr->mxc_sdma_mcu_2_firi_addr = -1; -+ -+ sdma_script_addr->mxc_sdma_uart_2_per_addr = uart_2_per_ADDR; -+ sdma_script_addr->mxc_sdma_uart_2_mcu_addr = uart_2_mcu_ADDR; -+ sdma_script_addr->mxc_sdma_per_2_app_addr = per_2_app_ADDR; -+ sdma_script_addr->mxc_sdma_mcu_2_app_addr = mcu_2_app_ADDR; -+ -+ sdma_script_addr->mxc_sdma_per_2_per_addr = -1; -+ -+ sdma_script_addr->mxc_sdma_uartsh_2_per_addr = uartsh_2_per_ADDR; -+ sdma_script_addr->mxc_sdma_uartsh_2_mcu_addr = uartsh_2_mcu_ADDR; -+ sdma_script_addr->mxc_sdma_per_2_shp_addr = per_2_shp_ADDR; -+ sdma_script_addr->mxc_sdma_mcu_2_shp_addr = mcu_2_shp_ADDR; -+ -+ sdma_script_addr->mxc_sdma_ata_2_mcu_addr = ata_2_mcu_ADDR; -+ sdma_script_addr->mxc_sdma_mcu_2_ata_addr = mcu_2_ata_ADDR; -+ -+ sdma_script_addr->mxc_sdma_app_2_per_addr = app_2_per_ADDR; -+ sdma_script_addr->mxc_sdma_app_2_mcu_addr = app_2_mcu_ADDR; -+ sdma_script_addr->mxc_sdma_shp_2_per_addr = shp_2_per_ADDR; -+ sdma_script_addr->mxc_sdma_shp_2_mcu_addr = shp_2_mcu_ADDR; -+ -+ sdma_script_addr->mxc_sdma_mshc_2_mcu_addr = -1; -+ sdma_script_addr->mxc_sdma_mcu_2_mshc_addr = -1; -+ -+ sdma_script_addr->mxc_sdma_spdif_2_mcu_addr = -1; -+ sdma_script_addr->mxc_sdma_mcu_2_spdif_addr = -1; -+ -+ sdma_script_addr->mxc_sdma_asrc_2_mcu_addr = -1; -+ -+ sdma_script_addr->mxc_sdma_dptc_dvfs_addr = -1; -+ sdma_script_addr->mxc_sdma_ext_mem_2_ipu_addr = ext_mem__ipu_ram_ADDR; -+ sdma_script_addr->mxc_sdma_descrambler_addr = -1; -+ -+ sdma_script_addr->mxc_sdma_start_addr = (unsigned short *)sdma_code; -+ sdma_script_addr->mxc_sdma_ram_code_size = RAM_CODE_SIZE; -+ sdma_script_addr->mxc_sdma_ram_code_start_addr = RAM_CODE_START_ADDR; -+} -+ -+#if defined(CONFIG_MXC_WATCHDOG) || defined(CONFIG_MXC_WATCHDOG_MODULE) -+static struct resource wdt_resources[] = { -+ { -+ .start = WDOG_BASE_ADDR, -+ .end = WDOG_BASE_ADDR + 0x2f, -+ .flags = IORESOURCE_MEM, -+ }, -+}; -+ -+static struct platform_device mx25_wdt_device = { -+ .name = "mxc_wdt", -+ .id = 0, -+ .num_resources = ARRAY_SIZE(wdt_resources), -+ .resource = wdt_resources, -+}; -+ -+static void mx25_init_wdt(void) -+{ -+ (void)platform_device_register(&mx25_wdt_device); -+} -+#else -+static inline void mx25_init_wdt(void) -+{ -+} -+#endif -+ -+/* -+ * lcdc: -+ * - i.MX1: the basic controller -+ * - i.MX21: to be checked -+ * - i.MX27: like i.MX1, with slightly variations -+ */ -+static struct resource mxc_fb[] = { -+ { -+ .start = LCDC_BASE_ADDR, -+ .end = LCDC_BASE_ADDR + 0xFFF, -+ .flags = IORESOURCE_MEM, -+ }, -+ { -+ .start = MXC_INT_LCDC, -+ .end = MXC_INT_LCDC, -+ .flags = IORESOURCE_IRQ, -+ } -+}; -+ -+/* mxc lcd driver */ -+struct platform_device mxc_fb_device = { -+ .name = "imx-fb", -+ .id = 0, -+ .num_resources = ARRAY_SIZE(mxc_fb), -+ .resource = mxc_fb, -+ .dev = { -+ .coherent_dma_mask = 0xFFFFFFFF, -+ }, -+}; -+ -+/* SPI controller and device data */ -+#if defined(CONFIG_SPI_MXC) || defined(CONFIG_SPI_MXC_MODULE) -+ -+#ifdef CONFIG_SPI_MXC_SELECT1 -+/*! -+ * 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, -+ }, -+}; -+ -+/*! Platform Data for MXC CSPI1 */ -+static struct mxc_spi_master mx25_spi1_data = { -+ .maxchipselect = 4, -+ .spi_version = 7, -+}; -+ -+/*! Device Definition for MXC CSPI1 */ -+static struct platform_device mx25_spi1_device = { -+ .name = "mxc_spi", -+ .id = 0, -+ .dev = { -+ .platform_data = &mx25_spi1_data, -+ }, -+ .num_resources = ARRAY_SIZE(mx25_spi1_resources), -+ .resource = mx25_spi1_resources, -+}; -+ -+#endif /* CONFIG_SPI_MXC_SELECT1 */ -+ -+#ifdef CONFIG_SPI_MXC_SELECT2 -+/*! -+ * 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, -+ }, -+}; -+ -+/*! Platform Data for MXC CSPI2 */ -+static struct mxc_spi_master mx25_spi2_data = { -+ .maxchipselect = 4, -+ .spi_version = 7, -+}; -+ -+/*! Device Definition for MXC CSPI2 */ -+static struct platform_device mx25_spi2_device = { -+ .name = "mxc_spi", -+ .id = 1, -+ .dev = { -+ .platform_data = &mx25_spi2_data, -+ }, -+ .num_resources = ARRAY_SIZE(mx25_spi2_resources), -+ .resource = mx25_spi2_resources, -+}; -+#endif /* CONFIG_SPI_MXC_SELECT2 */ -+ -+#ifdef CONFIG_SPI_MXC_SELECT3 -+/*! -+ * 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, -+ }, -+}; -+ -+/*! Platform Data for MXC CSPI3 */ -+static struct mxc_spi_master mx25_spi3_data = { -+ .maxchipselect = 4, -+ .spi_version = 7, -+}; -+ -+/*! Device Definition for MXC CSPI3 */ -+static struct platform_device mx25_spi3_device = { -+ .name = "mxc_spi", -+ .id = 2, -+ .dev = { -+ .platform_data = &mx25_spi3_data, -+ }, -+ .num_resources = ARRAY_SIZE(mx25_spi3_resources), -+ .resource = mx25_spi3_resources, -+}; -+#endif /* CONFIG_SPI_MXC_SELECT3 */ -+ -+static inline void mx25_init_spi(void) -+{ -+ spba_take_ownership(SPBA_CSPI2, SPBA_MASTER_A); -+ spba_take_ownership(SPBA_CSPI3, SPBA_MASTER_A); -+ -+#ifdef CONFIG_SPI_MXC_SELECT1 -+ if (platform_device_register(&mx25_spi1_device) < 0) -+ printk(KERN_ERR "Error: Registering the SPI Controller_1\n"); -+#endif /* CONFIG_SPI_MXC_SELECT1 */ -+#ifdef CONFIG_SPI_MXC_SELECT2 -+ if (platform_device_register(&mx25_spi2_device) < 0) -+ printk(KERN_ERR "Error: Registering the SPI Controller_2\n"); -+#endif /* CONFIG_SPI_MXC_SELECT2 */ -+#ifdef CONFIG_SPI_MXC_SELECT3 -+ if (platform_device_register(&mx25_spi3_device) < 0) -+ printk(KERN_ERR "Error: Registering the SPI Controller_3\n"); -+#endif /* CONFIG_SPI_MXC_SELECT3 */ -+} -+#else -+static inline void mx25_init_spi(void) -+{ -+} -+#endif -+ -+/* I2C controller and device data */ -+#if defined(CONFIG_I2C_IMX) || defined(CONFIG_I2C_IMX_MODULE) -+ -+/*! -+ * 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, -+ }, -+}; -+ -+/*! -+ * 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, -+ }, -+}; -+ -+/*! -+ * 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, -+ }, -+}; -+ -+/*! Device Definition for MXC I2C1 */ -+struct platform_device mx25_i2c_device0 = { -+ .name = "imx-i2c", -+ .id = 0, -+ .num_resources = ARRAY_SIZE(mx25_i2c1_resources), -+ .resource = mx25_i2c1_resources, -+}; -+ -+struct platform_device mx25_i2c_device1 = { -+ .name = "imx-i2c", -+ .id = 1, -+ .num_resources = ARRAY_SIZE(mx25_i2c2_resources), -+ .resource = mx25_i2c2_resources, -+}; -+ -+struct platform_device mx25_i2c_device2 = { -+ .name = "imx-i2c", -+ .id = 2, -+ .num_resources = ARRAY_SIZE(mx25_i2c3_resources), -+ .resource = mx25_i2c3_resources, -+}; -+#endif -+ -+static struct mxc_gpio_port mx25_gpio_ports[] = { -+ { -+ .chip.label = "gpio-1", -+ .base = IO_ADDRESS(GPIO1_BASE_ADDR), -+ .irq = MXC_INT_GPIO1, -+ .virtual_irq_start = MXC_GPIO_IRQ_START, -+ }, -+ { -+ .chip.label = "gpio-2", -+ .base = IO_ADDRESS(GPIO2_BASE_ADDR), -+ .irq = MXC_INT_GPIO2, -+ .virtual_irq_start = MXC_GPIO_IRQ_START + 1 * 32, -+ }, -+ { -+ .chip.label = "gpio-3", -+ .base = IO_ADDRESS(GPIO3_BASE_ADDR), -+ .irq = MXC_INT_GPIO3, -+ .virtual_irq_start = MXC_GPIO_IRQ_START + 2 * 32, -+ }, -+ { -+ .chip.label = "gpio-4", -+ .base = IO_ADDRESS(GPIO4_BASE_ADDR), -+ .irq = MXC_INT_GPIO4, -+ .virtual_irq_start = MXC_GPIO_IRQ_START + 3 * 32, -+ }, -+}; -+ -+static inline void mx25_init_ssi(void) -+{ -+ /* SPBA configuration for SSI - SDMA and MCU are set */ -+ spba_take_ownership(SPBA_SSI1, SPBA_MASTER_A | SPBA_MASTER_C); -+ spba_take_ownership(SPBA_SSI2, SPBA_MASTER_A | SPBA_MASTER_C); -+} -+ -+static struct platform_device mx25_dma_device = { -+ .name = "mxc_dma", -+ .id = 0, -+}; -+ -+static inline void mx25_init_dma(void) -+{ -+ (void)platform_device_register(&mx25_dma_device); -+} -+ -+static int __init mx25_init_devices(void) -+{ -+ mx25_init_wdt(); -+ mx25_init_spi(); -+ mx25_init_dma(); -+ mx25_init_ssi(); -+ -+ return 0; -+} -+arch_initcall(mx25_init_devices); -+ -+int __init mxc_register_gpios(void) -+{ -+ 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:59:16.000000000 +0200 -@@ -26,6 +26,7 @@ - #include - - /* MX27 memory map definition */ -+#if defined(CONFIG_MACH_MX27) || defined(CONFIG_MACH_MX21) - static struct map_desc mxc_io_desc[] __initdata = { - /* - * this fixed mapping covers: -@@ -61,7 +62,7 @@ static struct map_desc mxc_io_desc[] __i - .pfn = __phys_to_pfn(X_MEMC_BASE_ADDR), - .length = X_MEMC_SIZE, - .type = MT_DEVICE -- } -+ }, - }; - - /* -@@ -82,4 +83,46 @@ void __init mx27_map_io(void) - - iotable_init(mxc_io_desc, ARRAY_SIZE(mxc_io_desc)); - } -+#endif -+ -+#ifdef CONFIG_MACH_MX25 -+static struct map_desc mx25_io_desc[] __initdata = { -+ { -+ .virtual = (unsigned long)X_MEMC_BASE_ADDR_VIRT, -+ .pfn = __phys_to_pfn(X_MEMC_BASE_ADDR), -+ .length = X_MEMC_SIZE, -+ .type = MT_DEVICE -+ }, -+ { -+ .virtual = (unsigned long)ASIC_BASE_ADDR_VIRT, -+ .pfn = __phys_to_pfn(ASIC_BASE_ADDR), -+ .length = ASIC_SIZE, -+ .type = MT_DEVICE_NONSHARED -+ }, -+ { -+ .virtual = (unsigned long)AIPS1_BASE_ADDR_VIRT, -+ .pfn = __phys_to_pfn(AIPS1_BASE_ADDR), -+ .length = AIPS1_SIZE, -+ .type = MT_DEVICE_NONSHARED -+ }, -+ { -+ .virtual = (unsigned long)AIPS2_BASE_ADDR_VIRT, -+ .pfn = __phys_to_pfn(AIPS2_BASE_ADDR), -+ .length = AIPS2_SIZE, -+ .type = MT_DEVICE_NONSHARED -+ }, -+ { -+ .virtual = (unsigned long)SPBA0_BASE_ADDR_VIRT, -+ .pfn = __phys_to_pfn(SPBA0_BASE_ADDR), -+ .length = SPBA0_SIZE, -+ .type = MT_DEVICE_NONSHARED -+ }, -+}; -+ -+void __init mx25_map_io(void) -+{ -+ mxc_set_cpu_type(MXC_CPU_MX25); - -+ 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-08 12:47:51.000000000 +0200 -@@ -0,0 +1,1122 @@ -+/* -+ * arch/arm/mach-mx2/karo-tx25.c -+ * -+ * Copyright (C) 2008 Lothar Wassmann -+ * -+ * based on: arch/arm/mach-mx27ads.c (C) 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 -+ * 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 -+ * -+ * This file adds support for the Ka-Ro electronics TX25 processor modules -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+//#include -+//#include -+#include -+#include -+#include -+#if defined(CONFIG_MTD) || defined(CONFIG_MTD_MODULE) -+#include -+#include -+#include -+#include -+#endif -+ -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+//#include -+//#include -+#include -+#include -+#include -+//#include -+//#include -+//#include -+ -+#include "crm_regs.h" -+#include "devices.h" -+#include "karo.h" -+ -+#ifdef DEBUG -+int tx25_debug = 1; -+module_param(tx25_debug, int, S_IRUGO | S_IWUSR); -+#else -+static int tx25_debug; -+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) -+{ -+ 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); -+ } -+ } -+ 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; -+} -+device_initcall(tx25_usbh2_register); -+#endif // CONFIG_USB_EHCI_MXC -+ -+//#define FEC_MII_IRQ IRQ_GPIOD(8) -+ -+#if defined(CONFIG_FEC) || defined(CONFIG_FEC_MODULE) -+static struct resource fec_resources[] = { -+ { -+ .start = FEC_BASE_ADDR, -+ .end = FEC_BASE_ADDR + 0x18f, -+ .flags = IORESOURCE_MEM, -+ }, { -+ .start = FEC_BASE_ADDR + 0x200, -+ .end = FEC_BASE_ADDR + 0x30b, -+ .flags = IORESOURCE_MEM, -+ }, { -+ .start = MXC_INT_FEC, -+ .end = MXC_INT_FEC, -+ .flags = IORESOURCE_IRQ, -+#ifdef FEC_MII_IRQ -+ }, { -+ .start = FEC_MII_IRQ, -+ .end = FEC_MII_IRQ, -+ .flags = IORESOURCE_IRQ | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, -+#endif -+ }, -+}; -+ -+/* -+ * Setup GPIO for FEC device to be active -+ * -+ */ -+static struct pad_desc karo_tx25_fec_gpios_off[] = { -+ MX25_PAD_FEC_MDC__GPIO_3_5, -+ MX25_PAD_FEC_MDIO__GPIO_3_6, -+ MX25_PAD_FEC_TDATA0__GPIO_3_7, -+ MX25_PAD_FEC_TDATA1__GPIO_3_8, -+ MX25_PAD_FEC_TX_EN__GPIO_3_9, -+ MX25_PAD_FEC_RDATA0__GPIO_3_10, -+ MX25_PAD_FEC_RDATA1__GPIO_3_11, -+ MX25_PAD_FEC_RX_DV__GPIO_3_12, -+ MX25_PAD_FEC_TX_CLK__GPIO_3_13, -+ MX25_PAD_D12__GPIO_4_8, -+ MX25_PAD_D10__GPIO_4_10, -+}; -+ -+static struct pad_desc karo_tx25_fec_pwr_gpios[] = { -+ MX25_PAD_D11__GPIO_4_9, /* FEC PHY power on pin */ -+ MX25_PAD_D13__GPIO_4_7, /* FEC reset */ -+}; -+ -+static struct pad_desc karo_tx25_fec_gpios_on[] = { -+ MX25_PAD_FEC_MDC__FEC_MDC, -+ MX25_PAD_FEC_MDIO__FEC_MDIO, -+ MX25_PAD_FEC_TDATA0__FEC_TDATA0, -+ MX25_PAD_FEC_TDATA1__FEC_TDATA1, -+ MX25_PAD_FEC_TX_EN__FEC_TX_EN, -+ MX25_PAD_FEC_RDATA0__FEC_RDATA0, -+ MX25_PAD_FEC_RDATA1__FEC_RDATA1, -+ MX25_PAD_FEC_RX_DV__FEC_RX_DV, -+ MX25_PAD_FEC_TX_CLK__FEC_TX_CLK, -+ MX25_PAD_D12__GPIO_4_8, -+ MX25_PAD_D10__GPIO_4_10, -+}; -+ -+static struct gpio_desc { -+ unsigned int gpio:7; -+ unsigned int dir:1; -+ unsigned int level:1; -+} karo_tx25_fec_strap_gpios[] = { -+ /* configure the PHY strap pins to the correct values */ -+ { GPIO_PORTC | 5, 1, 0, }, -+ { GPIO_PORTC | 6, 1, 0, }, -+ { GPIO_PORTC | 7, 1, 0, }, -+ { GPIO_PORTC | 8, 1, 0, }, -+ { GPIO_PORTC | 9, 1, 0, }, -+ { GPIO_PORTC | 10, 1, 1, }, -+ { GPIO_PORTC | 11, 1, 1, }, -+ { GPIO_PORTC | 12, 0, 1, }, -+ { GPIO_PORTC | 13, 1, 0, }, -+ -+ { GPIO_PORTD | 8, 0, 0, }, -+ { GPIO_PORTD | 10, 0, 0, }, -+ { GPIO_PORTD | 9, 1, 1, }, -+ { GPIO_PORTD | 7, 1, 0, }, -+}; -+ -+#define TX25_FEC_PWR_GPIO (GPIO_PORTD | 9) -+#define TX25_FEC_RST_GPIO (GPIO_PORTD | 7) -+ -+static int gpio_fec_active(void) -+{ -+ int ret; -+ int i; -+ -+#ifdef FEC_MII_IRQ -+ DBG(0, "%s: Using IRQ %d (GPIO %d) for MII\n", __FUNCTION__, -+ FEC_MII_IRQ, irq_to_gpio(FEC_MII_IRQ)); -+ -+ set_irq_type(FEC_MII_IRQ, IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING); -+#endif -+ ret = mxc_iomux_v3_setup_multiple_pads(karo_tx25_fec_pwr_gpios, -+ ARRAY_SIZE(karo_tx25_fec_pwr_gpios)); -+ if (ret) { -+ return ret; -+ } -+ /* -+ * If the PHY is already powered on, assume it has been -+ * correctly configured (by the boot loader) -+ */ -+ if (0 && gpio_get_value(TX25_FEC_PWR_GPIO) && -+ gpio_get_value(TX25_FEC_RST_GPIO)) { -+ ret = mxc_iomux_v3_setup_multiple_pads(karo_tx25_fec_gpios_on, -+ ARRAY_SIZE(karo_tx25_fec_gpios_on)); -+ if (ret) { -+ mxc_iomux_v3_release_multiple_pads(karo_tx25_fec_pwr_gpios, -+ ARRAY_SIZE(karo_tx25_fec_pwr_gpios)); -+ return ret; -+ } -+ } else { -+ /* switch PHY strap pins into required state */ -+ ret = mxc_iomux_v3_setup_multiple_pads(karo_tx25_fec_gpios_off, -+ ARRAY_SIZE(karo_tx25_fec_gpios_off)); -+ if (ret) { -+ mxc_iomux_v3_release_multiple_pads(karo_tx25_fec_pwr_gpios, -+ ARRAY_SIZE(karo_tx25_fec_pwr_gpios)); -+ 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]; -+ -+ ret = gpio_request(pd->gpio, "FEC"); -+ if (ret < 0) { -+ DBG(0, "%s: Failed to request GPIO%d_%d: %d\n", -+ __FUNCTION__, pd->gpio / 32 + 1, pd->gpio % 32, ret); -+ goto rel_mux; -+ } -+ if (pd->dir) { -+ gpio_direction_output(pd->gpio, -+ pd->level); -+ } else { -+ gpio_direction_input(pd->gpio); -+ } -+ } -+#ifdef DEBUG -+ for (i = 0; i < ARRAY_SIZE(karo_tx25_fec_strap_gpios); i++) { -+ struct gpio_desc *pd = &karo_tx25_fec_strap_gpios[i]; -+ int grp = pd->gpio / 32 + 1; -+ int ofs = pd->gpio % 32; -+ -+ if (pd->dir && pd->level != gpio_get_value(pd->gpio)) { -+ DBG(0, "%s: GPIO%d_%d is %d instead of %d\n", __FUNCTION__, -+ grp, ofs, gpio_get_value(pd->gpio), -+ pd->level); -+ } -+ } -+#endif -+ DBG(0, "%s: Delaying for 22ms\n", __FUNCTION__); -+ mdelay(22); -+ DBG(0, "%s: Deasserting FEC PHY reset\n", __FUNCTION__); -+ gpio_set_value(TX25_FEC_RST_GPIO, 1); -+#ifdef DEBUG -+ for (i = 0; i < ARRAY_SIZE(karo_tx25_fec_strap_gpios); i++) { -+ struct gpio_desc *pd = &karo_tx25_fec_strap_gpios[i]; -+ int grp = pd->gpio / 32 + 1; -+ int ofs = pd->gpio % 32; -+ -+ DBG(0, "%s: GPIO%d_%d is %d\n", __FUNCTION__, -+ grp, ofs, gpio_get_value(pd->gpio)); -+ } -+#endif -+ mxc_iomux_v3_release_multiple_pads(karo_tx25_fec_gpios_off, -+ ARRAY_SIZE(karo_tx25_fec_gpios_off)); -+ ret = mxc_iomux_v3_setup_multiple_pads(karo_tx25_fec_gpios_on, -+ ARRAY_SIZE(karo_tx25_fec_gpios_on)); -+ if (ret) { -+ goto rel_gpio; -+ } -+#ifdef DEBUG -+ for (i = 0; i < ARRAY_SIZE(karo_tx25_fec_strap_gpios); i++) { -+ struct gpio_desc *pd = &karo_tx25_fec_strap_gpios[i]; -+ int grp = pd->gpio / 32 + 1; -+ int ofs = pd->gpio % 32; -+ -+ DBG(0, "%s: GPIO%d_%d is %d\n", __FUNCTION__, -+ grp, ofs, gpio_get_value(pd->gpio)); -+ } -+#endif -+ } -+ return ret; -+ -+ rel_mux: -+ mxc_iomux_v3_release_multiple_pads(karo_tx25_fec_gpios_off, -+ ARRAY_SIZE(karo_tx25_fec_gpios_off)); -+ 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, -+ ARRAY_SIZE(karo_tx25_fec_pwr_gpios)); -+ return ret; -+} -+ -+/* -+ * Setup GPIO for FEC device to be inactive -+ * -+ */ -+static void gpio_fec_inactive(void) -+{ -+ int i; -+ -+ mxc_iomux_v3_release_multiple_pads(karo_tx25_fec_gpios_on, -+ ARRAY_SIZE(karo_tx25_fec_gpios_on)); -+ mxc_iomux_v3_setup_multiple_pads(karo_tx25_fec_gpios_off, -+ ARRAY_SIZE(karo_tx25_fec_gpios_off)); -+ DBG(0, "%s: Asserting FEC PHY reset\n", __FUNCTION__); -+ gpio_set_value(TX25_FEC_RST_GPIO, 0); -+ DBG(0, "%s: Switching FEC PHY power off\n", __FUNCTION__); -+ gpio_set_value(TX25_FEC_PWR_GPIO, 0); -+ -+ mxc_iomux_v3_release_multiple_pads(karo_tx25_fec_gpios_off, -+ ARRAY_SIZE(karo_tx25_fec_gpios_off)); -+ mxc_iomux_v3_release_multiple_pads(karo_tx25_fec_pwr_gpios, -+ 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); -+ } -+} -+ -+static struct clk *tx25_fec_clk; -+ -+static int tx25_fec_suspend(struct platform_device *pdev) -+{ -+ BUG_ON(tx25_fec_clk == NULL); -+ DBG(1, "%s: Switching FEC PHY off\n", __FUNCTION__); -+ gpio_fec_inactive(); -+ clk_disable(tx25_fec_clk); -+ return 0; -+} -+ -+static int tx25_fec_resume(struct platform_device *pdev) -+{ -+ BUG_ON(tx25_fec_clk == NULL); -+ DBG(1, "%s: Switching FEC PHY on\n", __FUNCTION__); -+ clk_enable(tx25_fec_clk); -+ gpio_fec_active(); -+ 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; -+ -+ DBG(0, "%s: Activating FEC GPIOs\n", __FUNCTION__); -+ dump_regs(); -+ -+ ret = gpio_fec_active(); -+ if (ret) { -+ printk(KERN_ERR "%s: could not enable FEC gpios: %d\n", __FUNCTION__, ret); -+ return ret; -+ } -+ -+ BUG_ON(tx25_fec_clk != NULL); -+ tx25_fec_clk = clk_get(&pdev->dev, NULL); -+ if (unlikely(IS_ERR(tx25_fec_clk))) { -+ printk(KERN_ERR "Failed to get fec_clk\n"); -+ return PTR_ERR(tx25_fec_clk); -+ } -+ DBG(0, "%s: Enabling FEC clock\n", __FUNCTION__); -+ clk_enable(tx25_fec_clk); -+ dump_regs(); -+ return 0; -+} -+ -+static void fec_arch_exit(struct platform_device *pdev) -+{ -+ BUG_ON(tx25_fec_clk == NULL); -+ if (unlikely(IS_ERR(tx25_fec_clk))) { -+ printk(KERN_ERR "Failed to get fec_clk\n"); -+ return; -+ } -+ DBG(0, "%s: Disabling FEC clock\n", __FUNCTION__); -+ clk_disable(tx25_fec_clk); -+ clk_put(tx25_fec_clk); -+ tx25_fec_clk = NULL; -+ DBG(0, "%s: Deactivating FEC GPIOs\n", __FUNCTION__); -+ gpio_fec_inactive(); -+} -+ -+static struct fec_enet_platform_data fec_data = { -+ .arch_init = fec_arch_init, -+ .arch_exit = fec_arch_exit, -+ .suspend = tx25_fec_suspend, -+ .resume = tx25_fec_resume, -+}; -+ -+static struct platform_device fec_device = { -+ .name = "fec", -+ .id = 0, -+ .num_resources = ARRAY_SIZE(fec_resources), -+ .resource = fec_resources, -+ .dev = { -+ .platform_data = &fec_data, -+ .coherent_dma_mask = 0xFFFFFFFF, -+ }, -+}; -+#endif -+ -+/* MTD NAND flash */ -+#if defined(CONFIG_MTD_NAND_MXC) || defined(CONFIG_MTD_NAND_MXC_MODULE) -+static struct pad_desc karo_tx25_nand_pads[] = { -+ MX25_PAD_NF_CE0__NF_CE0, -+ MX25_PAD_NFWE_B__NFWE_B, -+ MX25_PAD_NFRE_B__NFRE_B, -+ MX25_PAD_NFALE__NFALE, -+ MX25_PAD_NFCLE__NFCLE, -+ MX25_PAD_NFWP_B__NFWP_B, -+ MX25_PAD_NFRB__NFRB, -+ MX25_PAD_D7__D7, -+ MX25_PAD_D6__D6, -+ MX25_PAD_D5__D5, -+ MX25_PAD_D4__D4, -+ MX25_PAD_D3__D3, -+ MX25_PAD_D2__D2, -+ MX25_PAD_D1__D1, -+ MX25_PAD_D0__D0, -+}; -+ -+#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 int tx25_nand_init(void) -+{ -+ int ret; -+ -+ DBG(0, "%s: Configuring NAND pins\n", __FUNCTION__); -+ ret = mxc_iomux_v3_setup_multiple_pads(karo_tx25_nand_pads, -+ ARRAY_SIZE(karo_tx25_nand_pads)); -+ if (ret) { -+ return ret; -+ } -+ 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, -+}; -+ -+static int tx25_nand_init(void) -+{ -+ int ret; -+ -+ DBG(0, "%s: Configuring NAND pins\n", __FUNCTION__); -+ ret = mxc_iomux_v3_setup_multiple_pads(karo_tx25_nand_pads, -+ ARRAY_SIZE(karo_tx25_nand_pads)); -+ if (ret) { -+ return ret; -+ } -+ return 0; -+} -+arch_initcall(tx25_nand_init); -+#endif -+ -+static struct resource tx25_nand_resources[] = { -+ { -+ .start = NFC_BASE_ADDR + 0x1e00, -+ .end = NFC_BASE_ADDR + 0x1e2f, -+ .flags = IORESOURCE_MEM, -+ }, { -+ .start = NFC_BASE_ADDR, -+ .end = NFC_BASE_ADDR + 0x11ff, -+ .flags = IORESOURCE_MEM, -+ }, { -+ .start = MXC_INT_NANDFC, -+ .end = MXC_INT_NANDFC, -+ .flags = IORESOURCE_IRQ, -+ }, -+}; -+ -+static struct platform_device tx25_nand_mtd_device = { -+ .name = "mxc_nand", -+ .id = 0, -+ .num_resources = ARRAY_SIZE(tx25_nand_resources), -+ .resource = tx25_nand_resources, -+ .dev = { -+ .platform_data = &tx25_nand_data, -+ }, -+}; -+#endif -+ -+#if defined(CONFIG_VIDEO_MXC_EMMA_OUTPUT) || defined(CONFIG_VIDEO_MXC_EMMA_OUTPUT_MODULE) -+static u64 mxc_emma_dmamask = 0xffffffffUL; -+ -+static struct platform_device tx25_v4l2out_device = { -+ .name = "MXC Video Output", -+ .id = 0, -+ .dev = { -+ .dma_mask = &mxc_emma_dmamask, -+ .coherent_dma_mask = ~0UL, -+ }, -+}; -+#endif -+ -+#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, -+}; -+ -+static int karo_tx25_i2c_0_init(struct device *dev) -+{ -+ DBG(-1, "%s: \n", __FUNCTION__); -+ return mxc_iomux_v3_setup_multiple_pads(mxc_i2c0_pins, -+ ARRAY_SIZE(mxc_i2c0_pins)); -+} -+ -+static void karo_tx25_i2c_0_exit(struct device *dev) -+{ -+ DBG(-1, "%s: \n", __FUNCTION__); -+ mxc_iomux_v3_release_multiple_pads(mxc_i2c0_pins, -+ ARRAY_SIZE(mxc_i2c0_pins)); -+} -+ -+static struct imxi2c_platform_data karo_tx25_i2c_0_data = { -+ .bitrate = 100000, -+ .init = karo_tx25_i2c_0_init, -+ .exit = karo_tx25_i2c_0_exit, -+}; -+ -+static struct at24_platform_data karo_tx25_eeprom = { -+ .byte_len = 2048, -+ .page_size = 32, -+ .flags = AT24_FLAG_ADDR16 | AT24_FLAG_TAKE8ADDR, -+}; -+ -+static struct i2c_board_info karo_i2c_0_boardinfo[] __initdata = { -+ { -+ I2C_BOARD_INFO("24c16", 0x50), -+ .platform_data = &karo_tx25_eeprom, -+ .type = "24c16", -+ }, -+}; -+ -+int __init karo_i2c_init(void) -+{ -+ int ret; -+ -+ DBG(0, "%s: Registering I2C bus 0\n", __FUNCTION__); -+ ret = mxc_register_device(&mx25_i2c_device0, &karo_tx25_i2c_0_data); -+ if (ret != 0) { -+ printk(KERN_ERR "Failed to register I2C device: %d\n", ret); -+ return ret; -+ } -+ ret = i2c_register_board_info(0, karo_i2c_0_boardinfo, -+ ARRAY_SIZE(karo_i2c_0_boardinfo)); -+ if (ret != 0) { -+ printk(KERN_ERR "Failed to register I2C board info: %d\n", ret); -+ } -+ return ret; -+} -+device_initcall(karo_i2c_init); -+#endif -+#endif -+ -+struct platform_dev_list { -+ struct platform_device *pdev; -+ int flag; -+} tx25_devices[] __initdata = { -+#if defined(CONFIG_RTC_MXC) || defined(CONFIG_RTC_MXC_MODULE) -+ { .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, }, -+#endif -+#if defined(CONFIG_FEC) || defined(CONFIG_FEC_MODULE) -+ { .pdev = &fec_device, .flag = 1, }, -+#endif -+#if defined(CONFIG_SPI_MXC) || defined(CONFIG_SPI_MXC_MODULE) -+ { .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, }, -+#endif -+#if defined(CONFIG_MXC_VPU) || defined(CONFIG_MXC_VPU_MODULE) -+ { .pdev = &mxc_vpu_device, .flag = 1, }, -+#endif -+}; -+#define TX25_NUM_DEVICES ARRAY_SIZE(tx25_devices) -+ -+static __init void karo_tx25_board_init(void) -+{ -+ int i; -+ -+ DBG(0, "%s: \n", __FUNCTION__); -+ -+ dump_regs(); -+ -+ for (i = 0; i < TX25_NUM_DEVICES; i++) { -+ int ret; -+ -+ if (tx25_devices[i].pdev == NULL) continue; -+ if (!tx25_devices[i].flag) { -+ DBG(0, "%s: Skipping platform device[%d] @ %p dev %p: %s\n", -+ __FUNCTION__, i, tx25_devices[i].pdev, &tx25_devices[i].pdev->dev, -+ tx25_devices[i].pdev->name); -+ continue; -+ } -+ DBG(0, "%s: Registering platform device[%d] @ %p dev %p: %s\n", -+ __FUNCTION__, i, tx25_devices[i].pdev, &tx25_devices[i].pdev->dev, -+ tx25_devices[i].pdev->name); -+ ret = platform_device_register(tx25_devices[i].pdev); -+ if (ret) { -+ printk(KERN_WARNING "%s: Failed to register platform_device[%d]: %s: %d\n", -+ __FUNCTION__, i, tx25_devices[i].pdev->name, ret); -+ } -+ } -+ DBG(0, "%s: Done\n", __FUNCTION__); -+} -+ -+static struct pad_desc karo_tx25_gpios[] __initdata = { -+ MX25_PAD_GPIO_A__GPIO_A, -+ MX25_PAD_GPIO_B__GPIO_B, -+ MX25_PAD_GPIO_C__GPIO_C, -+ MX25_PAD_GPIO_D__GPIO_D, -+ MX25_PAD_GPIO_E__GPIO_E, -+ MX25_PAD_GPIO_F__GPIO_F, -+ MX25_PAD_CSI_D7__GPIO_1_6, -+ MX25_PAD_CSI_D8__GPIO_1_7, -+ MX25_PAD_CSI_MCLK__GPIO_1_8, -+ MX25_PAD_CSI_VSYNC__GPIO_1_9, -+ MX25_PAD_CSI_HSYNC__GPIO_1_10, -+ MX25_PAD_CSI_PIXCLK__GPIO_1_11, -+ MX25_PAD_I2C1_CLK__GPIO_1_12, -+ MX25_PAD_I2C1_DAT__GPIO_1_13, -+ MX25_PAD_CSPI1_MOSI__GPIO_1_14, -+ MX25_PAD_CSPI1_MISO__GPIO_1_15, -+ MX25_PAD_CSPI1_SS0__GPIO_1_16, -+ MX25_PAD_CSPI1_SS1__GPIO_1_17, -+ MX25_PAD_CSPI1_SCLK__GPIO_1_18, -+ MX25_PAD_LD5__GPIO_1_19, -+ MX25_PAD_LD6__GPIO_1_20, -+ MX25_PAD_LD7__GPIO_1_21, -+ MX25_PAD_HSYNC__GPIO_1_22, -+ MX25_PAD_VSYNC__GPIO_1_23, -+ MX25_PAD_LSCLK__GPIO_1_24, -+ MX25_PAD_OE_ACD__GPIO_1_25, -+ MX25_PAD_PWM__GPIO_1_26, -+ MX25_PAD_CSI_D2__GPIO_1_27, -+ MX25_PAD_CSI_D3__GPIO_1_28, -+ MX25_PAD_CSI_D4__GPIO_1_29, -+ MX25_PAD_CSI_D5__GPIO_1_30, -+ MX25_PAD_CSI_D6__GPIO_1_31, -+ -+ MX25_PAD_A14__GPIO_2_0, -+ MX25_PAD_A15__GPIO_2_1, -+ MX25_PAD_A16__GPIO_2_2, -+ MX25_PAD_A17__GPIO_2_3, -+ MX25_PAD_A18__GPIO_2_4, -+ MX25_PAD_A19__GPIO_2_5, -+ MX25_PAD_A20__GPIO_2_6, -+ MX25_PAD_A21__GPIO_2_7, -+ MX25_PAD_A22__GPIO_2_8, -+ MX25_PAD_A23__GPIO_2_9, -+ MX25_PAD_A24__GPIO_2_10, -+ MX25_PAD_A25__GPIO_2_11, -+ MX25_PAD_EB0__GPIO_2_12, -+ MX25_PAD_EB1__GPIO_2_13, -+ MX25_PAD_OE__GPIO_2_14, -+ MX25_PAD_LD0__GPIO_2_15, -+ MX25_PAD_LD1__GPIO_2_16, -+ MX25_PAD_LD2__GPIO_2_17, -+ MX25_PAD_LD3__GPIO_2_18, -+ MX25_PAD_LD4__GPIO_2_19, -+ MX25_PAD_DE_B__GPIO_2_20, -+ MX25_PAD_CLKO__GPIO_2_21, -+ MX25_PAD_CSPI1_RDY__GPIO_2_22, -+ MX25_PAD_SD1_CMD__GPIO_2_23, -+ MX25_PAD_SD1_CLK__GPIO_2_24, -+ MX25_PAD_SD1_DATA0__GPIO_2_25, -+ MX25_PAD_SD1_DATA1__GPIO_2_26, -+ MX25_PAD_SD1_DATA2__GPIO_2_27, -+ MX25_PAD_SD1_DATA3__GPIO_2_28, -+ MX25_PAD_KPP_ROW0__GPIO_2_29, -+ MX25_PAD_KPP_ROW1__GPIO_2_30, -+ MX25_PAD_KPP_ROW2__GPIO_2_31, -+ -+ MX25_PAD_KPP_ROW3__GPIO_3_0, -+ MX25_PAD_KPP_COL0__GPIO_3_1, -+ MX25_PAD_KPP_COL1__GPIO_3_2, -+ MX25_PAD_KPP_COL2__GPIO_3_3, -+ MX25_PAD_KPP_COL3__GPIO_3_4, -+ MX25_PAD_FEC_MDC__GPIO_3_5, -+ MX25_PAD_FEC_MDIO__GPIO_3_6, -+ MX25_PAD_FEC_TDATA0__GPIO_3_7, -+ MX25_PAD_FEC_TDATA1__GPIO_3_8, -+ MX25_PAD_FEC_TX_EN__GPIO_3_9, -+ MX25_PAD_FEC_RDATA0__GPIO_3_10, -+ MX25_PAD_FEC_RDATA1__GPIO_3_11, -+ MX25_PAD_FEC_RX_DV__GPIO_3_12, -+ MX25_PAD_FEC_TX_CLK__GPIO_3_13, -+ MX25_PAD_RTCK__GPIO_3_14, -+ MX25_PAD_EXT_ARMCLK__GPIO_3_15, -+ MX25_PAD_UPLL_BYPCLK__GPIO_3_16, -+ MX25_PAD_VSTBY_REQ__GPIO_3_17, -+ MX25_PAD_VSTBY_ACK__GPIO_3_18, -+ MX25_PAD_POWER_FAIL__GPIO_3_19, -+ MX25_PAD_CS4__GPIO_3_20, -+ MX25_PAD_CS5__GPIO_3_21, -+ MX25_PAD_NF_CE0__GPIO_3_22, -+ MX25_PAD_ECB__GPIO_3_23, -+ MX25_PAD_LBA__GPIO_3_24, -+ MX25_PAD_RW__GPIO_3_25, -+ MX25_PAD_NFWE_B__GPIO_3_26, -+ MX25_PAD_NFRE_B__GPIO_3_27, -+ MX25_PAD_NFALE__GPIO_3_28, -+ MX25_PAD_NFCLE__GPIO_3_29, -+ MX25_PAD_NFWP_B__GPIO_3_30, -+ MX25_PAD_NFRB__GPIO_3_31, -+ -+ MX25_PAD_A10__GPIO_4_0, -+ MX25_PAD_A13__GPIO_4_1, -+ MX25_PAD_CS0__GPIO_4_2, -+ MX25_PAD_CS1__GPIO_4_3, -+ MX25_PAD_BCLK__GPIO_4_4, -+ MX25_PAD_D15__GPIO_4_5, -+ MX25_PAD_D14__GPIO_4_6, -+ MX25_PAD_D13__GPIO_4_7, -+ MX25_PAD_D12__GPIO_4_8, -+ MX25_PAD_D11__GPIO_4_9, -+ MX25_PAD_D10__GPIO_4_10, -+ MX25_PAD_D9__GPIO_4_11, -+ MX25_PAD_D8__GPIO_4_12, -+ MX25_PAD_D7__GPIO_4_13, -+ MX25_PAD_D6__GPIO_4_14, -+ MX25_PAD_D5__GPIO_4_15, -+ MX25_PAD_D4__GPIO_4_16, -+ MX25_PAD_D3__GPIO_4_17, -+ MX25_PAD_D2__GPIO_4_18, -+ MX25_PAD_D1__GPIO_4_19, -+ MX25_PAD_D0__GPIO_4_20, -+ MX25_PAD_CSI_D9__GPIO_4_21, -+ MX25_PAD_UART1_RXD__GPIO_4_22, -+ MX25_PAD_UART1_TXD__GPIO_4_23, -+ MX25_PAD_UART1_RTS__GPIO_4_24, -+ MX25_PAD_UART1_CTS__GPIO_4_25, -+ MX25_PAD_UART2_RXD__GPIO_4_26, -+ MX25_PAD_UART2_TXD__GPIO_4_27, -+ MX25_PAD_UART2_RTS__GPIO_4_28, -+ MX25_PAD_UART2_CTS__GPIO_4_29, -+ MX25_PAD_BOOT_MODE0__GPIO_4_30, -+ MX25_PAD_BOOT_MODE1__GPIO_4_31, -+}; -+ -+static int __init karo_tx25_setup_gpios(void) -+{ -+ 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 -+ DBG(0, "%s: PAD[%d] %s set up as GPIO\n", __FUNCTION__, i, pd->name); -+#else -+ DBG(0, "%s: PAD[%d] set up as GPIO\n", __FUNCTION__, i); -+#endif -+ count++; -+ mxc_iomux_v3_release_pad(pd); -+ } else { -+#ifdef IOMUX_DEBUG -+ DBG(0, "%s: PAD[%d] %s skipped\n", __FUNCTION__, i, pd->name); -+#else -+ DBG(0, "%s: PAD[%d] skipped\n", __FUNCTION__, i); -+#endif -+ } -+ } -+ 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; -+} -+late_initcall(karo_tx25_setup_gpios); -+ -+static void __init karo_tx25_map_io(void) -+{ -+ mx25_map_io(); -+} -+ -+static void __init karo_tx25_fixup(struct machine_desc *desc, struct tag *tags, -+ char **cmdline, struct meminfo *mi) -+{ -+} -+ -+static void __init karo_tx25_timer_init(void) -+{ -+ DBG(0, "%s: \n", __FUNCTION__); -+ mx25_clocks_init(24000000); -+ DBG(0, "%s: Done\n", __FUNCTION__); -+} -+ -+struct sys_timer karo_tx25_timer = { -+ .init = karo_tx25_timer_init, -+}; -+ -+static int __init karo_mod_type_setup(char *line) -+{ -+ get_option(&line, &karo_mod_type); -+ DBG(0, "%s: Module type set to 0x%02x by kernel cmd line\n", __FUNCTION__, karo_mod_type); -+ -+ return 1; -+} -+__setup("module_type=", karo_mod_type_setup); -+ -+static int __init karo_board_type_setup(char *line) -+{ -+ get_option(&line, &karo_board_type); -+ DBG(0, "%s: Board type set to 0x%02x by kernel cmd line\n", __FUNCTION__, karo_board_type); -+ -+ return 1; -+} -+__setup("board_type=", karo_board_type_setup); -+ -+MACHINE_START(TX25, "Ka-Ro electronics TX25 module (Freescale i.MX25)") -+ /* Maintainer: */ -+ .phys_io = AIPS1_BASE_ADDR, -+ .io_pg_offst = ((unsigned long)AIPS1_BASE_ADDR_VIRT >> 18) & 0xfffc, -+ .fixup = karo_tx25_fixup, -+ .map_io = karo_tx25_map_io, -+ .init_irq = mxc_init_irq, -+ .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:59:18.000000000 +0200 -@@ -0,0 +1,99 @@ -+/* -+ * arch/arm/mach-mx2/karo.h -+ * -+ * Copyright (C) 2009 Lothar Wassmann -+ * -+ * 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 -+ * -+ * This file provides platform specific definitions for the -+ * Ka-Ro electronics TX25 processor modules -+ */ -+ -+#include -+#include "crm_regs_mx25.h" -+ -+enum { -+ BOARD_KARO_STK5, -+}; -+ -+extern int karo_board_type; -+extern int karo_mod_type; -+ -+#ifdef DEBUG -+extern int tx25_debug; -+#define dbg_lvl(n) ((n) < tx25_debug) -+#define DBG(lvl, fmt...) do { if (dbg_lvl(lvl)) printk(KERN_DEBUG fmt); } while (0) -+#else -+#define dbg_lvl(n) 0 -+#define DBG(lvl, fmt...) do { } while (0) -+#endif -+ -+static inline int karo_get_board_type(void) -+{ -+ return karo_board_type; -+} -+ -+static inline int karo_get_module_type(void) -+{ -+ return karo_mod_type; -+} -+ -+#define SHOW_REG(reg) DBG(0, "%s[%08lx]=%08x\n", #reg, MXC_PHYS_ADDRESS(reg), __raw_readl(reg)) -+ -+#define SHOW_GPIO_REG(port, reg) \ -+ DBG(0, "GPIO%d_%s[%08lx]=%08x\n", port, #reg, \ -+ GPIO_BASE_ADDR(port) + GPIO_##reg, \ -+ __raw_readl(IO_ADDRESS(GPIO_BASE_ADDR(port) + GPIO_##reg))) -+ -+static inline void dump_regs(void) -+{ -+ int i; -+ -+ SHOW_REG(MXC_CCM_MPCTL); -+ SHOW_REG(MXC_CCM_UPCTL); -+ SHOW_REG(MXC_CCM_CCTL); -+ SHOW_REG(MXC_CCM_RCSR); -+ SHOW_REG(MXC_CCM_CRDR); -+ SHOW_REG(MXC_CCM_PCDR0); -+ SHOW_REG(MXC_CCM_PCDR1); -+ SHOW_REG(MXC_CCM_PCDR2); -+ SHOW_REG(MXC_CCM_PCDR3); -+ SHOW_REG(MXC_CCM_CGCR0); -+ SHOW_REG(MXC_CCM_CGCR1); -+ SHOW_REG(MXC_CCM_CGCR2); -+ SHOW_REG(MXC_CCM_MCR); -+ SHOW_REG(MXC_CCM_PMCR0); -+ SHOW_REG(MXC_CCM_PMCR1); -+ SHOW_REG(MXC_CCM_PMCR2); -+ SHOW_REG(MXC_CCM_LTBR0); -+ SHOW_REG(MXC_CCM_LTBR1); -+ SHOW_REG(MXC_CCM_LTR0); -+ SHOW_REG(MXC_CCM_LTR1); -+ SHOW_REG(MXC_CCM_LTR2); -+ SHOW_REG(MXC_CCM_LTR3); -+ SHOW_REG(MXC_CCM_DCVR0); -+ SHOW_REG(MXC_CCM_DCVR1); -+ SHOW_REG(MXC_CCM_DCVR2); -+ SHOW_REG(MXC_CCM_DCVR3); -+ -+ for (i = 1; i <= 4; i++) { -+ SHOW_GPIO_REG(i, DR); -+ SHOW_GPIO_REG(i, GDIR); -+ SHOW_GPIO_REG(i, PSR); -+ SHOW_GPIO_REG(i, ICR1); -+ SHOW_GPIO_REG(i, ICR2); -+ SHOW_GPIO_REG(i, IMR); -+ 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:59:18.000000000 +0200 -@@ -0,0 +1,159 @@ -+ -+/* -+ * Copyright 2008 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 -+ */ -+ -+/*! -+ * @file sdma_script_code.h -+ * @brief This file contains functions of SDMA scripts code initialization -+ * -+ * The file was generated automatically. Based on sdma scripts library. -+ * -+ * @ingroup SDMA -+ */ -+/************************************************************************ -+ -+ SDMA RELEASE LABEL: "SS15_SENNA" -+ -+************************************************************************/ -+ -+#ifndef SDMA_SCRIPT_CODE_H -+#define SDMA_SCRIPT_CODE_H -+ -+/*! -+ * SDMA ROM scripts start addresses and sizes -+ */ -+#define start_ADDR 0 -+#define start_SIZE 22 -+ -+#define core_ADDR 80 -+#define core_SIZE 233 -+ -+#define common_ADDR 313 -+#define common_SIZE 416 -+ -+#define ap_2_ap_ADDR 729 -+#define ap_2_ap_SIZE 41 -+ -+#define app_2_mcu_ADDR 770 -+#define app_2_mcu_SIZE 64 -+ -+#define mcu_2_app_ADDR 834 -+#define mcu_2_app_SIZE 70 -+ -+#define uart_2_mcu_ADDR 904 -+#define uart_2_mcu_SIZE 75 -+ -+#define shp_2_mcu_ADDR 979 -+#define shp_2_mcu_SIZE 69 -+ -+#define mcu_2_shp_ADDR 1048 -+#define mcu_2_shp_SIZE 72 -+ -+#define uartsh_2_mcu_ADDR 1120 -+#define uartsh_2_mcu_SIZE 69 -+ -+#define app_2_per_ADDR 1189 -+#define app_2_per_SIZE 66 -+ -+#define per_2_app_ADDR 1255 -+#define per_2_app_SIZE 74 -+ -+#define per_2_shp_ADDR 1329 -+#define per_2_shp_SIZE 78 -+ -+#define shp_2_per_ADDR 1407 -+#define shp_2_per_SIZE 72 -+ -+#define mcu_2_ata_ADDR 1479 -+#define mcu_2_ata_SIZE 81 -+ -+#define ata_2_mcu_ADDR 1560 -+#define ata_2_mcu_SIZE 96 -+ -+#define loop_DMAs_routines_ADDR 1656 -+#define loop_DMAs_routines_SIZE 227 -+ -+#define test_ADDR 1883 -+#define test_SIZE 63 -+ -+#define signature_ADDR 1022 -+#define signature_SIZE 1 -+ -+/*! -+ * SDMA RAM scripts start addresses and sizes -+ */ -+#define ext_mem__ipu_ram_ADDR 6144 -+#define ext_mem__ipu_ram_SIZE 123 -+ -+#define uart_2_per_ADDR 6267 -+#define uart_2_per_SIZE 73 -+ -+#define uartsh_2_per_ADDR 6340 -+#define uartsh_2_per_SIZE 67 -+ -+/*! -+ * SDMA RAM image start address and size -+ */ -+#define RAM_CODE_START_ADDR 6144 -+#define RAM_CODE_SIZE 263 -+ -+/*! -+ * Buffer that holds the SDMA RAM image -+ */ -+__attribute__ ((__aligned__(4))) -+#ifndef CONFIG_XIP_KERNEL -+const -+#endif -+static const short sdma_code[] = { -+ 0x0e70, 0x0611, 0x5616, 0xc18a, 0x7d2a, 0x5ade, 0x008e, 0xc19c, -+ 0x7c26, 0x5be0, 0x5ef0, 0x5ce8, 0x0688, 0x08ff, 0x0011, 0x28ff, -+ 0x00bc, 0x53f6, 0x05df, 0x7d0b, 0x6dc5, 0x03df, 0x7d03, 0x6bd5, -+ 0xd84f, 0x982b, 0x6b05, 0xc6d8, 0x7e27, 0x7f29, 0x982b, 0x6d01, -+ 0x03df, 0x7d05, 0x6bd5, 0xc702, 0x7e18, 0x7f1a, 0x982b, 0x6b05, -+ 0xc678, 0x7e07, 0x7f06, 0x52de, 0x53e6, 0xc1a8, 0x7dd7, 0x0200, -+ 0x9803, 0x0007, 0x6004, 0x680c, 0x53f6, 0x028e, 0x00a3, 0xc2ad, -+ 0x048b, 0x0498, 0x0454, 0x068a, 0x982b, 0x0207, 0x680c, 0x6ddf, -+ 0x0107, 0x68ff, 0x60d0, 0x9834, 0x0207, 0x68ff, 0x6d28, 0x0107, -+ 0x6004, 0x680c, 0x9834, 0x0007, 0x68ff, 0x60d0, 0x9834, 0x0288, -+ 0x03a5, 0x3b03, 0x3d03, 0x4d00, 0x7d0a, 0x0804, 0x00a5, 0x00da, -+ 0x7d1a, 0x02a0, 0x7b01, 0x65d8, 0x7eee, 0x65ff, 0x7eec, 0x0804, -+ 0x02d0, 0x7d11, 0x4b00, 0x7c0f, 0x008a, 0x3003, 0x6dcf, 0x6bdf, -+ 0x0015, 0x0015, 0x7b02, 0x65d8, 0x0000, 0x7edd, 0x63ff, 0x7edb, -+ 0x3a03, 0x6dcd, 0x6bdd, 0x008a, 0x7b02, 0x65d8, 0x0000, 0x7ed3, -+ 0x65ff, 0x7ed1, 0x0006, 0xc23a, 0x57db, 0x52f3, 0x6ad5, 0x56fb, -+ 0x028e, 0x1a94, 0x6ac3, 0x62c8, 0x0269, 0x7d1e, 0x1e94, 0x6ee3, -+ 0x62d0, 0x5aeb, 0x62c8, 0x0248, 0x6ed3, 0x6ac8, 0x2694, 0x52eb, -+ 0x6ad5, 0x6ee3, 0x62c8, 0x026e, 0x7d27, 0x6ac8, 0x7f23, 0x2501, -+ 0x4d00, 0x7d26, 0x028e, 0x1a98, 0x6ac3, 0x62c8, 0x6ec3, 0x0260, -+ 0x7df1, 0x62d0, 0xc2d1, 0x98c0, 0x6ee3, 0x008f, 0x2001, 0x00d5, -+ 0x7d01, 0x008d, 0x05a0, 0x62c8, 0x026e, 0x7d0e, 0x6ac8, 0x7f0a, -+ 0x2001, 0x7cf9, 0x6add, 0x7f06, 0x0000, 0x4d00, 0x7d09, 0xc251, -+ 0x57db, 0x987f, 0x0007, 0x6aff, 0x62d0, 0xc2d1, 0x0458, 0x0454, -+ 0x6add, 0x7ff8, 0xc261, 0x987c, 0xc230, 0xc23a, 0x57db, 0x52f3, -+ 0x6ad5, 0x56fb, 0x028e, 0x1a94, 0x5202, 0x0269, 0x7d17, 0x1e94, -+ 0x5206, 0x0248, 0x5a06, 0x2694, 0x5206, 0x026e, 0x7d26, 0x6ac8, -+ 0x7f22, 0x2501, 0x4d00, 0x7d27, 0x028e, 0x1a98, 0x5202, 0x0260, -+ 0x7df3, 0x6add, 0x7f18, 0x62d0, 0xc2d1, 0x9903, 0x008f, 0x2001, -+ 0x00d5, 0x7d01, 0x008d, 0x05a0, 0x5206, 0x026e, 0x7d0e, 0x6ac8, -+ 0x7f0a, 0x2001, 0x7cf9, 0x6add, 0x7f06, 0x0000, 0x4d00, 0x7d0b, -+ 0xc251, 0x57db, 0x98c9, 0x0007, 0x6aff, 0x6add, 0x7ffc, 0x62d0, -+ 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:59:18.000000000 +0200 -@@ -0,0 +1,1003 @@ -+/* -+ * arch/arm/mach-mx2/stk5-baseboard.c -+ * -+ * Copyright (C) 2009 Lothar Wassmann -+ * -+ * -+ * 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 -+ * -+ * This file adds support for devices found on Ka-Ro electronics -+ * Starterkit-5 (STK5) baseboard -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+//#include -+ -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+//#include -+#include -+#include -+#include -+//#include -+//#include -+#include -+ -+#include "crm_regs.h" -+#include "devices.h" -+#include "karo.h" -+ -+#if defined(CONFIG_SERIAL_IMX) || defined(CONFIG_SERIAL_IMX_MODULE) -+static struct pad_desc stk5_uart_pads[][4] = { -+ { -+ MX25_PAD_UART1_TXD__UART1_TXD, -+ MX25_PAD_UART1_RXD__UART1_RXD, -+ MX25_PAD_UART1_CTS__UART1_CTS, -+ MX25_PAD_UART1_RTS__UART1_RTS, -+ }, { -+ MX25_PAD_UART2_TXD__UART2_TXD, -+ MX25_PAD_UART2_RXD__UART2_RXD, -+ MX25_PAD_UART2_CTS__UART2_CTS, -+ MX25_PAD_UART2_RTS__UART2_RTS, -+ }, { -+ MX25_PAD_ECB__UART5_TXD_MUX, -+ MX25_PAD_LBA__UART5_RXD_MUX, -+ MX25_PAD_CS4__UART5_CTS, -+ MX25_PAD_CS5__UART5_RTS, -+#if 0 -+ }, { -+ MX25_PAD_UART4_TXD__UART4_TXD, -+ MX25_PAD_UART4_RXD__UART4_RXD, -+ MX25_PAD_UART4_CTS__UART4_CTS, -+ MX25_PAD_UART4_RTS__UART4_RTS, -+ }, { -+ MX25_PAD_UART5_TXD__UART5_TXD, -+ MX25_PAD_UART5_RXD__UART5_RXD, -+ MX25_PAD_UART5_CTS__UART5_CTS, -+ MX25_PAD_UART5_RTS__UART5_RTS, -+#endif -+ }, -+}; -+ -+static int stk5_uart_init(struct platform_device *pdev) -+{ -+ DBG(0, "%s: \n", __FUNCTION__); -+ return mxc_iomux_v3_setup_multiple_pads(stk5_uart_pads[pdev->id], -+ ARRAY_SIZE(stk5_uart_pads[pdev->id])); -+} -+ -+static void stk5_uart_exit(struct platform_device *pdev) -+{ -+ DBG(0, "%s: \n", __FUNCTION__); -+ mxc_iomux_v3_release_multiple_pads(stk5_uart_pads[pdev->id], -+ ARRAY_SIZE(stk5_uart_pads[pdev->id])); -+} -+ -+static struct imxuart_platform_data stk5_uart_ports[] = { -+ { -+ .init = stk5_uart_init, -+ .exit = stk5_uart_exit, -+ .flags = IMXUART_HAVE_RTSCTS, -+ }, { -+ .init = stk5_uart_init, -+ .exit = stk5_uart_exit, -+ .flags = IMXUART_HAVE_RTSCTS, -+ }, { -+ .init = stk5_uart_init, -+ .exit = stk5_uart_exit, -+ .flags = IMXUART_HAVE_RTSCTS, -+ }, { -+ .init = stk5_uart_init, -+ .exit = stk5_uart_exit, -+ .flags = IMXUART_HAVE_RTSCTS, -+ }, { -+ .init = stk5_uart_init, -+ .exit = stk5_uart_exit, -+ .flags = IMXUART_HAVE_RTSCTS, -+ }, { -+ .init = stk5_uart_init, -+ .exit = stk5_uart_exit, -+ .flags = IMXUART_HAVE_RTSCTS, -+ }, -+}; -+ -+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 void __init karo_stk5_serial_init(void) -+{ -+} -+#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) -+{ -+ if ((unsigned long)view & 0x400) { -+ return "USBH2"; -+ } else { -+ return "USBOTG"; -+ } -+} -+ -+static int usb3317_init(void __iomem *view) -+{ -+ int vid, pid, ret; -+ -+ 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) { -+ 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; -+ } -+ return 0; -+} -+ -+static int usb3317_set_vbus_power(void __iomem *view, int on) -+{ -+ 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); -+ } -+ } -+ 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 stk5_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 stk5_usbh2_exit(struct platform_device *pdev) -+{ -+ gpio_usbh2_inactive(); -+ return 0; -+} -+ -+static struct mxc_usbh_platform_data stk5_usbh2_data = { -+ .init = stk5_usbh2_init, -+ .exit = stk5_usbh2_exit, -+}; -+ -+static int __init karo_stk5_usbh2_register(void) -+{ -+ int ret; -+ -+ ret = mxc_register_device(&mxc_ehci2, &stk5_usbh2_data); -+ return ret; -+} -+#else -+static inline int karo_stk5_usbh2_register(void) -+{ -+ return 0; -+} -+#endif // CONFIG_USB_EHCI_MXC -+ -+#if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE) -+static struct gpio_led stk5_leds[] = { -+ { -+ .name = "GPIO-LED", -+ .default_trigger = "heartbeat", -+ .gpio = GPIO_PORTB | 7, -+ }, -+}; -+ -+static struct gpio_led_platform_data stk5_led_data = { -+ .leds = stk5_leds, -+ .num_leds = ARRAY_SIZE(stk5_leds), -+}; -+ -+static struct platform_device stk5_led_device = { -+ .name = "leds-gpio", -+ .id = -1, -+ .dev = { -+ .platform_data = &stk5_led_data, -+ }, -+}; -+#endif -+ -+#if defined(CONFIG_KEYBOARD_MXC) || defined(CONFIG_KEYBOARD_MXC_MODULE) -+/*! -+ * This array is used for mapping mx25 ADS keypad scancodes to input keyboard -+ * keycodes. -+ */ -+static u16 stk5_kpd_keycodes[] = { -+ KEY_POWER, -+}; -+ -+static struct keypad_data stk5_keypad = { -+ .rowmax = 1, -+ .colmax = 1, -+ .irq = MXC_INT_KPP, -+ .learning = 0, -+ //.delay = 2, /* unused in the driver! */ -+ .matrix = stk5_kpd_keycodes, -+}; -+ -+static struct resource stk5_kpp_resources[] = { -+ { -+ .start = MXC_INT_KPP, -+ .end = MXC_INT_KPP, -+ .flags = IORESOURCE_IRQ, -+ }, -+}; -+ -+/* stk5 keypad driver */ -+static struct platform_device stk5_keypad_device = { -+ .name = "mxc_keypad", -+ .id = 0, -+ .num_resources = ARRAY_SIZE(stk5_kpp_resources), -+ .resource = stk5_kpp_resources, -+ .dev = { -+ .platform_data = &stk5_keypad, -+ }, -+}; -+#endif -+ -+#if defined(CONFIG_FB_IMX) || defined(CONFIG_FB_IMX_MODULE) -+/* -+ * Setup GPIO for LCDC device to be active -+ * -+ */ -+static struct pad_desc mx25_lcdc_gpios[] = { -+#if 0 -+ MXC_PIN(A, 30, GPIO, GPIO_OUT | GPIO_DFLT_LOW), /* PA30 */ -+ MXC_PIN(A, 25, GPIO, GPIO_OUT | GPIO_DFLT_LOW), /* PA25 */ -+ MXC_PIN(A, 26, GPIO, GPIO_OUT | GPIO_DFLT_LOW), /* PA26 */ -+ MXC_PIN(A, 24, GPIO, GPIO_OUT | GPIO_DFLT_LOW), /* PA24 */ -+ MXC_PIN(A, 27, GPIO, GPIO_OUT | GPIO_DFLT_LOW), /* PA27 */ -+#endif -+ MX25_PAD_LSCLK__LSCLK, -+ MX25_PAD_LD0__LD0, -+ MX25_PAD_LD1__LD1, -+ MX25_PAD_LD2__LD2, -+ MX25_PAD_LD3__LD3, -+ MX25_PAD_LD4__LD4, -+ MX25_PAD_LD5__LD5, -+ MX25_PAD_LD6__LD6, -+ MX25_PAD_LD7__LD7, -+ MX25_PAD_LD8__LD8, -+ MX25_PAD_LD9__LD9, -+ MX25_PAD_LD10__LD10, -+ MX25_PAD_LD11__LD11, -+ MX25_PAD_LD12__LD12, -+ MX25_PAD_LD13__LD13, -+ MX25_PAD_LD14__LD14, -+ MX25_PAD_LD15__LD15, -+ MX25_PAD_D15__LD16, -+ MX25_PAD_D14__LD17, -+ MX25_PAD_HSYNC__HSYNC, -+ MX25_PAD_VSYNC__VSYNC, -+ MX25_PAD_OE_ACD__OE_ACD, -+}; -+ -+static int stk5_gpio_lcdc_active(struct platform_device *dev) -+{ -+ int ret; -+ -+ DBG(0, "%s: Setting up GPIO pins for LCD\n", __FUNCTION__); -+ ret = mxc_iomux_v3_setup_multiple_pads(mx25_lcdc_gpios, -+ ARRAY_SIZE(mx25_lcdc_gpios)); -+ if (ret) { -+ DBG(0, "%s: Failed to setup GPIO pins for LCD: %d\n", -+ __FUNCTION__, ret); -+ return ret; -+ } -+ return 0; -+} -+ -+/* -+ * Setup GPIO for LCDC device to be inactive -+ * -+ */ -+static void stk5_gpio_lcdc_inactive(struct platform_device *dev) -+{ -+ mxc_iomux_v3_release_multiple_pads(mx25_lcdc_gpios, -+ ARRAY_SIZE(mx25_lcdc_gpios)); -+} -+ -+static struct imx_fb_platform_data stk5_fb_data[] __initdata = { -+ { -+ //.fb_mode = "Xenarc_700_Y-18", -+ .init = stk5_gpio_lcdc_active, -+ .exit = stk5_gpio_lcdc_inactive, -+ .lcd_power = NULL, -+ .backlight_power = NULL, -+ -+ .pixclock = 34576, -+ .xres = 640, -+ .yres = 480, -+ -+ .bpp = 32, -+ -+ .hsync_len = 64, -+ .right_margin = 60 + 1, -+ .left_margin = 80 + 3, -+ -+ .vsync_len = 2, -+ .upper_margin = 54, -+ .lower_margin = 54, -+#if 0 -+ /* currently not used by driver! */ -+ .sync = ((0*FB_SYNC_HOR_HIGH_ACT) | -+ (0*FB_SYNC_VERT_HIGH_ACT) | -+ (1*FB_SYNC_OE_ACT_HIGH)), -+#else -+ .pcr = PCR_TFT | PCR_COLOR | PCR_PBSIZ_8 | -+ PCR_BPIX_18 | PCR_END_SEL | PCR_FLMPOL | PCR_LPPOL | PCR_SCLK_SEL, -+ .dmacr = 0x800a0078, -+#endif -+ .cmap_greyscale = 0, -+ .cmap_inverse = 0, -+ .cmap_static = 0, -+ -+ .fixed_screen_cpu = NULL, -+ }, { -+ //.fb_mode = "Xenarc_700_Y-16", -+ .init = stk5_gpio_lcdc_active, -+ .exit = stk5_gpio_lcdc_inactive, -+ .lcd_power = NULL, -+ .backlight_power = NULL, -+ -+ .pixclock = 34576, -+ .xres = 640, -+ .yres = 480, -+ -+ .bpp = 16, -+ -+ .hsync_len = 64, -+ .right_margin = 138 + 1, -+ .left_margin = 118 + 3, -+ -+ .vsync_len = 7, -+ .upper_margin = 44, -+ .lower_margin = 44, -+#if 0 -+ /* currently not used by driver! */ -+ .sync = ((0*FB_SYNC_HOR_HIGH_ACT) | -+ (0*FB_SYNC_VERT_HIGH_ACT) | -+ (1*FB_SYNC_OE_ACT_HIGH)), -+#else -+ .pcr = PCR_TFT | PCR_COLOR | PCR_PBSIZ_8 | -+ PCR_BPIX_16 | PCR_FLMPOL | PCR_LPPOL | PCR_SCLK_SEL, -+ .dmacr = 0x80040060, -+#endif -+ .cmap_greyscale = 0, -+ .cmap_inverse = 0, -+ .cmap_static = 0, -+ -+ .fixed_screen_cpu = NULL, -+ }, { -+ //.fb_mode = "SHARP LQ10D42-16", -+ .init = stk5_gpio_lcdc_active, -+ .exit = stk5_gpio_lcdc_inactive, -+ .lcd_power = NULL, -+ .backlight_power = NULL, -+ -+ .pixclock = 34576, -+ .xres = 640, -+ .yres = 480, -+ -+#ifdef USE_18BPP -+ .bpp = 32, -+#else -+ .bpp = 16, -+#endif -+ .hsync_len = 64, -+ .right_margin = 138 + 1, -+ .left_margin = 118 + 3, -+ -+ .vsync_len = 7, -+ .upper_margin = 28, -+ .lower_margin = 60, -+#if 0 -+ /* currently not used by driver! */ -+ .sync = ((0*FB_SYNC_HOR_HIGH_ACT) | -+ (0*FB_SYNC_VERT_HIGH_ACT) | -+ (1*FB_SYNC_OE_ACT_HIGH)), -+#else -+ .pcr = PCR_TFT | PCR_COLOR | PCR_PBSIZ_8 | -+#ifdef USE_18BPP -+ PCR_BPIX_18 | PCR_END_SEL | PCR_FLMPOL | PCR_LPPOL | PCR_SCLK_SEL, -+#else -+ PCR_BPIX_16 | PCR_FLMPOL | PCR_LPPOL | PCR_SCLK_SEL, -+#endif -+ .dmacr = 0x80040060, -+#endif -+ .cmap_greyscale = 0, -+ .cmap_inverse = 0, -+ .cmap_static = 0, -+ -+ .fixed_screen_cpu = NULL, -+ }, { -+ //.fb_mode = "SHARP LQ104V1DG61-16", -+ .init = stk5_gpio_lcdc_active, -+ .exit = stk5_gpio_lcdc_inactive, -+ .lcd_power = NULL, -+ .backlight_power = NULL, -+ -+ .pixclock = 40000, -+ .xres = 640, -+ .yres = 480, -+ -+#ifdef USE_18BPP -+ .bpp = 32, -+#else -+ .bpp = 16, -+#endif -+ .hsync_len = 32, -+ .right_margin = 32 + 1, -+ .left_margin = 0 + 3, -+ -+ .vsync_len = 35, -+ .upper_margin = 0, -+ .lower_margin = 0, -+#if 0 -+ /* currently not used by driver! */ -+ .sync = ((0*FB_SYNC_HOR_HIGH_ACT) | -+ (0*FB_SYNC_VERT_HIGH_ACT) | -+ (1*FB_SYNC_OE_ACT_HIGH)), -+#else -+ .pcr = PCR_TFT | PCR_COLOR | PCR_PBSIZ_8 | -+#ifdef USE_18BPP -+ PCR_BPIX_18 | PCR_END_SEL | PCR_FLMPOL | PCR_LPPOL | PCR_SCLK_SEL, -+#else -+ PCR_BPIX_16 | PCR_FLMPOL | PCR_LPPOL | PCR_CLKPOL | PCR_SCLK_SEL, -+#endif -+ .dmacr = 0x80040060, -+#endif -+ .cmap_greyscale = 0, -+ .cmap_inverse = 0, -+ .cmap_static = 0, -+ -+ .fixed_screen_cpu = NULL, -+ }, -+}; -+ -+static int __init karo_stk5_fb_register(void) -+{ -+ int ret; -+ -+ ret = mxc_register_device(&mxc_fb_device, &stk5_fb_data[0]); -+ if (ret != 0) { -+ DBG(0, "%s: Failed to register FB device: %d\n", __FUNCTION__, ret); -+ } -+ return ret; -+} -+#else -+static inline int karo_stk5_fb_register(void) -+{ -+ return 0; -+} -+#endif -+ -+#if defined(CONFIG_MMC_MXC) || defined(CONFIG_MMC_MXC_MODULE) -+/*! -+ * Resource definition for the SDHC1 -+ */ -+static struct resource stk5_sdhc1_resources[] = { -+ { -+ .start = MMC_SDHC1_BASE_ADDR, -+ .end = MMC_SDHC1_BASE_ADDR + SZ_4K - 1, -+ .flags = IORESOURCE_MEM, -+ }, { -+ .start = MXC_INT_SDHC1, -+ .end = MXC_INT_SDHC1, -+ .flags = IORESOURCE_IRQ, -+ }, { -+ .start = gpio_to_irq(4 * 32 + 4), -+ .end = gpio_to_irq(4 * 32 + 4), -+ .flags = IORESOURCE_IRQ, -+#if 0 -+ }, { -+ .name = "sdhc1", -+ .start = DMA_REQ_SDHC1, -+ .end = DMA_REQ_SDHC1, -+ .flags = IORESOURCE_DMA -+#endif -+ }, -+}; -+ -+static inline int stk5_mmc_get_irq(int id) -+{ -+ int irq; -+ -+ switch (id) { -+ case 0: -+ irq = stk5_sdhc1_resources[2].start; -+ break; -+ default: -+ BUG(); -+ } -+ return irq; -+} -+ -+static const char *stk5_mmc_irqdesc[] = { -+ "MMC card 0 detect", -+}; -+ -+static struct pad_desc stk5_sdhc_pads[] = { -+}; -+ -+static int stk5_mmc_init(struct device *dev, irqreturn_t (*mmc_detect_irq)(int, void *), -+ void *data) -+{ -+ int err; -+ int id = to_platform_device(dev)->id; -+ struct mmc_host *host = data; -+ int irq = stk5_mmc_get_irq(id); -+ -+ err = mxc_iomux_v3_setup_multiple_pads(stk5_sdhc_pads, -+ ARRAY_SIZE(stk5_sdhc_pads)); -+ if (err) { -+ return err; -+ } -+ -+ host->caps |= MMC_CAP_4_BIT_DATA; -+ -+ err = request_irq(irq, mmc_detect_irq, -+ IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING, -+ stk5_mmc_irqdesc[id], data); -+ if (err) { -+ printk(KERN_ERR "%s: MMC/SD: can't request MMC card detect IRQ %d\n", -+ __FUNCTION__, irq); -+ return err; -+ } -+ device_set_wakeup_capable(dev, 1); -+ -+ return 0; -+} -+ -+static void stk5_mmc_exit(struct device *dev, void *data) -+{ -+ int id = to_platform_device(dev)->id; -+ int irq = stk5_mmc_get_irq(id); -+ -+ free_irq(irq, data); -+ mxc_iomux_v3_release_multiple_pads(stk5_sdhc_pads, -+ ARRAY_SIZE(stk5_sdhc_pads)); -+} -+ -+#if 0 -+static int stk5_mmc_suspend(struct device *dev, pm_message_t state) -+{ -+ int id = to_platform_device(dev)->id; -+ int irq = stk5_mmc_get_irq(id); -+ -+ if (device_may_wakeup(dev)) { -+ DBG(0, "%s: Enabling IRQ %d wakeup\n", __FUNCTION__, irq); -+ return enable_irq_wake(irq); -+ } -+ return 0; -+} -+ -+static int stk5_mmc_resume(struct device *dev) -+{ -+ int id = to_platform_device(dev)->id; -+ int irq = stk5_mmc_get_irq(id); -+ -+ if (device_may_wakeup(dev)) { -+ DBG(0, "%s: Disabling IRQ %d wakeup\n", __FUNCTION__, irq); -+ return disable_irq_wake(irq); -+ } -+ return 0; -+} -+#endif -+ -+static struct imxmmc_platform_data stk5_sdhc1_data = { -+ //.ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, -+ //.min_clk = 150000, -+ //.max_clk = 25000000, -+ //.detect_delay = 20, -+ .init = stk5_mmc_init, -+ .exit = stk5_mmc_exit, -+// .suspend = stk5_mmc_suspend, -+// .resume = stk5_mmc_resume, -+}; -+ -+static struct platform_device stk5_sdhc1_device = { -+ .name = "imx-mmc", -+ .id = 0, -+ .dev = { -+ .platform_data = &stk5_sdhc1_data, -+ }, -+ .num_resources = ARRAY_SIZE(stk5_sdhc1_resources), -+ .resource = stk5_sdhc1_resources, -+}; -+#endif -+ -+#if defined(CONFIG_SPI_MXC) || defined(CONFIG_SPI_MXC_MODULE) -+static struct resource mxcspi1_resources[] = { -+ { -+ .start = CSPI1_BASE_ADDR, -+ .end = CSPI1_BASE_ADDR + SZ_4K - 1, -+ .flags = IORESOURCE_MEM, -+ }, { -+ .start = MXC_INT_CSPI1, -+ .end = MXC_INT_CSPI1, -+ .flags = IORESOURCE_IRQ, -+ }, -+}; -+ -+static struct mxc_spi_master mxcspi1_data = { -+ .maxchipselect = 2, -+ .spi_version = 0, -+}; -+ -+static struct platform_device mxcspi1_device = { -+ .name = "mxc_spi", -+ .id = 0, -+ .dev = { -+ .platform_data = &mxcspi1_data, -+ }, -+ .num_resources = ARRAY_SIZE(mxcspi1_resources), -+ .resource = mxcspi1_resources, -+}; -+#endif // defined(CONFIG_SPI_MXC) || defined(CONFIG_SPI_MXC_MODULE) -+ -+#if defined(CONFIG_AC97_BUS) || defined(CONFIG_AC97_BUS_MODULE) -+static u64 stk5_dma_mask = ~0UL; -+ -+static struct pad_desc stk5_ac97_pads_on[] = { -+ MX25_PAD_VSTBY_ACK__GPIO_3_18, /* UCB1400 Reset */ -+ MX25_PAD_RW__AUD4_TXFS, -+ MX25_PAD_EB0__AUD4_TXD, -+ MX25_PAD_EB1__AUD4_RXD, -+ MX25_PAD_OE__AUD4_TXC, -+}; -+ -+static struct pad_desc stk5_ac97_pads_off[] = { -+ MX25_PAD_VSTBY_ACK__GPIO_3_18, /* UCB1400 Reset */ -+ MX25_PAD_RW__GPIO_3_25, -+ MX25_PAD_EB0__GPIO_2_12, -+ MX25_PAD_EB1__AUD4_RXD, -+ MX25_PAD_OE__AUD4_TXC, -+}; -+ -+static struct gpio_desc { -+ unsigned int gpio:7; -+ unsigned int dir:1; -+ unsigned int level:1; -+} stk5_ac97_gpios[] = { -+ /* configure the PHY strap pins to the correct values */ -+ { GPIO_PORTC | 18, 1, 0, }, -+ { GPIO_PORTC | 25, 1, 0, }, -+ { GPIO_PORTB | 12, 1, 0, }, -+}; -+ -+static int stk5_ac97_init(struct platform_device *dev) -+{ -+ int ret; -+ int i; -+ -+ DBG(0, "%s: \n", __FUNCTION__); -+ -+ ret = mxc_iomux_v3_setup_multiple_pads(stk5_ac97_pads_off, -+ ARRAY_SIZE(stk5_ac97_pads_off)); -+ if (ret == 0) { -+ for (i = 0; i < ARRAY_SIZE(stk5_ac97_gpios); i++) { -+ struct gpio_desc *pd = &stk5_ac97_gpios[i]; -+ -+ ret = gpio_request(pd->gpio, "AC97"); -+ if (ret < 0) { -+ DBG(0, "%s: Failed to request GPIO%d_%d: %d\n", -+ __FUNCTION__, pd->gpio / 32 + 1, pd->gpio % 32, ret); -+ goto rel_mux; -+ } -+ if (pd->dir) { -+ gpio_direction_output(pd->gpio, -+ pd->level); -+ } else { -+ gpio_direction_input(pd->gpio); -+ } -+ } -+ -+ ret = mxc_iomux_v3_setup_multiple_pads(stk5_ac97_pads_on, -+ ARRAY_SIZE(stk5_ac97_pads_on)); -+ if (ret != 0) { -+ goto rel_gpio; -+ } -+ udelay(1); -+ gpio_set_value(stk5_ac97_gpios[0].gpio, !stk5_ac97_gpios[0].level); -+ } -+ return ret; -+ -+ rel_mux: -+ mxc_iomux_v3_release_multiple_pads(stk5_ac97_gpios_off, -+ ARRAY_SIZE(stk5_ac97_gpios_off)); -+ rel_gpio: -+ while (--i >= 0) { -+ struct gpio_desc *pd = &stk5_ac97_gpios[i]; -+ int grp = pd->gpio / 32 + 1; -+ int ofs = pd->gpio % 32; -+ -+ DBG(0, "%s: Freeing GPIO%d_%d\n", __FUNCTION__, -+ grp, ofs); -+ gpio_free(pd->gpio); -+ } -+ return ret; -+} -+ -+static void stk5_ac97_exit(struct platform_device *dev) -+{ -+ int i; -+ -+ DBG(0, "%s: Releasing AC97 GPIO pins\n", __FUNCTION__); -+ -+ mxc_iomux_v3_release_multiple_pads(stk5_ac97_pads_on, -+ ARRAY_SIZE(stk5_ac97_pads_on)); -+ for (i = 0; i < ARRAY_SIZE(stk5_ac97_gpios); i++) { -+ struct gpio_desc *pd = &stk5_ac97_gpios[i]; -+ int grp = pd->gpio / 32 + 1; -+ int ofs = pd->gpio % 32; -+ -+ DBG(0, "%s: Freeing GPIO%d_%d\n", __FUNCTION__, -+ grp, ofs); -+ gpio_free(pd->gpio); -+ } -+} -+ -+static struct mxc_ac97_audio_ops stk5_ac97_ops = { -+ .init = stk5_ac97_init, -+ .exit = stk5_ac97_exit, -+ .startup = NULL, -+ .shutdown = NULL, -+ .suspend = NULL, -+ .resume = NULL, -+ .priv = NULL, -+}; -+ -+static struct platform_device ac97_device = { -+ .name = "mx25-ac97", -+ .id = -1, -+ .dev = { -+ .dma_mask = &stk5_dma_mask, -+ .coherent_dma_mask = ~0UL, -+ .platform_data = &stk5_ac97_ops, -+ }, -+}; -+#endif -+ -+static struct platform_dev_list { -+ struct platform_device *pdev; -+ int flag; -+} stk5_devices[] __initdata = { -+#if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE) -+ { .pdev = &stk5_led_device, .flag = -1, }, -+#endif -+#if defined(CONFIG_KEYBOARD_MXC) || defined(CONFIG_KEYBOARD_MXC_MODULE) -+ { .pdev = &stk5_keypad_device, .flag = 1, }, -+#endif -+#if defined(CONFIG_SPI_MXC) || defined(CONFIG_SPI_MXC_MODULE) -+ { .pdev = &mxcspi1_device, .flag = 1, }, -+#endif -+#if defined(CONFIG_AC97_BUS) || defined(CONFIG_AC97_BUS_MODULE) -+ { .pdev = &ac97_device, .flag = 1, }, -+#endif -+#if defined(CONFIG_MMC_MXC) || defined(CONFIG_MMC_MXC_MODULE) -+ { .pdev = &stk5_sdhc1_device, .flag = 1, }, -+#endif -+}; -+#define STK5_NUM_DEVICES ARRAY_SIZE(stk5_devices) -+ -+static __init int karo_stk5_board_init(void) -+{ -+ int ret; -+ int i; -+ -+ if (karo_get_board_type() != BOARD_KARO_STK5) { -+ return -ENODEV; -+ } -+ DBG(0, "%s: \n", __FUNCTION__); -+ -+ karo_stk5_serial_init(); -+ -+ dump_regs(); -+ -+ /* enable SSI1_INT (GPIO_3_15) for IRQ probing */ -+ set_irq_flags(gpio_to_irq(GPIO_PORTC | 15), IRQF_VALID | IRQF_PROBE); -+ -+ ret = karo_stk5_fb_register(); -+ if (ret) { -+ 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; -+ if (!stk5_devices[i].flag) { -+ DBG(0, "%s: Skipping platform device[%d] @ %p dev %p: %s\n", -+ __FUNCTION__, i, stk5_devices[i].pdev, &stk5_devices[i].pdev->dev, -+ stk5_devices[i].pdev->name); -+ continue; -+ } -+ DBG(0, "%s: Registering platform device[%d] @ %p dev %p: %s\n", -+ __FUNCTION__, i, stk5_devices[i].pdev, &stk5_devices[i].pdev->dev, -+ stk5_devices[i].pdev->name); -+ ret = platform_device_register(stk5_devices[i].pdev); -+ if (ret) { -+ printk(KERN_WARNING "%s: Failed to register platform_device[%d]: %s: %d\n", -+ __FUNCTION__, i, stk5_devices[i].pdev->name, ret); -+ } -+ } -+ DBG(0, "%s: Done\n", __FUNCTION__); -+ 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:59:19.000000000 +0200 -@@ -381,7 +381,7 @@ DEFINE_CLOCK(gpu2d_clk, 0, CCM_CGR3, 4 - .clk = &c, \ - }, - --static struct clk_lookup lookups[] __initdata = { -+static struct clk_lookup lookups[] = { - _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:59:19.000000000 +0200 -@@ -516,7 +516,7 @@ DEFINE_CLOCK(ipg_clk, 0, NULL, - .clk = &c, \ - }, - --static struct clk_lookup lookups[] __initdata = { -+static struct clk_lookup lookups[] = { - _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 18:01:59.000000000 +0200 -@@ -56,6 +56,9 @@ config ARCH_HAS_RNGA - bool - depends on ARCH_MXC - -+config ARCH_MXC_IOMUX_V2 -+ bool -+ - 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 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 - --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 -+obj-$(CONFIG_ARCH_MXC_IOMUX_V2) += iomux-mx1-mx2.o dma-mx1-mx2.o -+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 18:02:13.000000000 +0200 -@@ -0,0 +1,17 @@ -+/* -+ * Copyright 2009 -+ * -+ * 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 -+ */ -+ -+#define UART1_ENABLED 1 -+#define UART2_ENABLED 1 -+#define UART3_ENABLED 1 -+/* 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 18:02:13.000000000 +0200 -@@ -0,0 +1,13 @@ -+/* -+ * Copyright 2009 -+ * -+ * 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 -+ */ -+ -+#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 18:02:05.000000000 +0200 -@@ -17,6 +17,7 @@ struct clk; - extern void mx1_map_io(void); - extern void mx21_map_io(void); - extern void mx27_map_io(void); -+extern void mx25_map_io(void); - extern void mx31_map_io(void); - extern void mx35_map_io(void); - extern void mxc_init_irq(void); -@@ -24,6 +25,7 @@ extern void mxc_timer_init(struct clk *t - extern int mx1_clocks_init(unsigned long fref); - extern int mx21_clocks_init(unsigned long lref, unsigned long fref); - extern int mx27_clocks_init(unsigned long fref); -+extern int mx25_clocks_init(unsigned long fref); - 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 18:02:13.000000000 +0200 -@@ -0,0 +1,259 @@ -+/* -+ * Copyright 2004-2008 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_DMA_H__ -+#define __ASM_ARCH_MXC_DMA_H__ -+ -+#include -+ -+#define MXC_DMA_DYNAMIC_CHANNEL 255 -+ -+#define MXC_DMA_DONE 0x0 -+#define MXC_DMA_REQUEST_TIMEOUT 0x1 -+#define MXC_DMA_TRANSFER_ERROR 0x2 -+ -+/*! This defines the list of device ID's for DMA */ -+typedef enum mxc_dma_device { -+ MXC_DMA_UART1_RX, -+ MXC_DMA_UART1_TX, -+ MXC_DMA_UART2_RX, -+ MXC_DMA_UART2_TX, -+ MXC_DMA_UART3_RX, -+ MXC_DMA_UART3_TX, -+ MXC_DMA_UART4_RX, -+ MXC_DMA_UART4_TX, -+ MXC_DMA_UART5_RX, -+ MXC_DMA_UART5_TX, -+ MXC_DMA_UART6_RX, -+ MXC_DMA_UART6_TX, -+ MXC_DMA_MMC1_WIDTH_1, -+ MXC_DMA_MMC1_WIDTH_4, -+ MXC_DMA_MMC2_WIDTH_1, -+ MXC_DMA_MMC2_WIDTH_4, -+ MXC_DMA_SSI1_8BIT_RX0, -+ MXC_DMA_SSI1_8BIT_TX0, -+ MXC_DMA_SSI1_16BIT_RX0, -+ MXC_DMA_SSI1_16BIT_TX0, -+ MXC_DMA_SSI1_24BIT_RX0, -+ MXC_DMA_SSI1_24BIT_TX0, -+ MXC_DMA_SSI1_8BIT_RX1, -+ MXC_DMA_SSI1_8BIT_TX1, -+ MXC_DMA_SSI1_16BIT_RX1, -+ MXC_DMA_SSI1_16BIT_TX1, -+ MXC_DMA_SSI1_24BIT_RX1, -+ MXC_DMA_SSI1_24BIT_TX1, -+ MXC_DMA_SSI2_8BIT_RX0, -+ MXC_DMA_SSI2_8BIT_TX0, -+ MXC_DMA_SSI2_16BIT_RX0, -+ MXC_DMA_SSI2_16BIT_TX0, -+ MXC_DMA_SSI2_24BIT_RX0, -+ MXC_DMA_SSI2_24BIT_TX0, -+ MXC_DMA_SSI2_8BIT_RX1, -+ MXC_DMA_SSI2_8BIT_TX1, -+ MXC_DMA_SSI2_16BIT_RX1, -+ MXC_DMA_SSI2_16BIT_TX1, -+ MXC_DMA_SSI2_24BIT_RX1, -+ MXC_DMA_SSI2_24BIT_TX1, -+ MXC_DMA_FIR_RX, -+ MXC_DMA_FIR_TX, -+ MXC_DMA_CSPI1_RX, -+ MXC_DMA_CSPI1_TX, -+ MXC_DMA_CSPI2_RX, -+ MXC_DMA_CSPI2_TX, -+ MXC_DMA_CSPI3_RX, -+ MXC_DMA_CSPI3_TX, -+ MXC_DMA_ATA_RX, -+ MXC_DMA_ATA_TX, -+ MXC_DMA_MEMORY, -+ MXC_DMA_FIFO_MEMORY, -+ MXC_DMA_DSP_PACKET_DATA0_RD, -+ MXC_DMA_DSP_PACKET_DATA0_WR, -+ MXC_DMA_DSP_PACKET_DATA1_RD, -+ MXC_DMA_DSP_PACKET_DATA1_WR, -+ MXC_DMA_DSP_LOG0_CHNL, -+ MXC_DMA_DSP_LOG1_CHNL, -+ MXC_DMA_DSP_LOG2_CHNL, -+ MXC_DMA_DSP_LOG3_CHNL, -+ MXC_DMA_CSI_RX, -+ MXC_DMA_SPDIF_16BIT_TX, -+ MXC_DMA_SPDIF_16BIT_RX, -+ MXC_DMA_SPDIF_32BIT_TX, -+ MXC_DMA_SPDIF_32BIT_RX, -+ MXC_DMA_ASRC_A_RX, -+ MXC_DMA_ASRC_A_TX, -+ MXC_DMA_ASRC_B_RX, -+ MXC_DMA_ASRC_B_TX, -+ MXC_DMA_ASRC_C_RX, -+ MXC_DMA_ASRC_C_TX, -+ MXC_DMA_ESAI_16BIT_RX, -+ MXC_DMA_ESAI_16BIT_TX, -+ MXC_DMA_ESAI_24BIT_RX, -+ MXC_DMA_ESAI_24BIT_TX, -+ MXC_DMA_TEST_RAM2D2RAM, -+ MXC_DMA_TEST_RAM2RAM2D, -+ MXC_DMA_TEST_RAM2D2RAM2D, -+ MXC_DMA_TEST_RAM2RAM, -+ MXC_DMA_TEST_HW_CHAINING, -+ MXC_DMA_TEST_SW_CHAINING -+} mxc_dma_device_t; -+ -+/*! This defines the prototype of callback funtion registered by the drivers */ -+typedef void (*mxc_dma_callback_t) (void *arg, int error_status, -+ unsigned int count); -+ -+/*! This defines the type of DMA transfer requested */ -+typedef enum mxc_dma_mode { -+ MXC_DMA_MODE_READ, -+ MXC_DMA_MODE_WRITE, -+} mxc_dma_mode_t; -+ -+/*! This defines the DMA channel parameters */ -+typedef struct mxc_dma_channel { -+ unsigned int active:1; /*!< When there has a active tranfer, it is set to 1 */ -+ unsigned int lock; /*!< Defines the channel is allocated or not */ -+ int curr_buf; /*!< Current buffer */ -+ mxc_dma_mode_t mode; /*!< Read or Write */ -+ unsigned int channel; /*!< Channel info */ -+ unsigned int dynamic:1; /*!< Channel not statically allocated when 1 */ -+ char *dev_name; /*!< Device name */ -+ void *private; /*!< Private structure for platform */ -+ mxc_dma_callback_t cb_fn; /*!< The callback function */ -+ void *cb_args; /*!< The argument of callback function */ -+} mxc_dma_channel_t; -+ -+/*! This structure contains the information about a dma transfer */ -+typedef struct mxc_dma_requestbuf { -+ dma_addr_t src_addr; /*!< source address */ -+ dma_addr_t dst_addr; /*!< destination address */ -+ int num_of_bytes; /*!< the length of this transfer : bytes */ -+} mxc_dma_requestbuf_t; -+ -+/*! -+ * This function is generally called by the driver at open time. -+ * The DMA driver would do any initialization steps that is required -+ * to get the channel ready for data transfer. -+ * -+ * @param channel_id a pre-defined id. The peripheral driver would specify -+ * the id associated with its peripheral. This would be -+ * used by the DMA driver to identify the peripheral -+ * requesting DMA and do the necessary setup on the -+ * channel associated with the particular peripheral. -+ * The DMA driver could use static or dynamic DMA channel -+ * allocation. -+ * @param dev_name module name or device name -+ * @return returns a negative number on error if request for a DMA channel did not -+ * succeed, returns the channel number to be used on success. -+ */ -+extern int mxc_dma_request(mxc_dma_device_t channel_id, char *dev_name); -+ -+/*! -+ * This function is generally called by the driver at close time. The DMA -+ * driver would do any cleanup associated with this channel. -+ * -+ * @param channel_num the channel number returned at request time. This -+ * would be used by the DMA driver to identify the calling -+ * driver and do the necessary cleanup on the channel -+ * associated with the particular peripheral -+ * @return returns a negative number on error or 0 on success -+ */ -+extern int mxc_dma_free(int channel_num); -+ -+/*! -+ * This function would just configure the buffers specified by the user into -+ * dma channel. The caller must call mxc_dma_enable to start this transfer. -+ * -+ * @param channel_num the channel number returned at request time. This -+ * would be used by the DMA driver to identify the calling -+ * driver and do the necessary cleanup on the channel -+ * associated with the particular peripheral -+ * @param dma_buf an array of physical addresses to the user defined -+ * buffers. The caller must guarantee the dma_buf is -+ * available until the transfer is completed. -+ * @param num_buf number of buffers in the array -+ * @param mode specifies whether this is READ or WRITE operation -+ * @return This function returns a negative number on error if buffer could not be -+ * added with DMA for transfer. On Success, it returns 0 -+ */ -+extern int mxc_dma_config(int channel_num, mxc_dma_requestbuf_t * dma_buf, -+ int num_buf, mxc_dma_mode_t mode); -+ -+/*! -+ * This function would just configure the scatterlist specified by the -+ * user into dma channel. This is a slight variation of mxc_dma_config(), -+ * it is provided for the convenience of drivers that have a scatterlist -+ * passed into them. It is the calling driver's responsibility to have the -+ * correct physical address filled in the "dma_address" field of the -+ * scatterlist. -+ * -+ * @param channel_num the channel number returned at request time. This -+ * would be used by the DMA driver to identify the calling -+ * driver and do the necessary cleanup on the channel -+ * associated with the particular peripheral -+ * @param sg a scatterlist of buffers. The caller must guarantee -+ * the dma_buf is available until the transfer is -+ * completed. -+ * @param num_buf number of buffers in the array -+ * @param num_of_bytes total number of bytes to transfer. If set to 0, this -+ * would imply to use the length field of the scatterlist -+ * for each DMA transfer. Else it would calculate the size -+ * for each DMA transfer. -+ * @param mode specifies whether this is READ or WRITE operation -+ * @return This function returns a negative number on error if buffer could not -+ * be added with DMA for transfer. On Success, it returns 0 -+ */ -+extern int mxc_dma_sg_config(int channel_num, struct scatterlist *sg, -+ int num_buf, int num_of_bytes, -+ mxc_dma_mode_t mode); -+ -+/*! -+ * This function is provided if the driver would like to set/change its -+ * callback function. -+ * -+ * @param channel_num the channel number returned at request time. This -+ * would be used by the DMA driver to identify the calling -+ * driver and do the necessary cleanup on the channel -+ * associated with the particular peripheral -+ * @param callback a callback function to provide notification on transfer -+ * completion, user could specify NULL if he does not wish -+ * to be notified -+ * @param arg an argument that gets passed in to the callback -+ * function, used by the user to do any driver specific -+ * operations. -+ * @return this function returns a negative number on error if the callback -+ * could not be set for the channel or 0 on success -+ */ -+extern int mxc_dma_callback_set(int channel_num, mxc_dma_callback_t callback, -+ void *arg); -+ -+/*! -+ * This stops the DMA channel and any ongoing transfers. Subsequent use of -+ * mxc_dma_enable() will restart the channel and restart the transfer. -+ * -+ * @param channel_num the channel number returned at request time. This -+ * would be used by the DMA driver to identify the calling -+ * driver and do the necessary cleanup on the channel -+ * associated with the particular peripheral -+ * @return returns a negative number on error or 0 on success -+ */ -+extern int mxc_dma_disable(int channel_num); -+ -+/*! -+ * This starts DMA transfer. Or it restarts DMA on a stopped channel -+ * previously stopped with mxc_dma_disable(). -+ * -+ * @param channel_num the channel number returned at request time. This -+ * would be used by the DMA driver to identify the calling -+ * driver and do the necessary cleanup on the channel -+ * associated with the particular peripheral -+ * @return returns a negative number on error or 0 on success -+ */ -+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 18:02:06.000000000 +0200 -@@ -29,13 +29,18 @@ - #endif - - #ifdef CONFIG_ARCH_MX2 -+#ifndef CONFIG_MACH_MX25 - # include -+#endif - # ifdef CONFIG_MACH_MX21 - # include - # endif - # ifdef CONFIG_MACH_MX27 - # include - # endif -+# ifdef CONFIG_MACH_MX25 -+# include -+# endif - #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 18:02:06.000000000 +0200 -@@ -13,7 +13,8 @@ - #define PCR_BPIX_4 (2 << 25) - #define PCR_BPIX_8 (3 << 25) - #define PCR_BPIX_12 (4 << 25) --#define PCR_BPIX_16 (4 << 25) -+#define PCR_BPIX_16 (5 << 25) -+#define PCR_BPIX_18 (6 << 25) - #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 18:02:13.000000000 +0200 -@@ -0,0 +1,905 @@ -+/* -+ * arch/arm/plat-mxc/include/mach/iomux-mx25.h -+ * -+ * Copyright (C) 2009 by Lothar Wassmann -+ * -+ * based on arch/arm/mach-mx25/mx25_pins.h -+ * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved. -+ * and -+ * arch/arm/plat-mxc/include/mach/iomux-mx35.h -+ * Copyright (C, NO_PAD_CTRL) 2009 by Jan Weitzel Phytec Messtechnik GmbH -+ * -+ * 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 __IOMUX_MX25_H__ -+#define __IOMUX_MX25_H__ -+ -+#include -+ -+/* -+ * -+ * @brief MX25 I/O Pin List -+ * -+ * @ingroup GPIO_MX25 -+ */ -+ -+#ifndef __ASSEMBLY__ -+ -+/* -+ * 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 IOMUX_TO_GPIO(__pad_desc) ({ \ -+ int __gpio = -1; \ -+ struct pad_desc *__pd = __pad_desc; \ -+ \ -+ switch (__pd->mux_ctrl_ofs) { \ -+ case MX25_PAD_GPIO_A__GPIO_A: \ -+ __gpio = GPIO_A; \ -+ break; \ -+ case MX25_PAD_GPIO_B__GPIO_B: \ -+ __gpio = GPIO_B; \ -+ break; \ -+ case MX25_PAD_GPIO_C__GPIO_C: \ -+ __gpio = GPIO_C; \ -+ break; \ -+ case MX25_PAD_GPIO_D__GPIO_D: \ -+ __gpio = GPIO_D; \ -+ break; \ -+ case MX25_PAD_GPIO_E__GPIO_E: \ -+ __gpio = GPIO_E; \ -+ break; \ -+ case MX25_PAD_GPIO_F__GPIO_F: \ -+ __gpio = GPIO_F; \ -+ break; \ -+ case MX25_PAD_CSI_D7__GPIO_1_6: \ -+ __gpio = GPIO_1_6; \ -+ break; \ -+ case MX25_PAD_CSI_D8__GPIO_1_7: \ -+ __gpio = GPIO_1_7; \ -+ break; \ -+ case MX25_PAD_CSI_MCLK__GPIO_1_8: \ -+ __gpio = GPIO_1_8; \ -+ break; \ -+ case MX25_PAD_CSI_VSYNC__GPIO_1_9: \ -+ __gpio = GPIO_1_9; \ -+ break; \ -+ case MX25_PAD_CSI_HSYNC__GPIO_1_10: \ -+ __gpio = GPIO_1_10; \ -+ break; \ -+ case MX25_PAD_CSI_PIXCLK__GPIO_1_11: \ -+ __gpio = GPIO_1_11; \ -+ break; \ -+ case MX25_PAD_I2C1_CLK__GPIO_1_12: \ -+ __gpio = GPIO_1_12; \ -+ break; \ -+ case MX25_PAD_I2C1_DAT__GPIO_1_13: \ -+ __gpio = GPIO_1_13; \ -+ break; \ -+ case MX25_PAD_CSPI1_MOSI__GPIO_1_14: \ -+ __gpio = GPIO_1_14; \ -+ break; \ -+ case MX25_PAD_CSPI1_MISO__GPIO_1_15: \ -+ __gpio = GPIO_1_15; \ -+ break; \ -+ case MX25_PAD_CSPI1_SS0__GPIO_1_16: \ -+ __gpio = GPIO_1_16; \ -+ break; \ -+ case MX25_PAD_CSPI1_SS1__GPIO_1_17: \ -+ __gpio = GPIO_1_17; \ -+ break; \ -+ case MX25_PAD_CSPI1_SCLK__GPIO_1_18: \ -+ __gpio = GPIO_1_18; \ -+ break; \ -+ case MX25_PAD_LD5__GPIO_1_19: \ -+ __gpio = GPIO_1_19; \ -+ break; \ -+ case MX25_PAD_LD6__GPIO_1_20: \ -+ __gpio = GPIO_1_20; \ -+ break; \ -+ case MX25_PAD_LD7__GPIO_1_21: \ -+ __gpio = GPIO_1_21; \ -+ break; \ -+ case MX25_PAD_HSYNC__GPIO_1_22: \ -+ __gpio = GPIO_1_22; \ -+ break; \ -+ case MX25_PAD_VSYNC__GPIO_1_23: \ -+ __gpio = GPIO_1_23; \ -+ break; \ -+ case MX25_PAD_LSCLK__GPIO_1_24: \ -+ __gpio = GPIO_1_24; \ -+ break; \ -+ case MX25_PAD_OE_ACD__GPIO_1_25: \ -+ __gpio = GPIO_1_25; \ -+ break; \ -+ case MX25_PAD_PWM__GPIO_1_26: \ -+ __gpio = GPIO_1_26; \ -+ break; \ -+ case MX25_PAD_CSI_D2__GPIO_1_27: \ -+ __gpio = GPIO_1_27; \ -+ break; \ -+ case MX25_PAD_CSI_D3__GPIO_1_28: \ -+ __gpio = GPIO_1_28; \ -+ break; \ -+ case MX25_PAD_CSI_D4__GPIO_1_29: \ -+ __gpio = GPIO_1_29; \ -+ break; \ -+ case MX25_PAD_CSI_D5__GPIO_1_30: \ -+ __gpio = GPIO_1_30; \ -+ break; \ -+ case MX25_PAD_CSI_D6__GPIO_1_31: \ -+ __gpio = GPIO_1_31; \ -+ break; \ -+ \ -+ case MX25_PAD_A14__GPIO_2_0: \ -+ __gpio = GPIO_2_0; \ -+ break; \ -+ case MX25_PAD_A15__GPIO_2_1: \ -+ __gpio = GPIO_2_1; \ -+ break; \ -+ case MX25_PAD_A16__GPIO_2_2: \ -+ __gpio = GPIO_2_2; \ -+ break; \ -+ case MX25_PAD_A17__GPIO_2_3: \ -+ __gpio = GPIO_2_3; \ -+ break; \ -+ case MX25_PAD_A18__GPIO_2_4: \ -+ __gpio = GPIO_2_4; \ -+ break; \ -+ case MX25_PAD_A19__GPIO_2_5: \ -+ __gpio = GPIO_2_5; \ -+ break; \ -+ case MX25_PAD_A20__GPIO_2_6: \ -+ __gpio = GPIO_2_6; \ -+ break; \ -+ case MX25_PAD_A21__GPIO_2_7: \ -+ __gpio = GPIO_2_7; \ -+ break; \ -+ case MX25_PAD_A22__GPIO_2_8: \ -+ __gpio = GPIO_2_8; \ -+ break; \ -+ case MX25_PAD_A23__GPIO_2_9: \ -+ __gpio = GPIO_2_9; \ -+ break; \ -+ case MX25_PAD_A24__GPIO_2_10: \ -+ __gpio = GPIO_2_10; \ -+ break; \ -+ case MX25_PAD_A25__GPIO_2_11: \ -+ __gpio = GPIO_2_11; \ -+ break; \ -+ case MX25_PAD_EB0__GPIO_2_12: \ -+ __gpio = GPIO_2_12; \ -+ break; \ -+ case MX25_PAD_EB1__GPIO_2_13: \ -+ __gpio = GPIO_2_13; \ -+ break; \ -+ case MX25_PAD_OE__GPIO_2_14: \ -+ __gpio = GPIO_2_14; \ -+ break; \ -+ case MX25_PAD_LD0__GPIO_2_15: \ -+ __gpio = GPIO_2_15; \ -+ break; \ -+ case MX25_PAD_LD1__GPIO_2_16: \ -+ __gpio = GPIO_2_16; \ -+ break; \ -+ case MX25_PAD_LD2__GPIO_2_17: \ -+ __gpio = GPIO_2_17; \ -+ break; \ -+ case MX25_PAD_LD3__GPIO_2_18: \ -+ __gpio = GPIO_2_18; \ -+ break; \ -+ case MX25_PAD_LD4__GPIO_2_19: \ -+ __gpio = GPIO_2_19; \ -+ break; \ -+ case MX25_PAD_DE_B__GPIO_2_20: \ -+ __gpio = GPIO_2_20; \ -+ break; \ -+ case MX25_PAD_CLKO__GPIO_2_21: \ -+ __gpio = GPIO_2_21; \ -+ break; \ -+ case MX25_PAD_CSPI1_RDY__GPIO_2_22: \ -+ __gpio = GPIO_2_22; \ -+ break; \ -+ case MX25_PAD_SD1_CMD__GPIO_2_23: \ -+ __gpio = GPIO_2_23; \ -+ break; \ -+ case MX25_PAD_SD1_CLK__GPIO_2_24: \ -+ __gpio = GPIO_2_24; \ -+ break; \ -+ case MX25_PAD_SD1_DATA0__GPIO_2_25: \ -+ __gpio = GPIO_2_25; \ -+ break; \ -+ case MX25_PAD_SD1_DATA1__GPIO_2_26: \ -+ __gpio = GPIO_2_26; \ -+ break; \ -+ case MX25_PAD_SD1_DATA2__GPIO_2_27: \ -+ __gpio = GPIO_2_27; \ -+ break; \ -+ case MX25_PAD_SD1_DATA3__GPIO_2_28: \ -+ __gpio = GPIO_2_28; \ -+ break; \ -+ case MX25_PAD_KPP_ROW0__GPIO_2_29: \ -+ __gpio = GPIO_2_29; \ -+ break; \ -+ case MX25_PAD_KPP_ROW1__GPIO_2_30: \ -+ __gpio = GPIO_2_30; \ -+ break; \ -+ case MX25_PAD_KPP_ROW2__GPIO_2_31: \ -+ __gpio = GPIO_2_31; \ -+ break; \ -+ \ -+ case MX25_PAD_KPP_ROW3__GPIO_3_0: \ -+ __gpio = GPIO_3_0; \ -+ break; \ -+ case MX25_PAD_KPP_COL0__GPIO_3_1: \ -+ __gpio = GPIO_3_1; \ -+ break; \ -+ case MX25_PAD_KPP_COL1__GPIO_3_2: \ -+ __gpio = GPIO_3_2; \ -+ break; \ -+ case MX25_PAD_KPP_COL2__GPIO_3_3: \ -+ __gpio = GPIO_3_3; \ -+ break; \ -+ case MX25_PAD_KPP_COL3__GPIO_3_4: \ -+ __gpio = GPIO_3_4; \ -+ break; \ -+ case MX25_PAD_FEC_MDC__GPIO_3_5: \ -+ __gpio = GPIO_3_5; \ -+ break; \ -+ case MX25_PAD_FEC_MDIO__GPIO_3_6: \ -+ __gpio = GPIO_3_6; \ -+ break; \ -+ case MX25_PAD_FEC_TDATA0__GPIO_3_7: \ -+ __gpio = GPIO_3_7; \ -+ break; \ -+ case MX25_PAD_FEC_TDATA1__GPIO_3_8: \ -+ __gpio = GPIO_3_8; \ -+ break; \ -+ case MX25_PAD_FEC_TX_EN__GPIO_3_9: \ -+ __gpio = GPIO_3_9; \ -+ break; \ -+ case MX25_PAD_FEC_RDATA0__GPIO_3_10: \ -+ __gpio = GPIO_3_10; \ -+ break; \ -+ case MX25_PAD_FEC_RDATA1__GPIO_3_11: \ -+ __gpio = GPIO_3_11; \ -+ break; \ -+ case MX25_PAD_FEC_RX_DV__GPIO_3_12: \ -+ __gpio = GPIO_3_12; \ -+ break; \ -+ case MX25_PAD_FEC_TX_CLK__GPIO_3_13: \ -+ __gpio = GPIO_3_13; \ -+ break; \ -+ case MX25_PAD_RTCK__GPIO_3_14: \ -+ __gpio = GPIO_3_14; \ -+ break; \ -+ case MX25_PAD_EXT_ARMCLK__GPIO_3_15: \ -+ __gpio = GPIO_3_15; \ -+ break; \ -+ case MX25_PAD_UPLL_BYPCLK__GPIO_3_16: \ -+ __gpio = GPIO_3_16; \ -+ break; \ -+ case MX25_PAD_VSTBY_REQ__GPIO_3_17: \ -+ __gpio = GPIO_3_17; \ -+ break; \ -+ case MX25_PAD_VSTBY_ACK__GPIO_3_18: \ -+ __gpio = GPIO_3_18; \ -+ break; \ -+ case MX25_PAD_POWER_FAIL__GPIO_3_19: \ -+ __gpio = GPIO_3_19; \ -+ break; \ -+ case MX25_PAD_CS4__GPIO_3_20: \ -+ __gpio = GPIO_3_20; \ -+ break; \ -+ case MX25_PAD_CS5__GPIO_3_21: \ -+ __gpio = GPIO_3_21; \ -+ break; \ -+ case MX25_PAD_NF_CE0__GPIO_3_22: \ -+ __gpio = GPIO_3_22; \ -+ break; \ -+ case MX25_PAD_ECB__GPIO_3_23: \ -+ __gpio = GPIO_3_23; \ -+ break; \ -+ case MX25_PAD_LBA__GPIO_3_24: \ -+ __gpio = GPIO_3_24; \ -+ break; \ -+ case MX25_PAD_RW__GPIO_3_25: \ -+ __gpio = GPIO_3_25; \ -+ break; \ -+ case MX25_PAD_NFWE_B__GPIO_3_26: \ -+ __gpio = GPIO_3_26; \ -+ break; \ -+ case MX25_PAD_NFRE_B__GPIO_3_27: \ -+ __gpio = GPIO_3_27; \ -+ break; \ -+ case MX25_PAD_NFALE__GPIO_3_28: \ -+ __gpio = GPIO_3_28; \ -+ break; \ -+ case MX25_PAD_NFCLE__GPIO_3_29: \ -+ __gpio = GPIO_3_29; \ -+ break; \ -+ case MX25_PAD_NFWP_B__GPIO_3_30: \ -+ __gpio = GPIO_3_30; \ -+ break; \ -+ case MX25_PAD_NFRB__GPIO_3_31: \ -+ __gpio = GPIO_3_31; \ -+ break; \ -+ \ -+ case MX25_PAD_A10__GPIO_4_0: \ -+ __gpio = GPIO_4_0; \ -+ break; \ -+ case MX25_PAD_A13__GPIO_4_1: \ -+ __gpio = GPIO_4_1; \ -+ break; \ -+ case MX25_PAD_CS0__GPIO_4_2: \ -+ __gpio = GPIO_4_2; \ -+ break; \ -+ case MX25_PAD_CS1__GPIO_4_3: \ -+ __gpio = GPIO_4_3; \ -+ break; \ -+ case MX25_PAD_BCLK__GPIO_4_4: \ -+ __gpio = GPIO_4_4; \ -+ break; \ -+ case MX25_PAD_D15__GPIO_4_5: \ -+ __gpio = GPIO_4_5; \ -+ break; \ -+ case MX25_PAD_D14__GPIO_4_6: \ -+ __gpio = GPIO_4_6; \ -+ break; \ -+ case MX25_PAD_D13__GPIO_4_7: \ -+ __gpio = GPIO_4_7; \ -+ break; \ -+ case MX25_PAD_D12__GPIO_4_8: \ -+ __gpio = GPIO_4_8; \ -+ break; \ -+ case MX25_PAD_D11__GPIO_4_9: \ -+ __gpio = GPIO_4_9; \ -+ break; \ -+ case MX25_PAD_D10__GPIO_4_10: \ -+ __gpio = GPIO_4_10; \ -+ break; \ -+ case MX25_PAD_D9__GPIO_4_11: \ -+ __gpio = GPIO_4_11; \ -+ break; \ -+ case MX25_PAD_D8__GPIO_4_12: \ -+ __gpio = GPIO_4_12; \ -+ break; \ -+ case MX25_PAD_D7__GPIO_4_13: \ -+ __gpio = GPIO_4_13; \ -+ break; \ -+ case MX25_PAD_D6__GPIO_4_14: \ -+ __gpio = GPIO_4_14; \ -+ break; \ -+ case MX25_PAD_D5__GPIO_4_15: \ -+ __gpio = GPIO_4_15; \ -+ break; \ -+ case MX25_PAD_D4__GPIO_4_16: \ -+ __gpio = GPIO_4_16; \ -+ break; \ -+ case MX25_PAD_D3__GPIO_4_17: \ -+ __gpio = GPIO_4_17; \ -+ break; \ -+ case MX25_PAD_D2__GPIO_4_18: \ -+ __gpio = GPIO_4_18; \ -+ break; \ -+ case MX25_PAD_D1__GPIO_4_19: \ -+ __gpio = GPIO_4_19; \ -+ break; \ -+ case MX25_PAD_D0__GPIO_4_20: \ -+ __gpio = GPIO_4_20; \ -+ break; \ -+ case MX25_PAD_CSI_D9__GPIO_4_21: \ -+ __gpio = GPIO_4_21; \ -+ break; \ -+ case MX25_PAD_UART1_RXD__GPIO_4_22: \ -+ __gpio = GPIO_4_22; \ -+ break; \ -+ case MX25_PAD_UART1_TXD__GPIO_4_23: \ -+ __gpio = GPIO_4_23; \ -+ break; \ -+ case MX25_PAD_UART1_RTS__GPIO_4_24: \ -+ __gpio = GPIO_4_24; \ -+ break; \ -+ case MX25_PAD_UART1_CTS__GPIO_4_25: \ -+ __gpio = GPIO_4_25; \ -+ break; \ -+ case MX25_PAD_UART2_RXD__GPIO_4_26: \ -+ __gpio = GPIO_4_26; \ -+ break; \ -+ case MX25_PAD_UART2_TXD__GPIO_4_27: \ -+ __gpio = GPIO_4_27; \ -+ break; \ -+ case MX25_PAD_UART2_RTS__GPIO_4_28: \ -+ __gpio = GPIO_4_28; \ -+ break; \ -+ case MX25_PAD_UART2_CTS__GPIO_4_29: \ -+ __gpio = GPIO_4_29; \ -+ break; \ -+ case MX25_PAD_BOOT_MODE0__GPIO_4_30: \ -+ __gpio = GPIO_4_30; \ -+ break; \ -+ case MX25_PAD_BOOT_MODE1__GPIO_4_31: \ -+ __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 18:02:08.000000000 +0200 -@@ -54,7 +54,7 @@ struct pad_desc { - unsigned select_input:3; - }; - --#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 { - /* - * 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_DRIVE_VOLTAGE_3_3_V (0 << 13) -+#define PAD_CTL_DRIVE_VOLTAGE_1_8_V (1 << 13) - --#define PAD_CTL_NO_HYSTERESIS 0 --#define PAD_CTL_HYSTERESIS 1 -+#define PAD_CTL_NO_HYSTERESIS (0 << 8) -+#define PAD_CTL_HYSTERESIS (1 << 8) - --#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_PULL_DISABLED (0x0 << 4) -+#define PAD_CTL_PULL_KEEPER (0x8 << 4) -+#define PAD_CTL_PULL_DOWN_100K (0xc << 4) -+#define PAD_CTL_PULL_UP_47K (0xd << 4) -+#define PAD_CTL_PULL_UP_100K (0xe << 4) -+#define PAD_CTL_PULL_UP_22K (0xf << 4) -+ -+#define PAD_CTL_OUTPUT_CMOS (0 << 3) -+#define PAD_CTL_OUTPUT_OPEN_DRAIN (1 << 3) -+ -+#define PAD_CTL_DRIVE_STRENGTH_NORM (0 << 1) -+#define PAD_CTL_DRIVE_STRENGTH_HIGH (1 << 1) -+#define PAD_CTL_DRIVE_STRENGTH_MAX (2 << 1) - --#define PAD_CTL_SLEW_RATE_SLOW 0 --#define PAD_CTL_SLEW_RATE_FAST 1 -+#define PAD_CTL_SLEW_RATE_SLOW (0 << 0) -+#define PAD_CTL_SLEW_RATE_FAST (1 << 0) - - /* - * 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 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 - */ -+#ifndef CONFIG_MACH_MX25 - #define VA_GPIO_BASE IO_ADDRESS(GPIO_BASE_ADDR) -+#endif - #define MXC_DDIR(x) (0x00 + ((x) << 8)) -+#ifndef CONFIG_MACH_MX25 - #define MXC_OCR1(x) (0x04 + ((x) << 8)) - #define MXC_OCR2(x) (0x08 + ((x) << 8)) -+#endif - #define MXC_ICONFA1(x) (0x0c + ((x) << 8)) - #define MXC_ICONFA2(x) (0x10 + ((x) << 8)) - #define MXC_ICONFB1(x) (0x14 + ((x) << 8)) -@@ -96,16 +100,20 @@ - - - #ifdef CONFIG_ARCH_MX1 --#include -+# include - #endif - #ifdef CONFIG_ARCH_MX2 --#include --#ifdef CONFIG_MACH_MX21 --#include --#endif --#ifdef CONFIG_MACH_MX27 --#include --#endif -+# ifndef CONFIG_MACH_MX25 -+# include -+# ifdef CONFIG_MACH_MX21 -+# include -+# endif -+# endif -+# ifdef CONFIG_MACH_MX27 -+# include -+# else -+# include -+# endif - #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 18:02:09.000000000 +0200 -@@ -21,7 +21,11 @@ - #if defined CONFIG_ARCH_MX1 - #define MXC_GPIO_IRQS (32 * 4) - #elif defined CONFIG_ARCH_MX2 -+#ifndef CONFIG_MACH_MX25 - #define MXC_GPIO_IRQS (32 * 6) -+#else -+#define MXC_GPIO_IRQS (32 * 4) -+#endif - #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 18:02:09.000000000 +0200 -@@ -14,12 +14,13 @@ - #if defined CONFIG_ARCH_MX1 - #define PHYS_OFFSET UL(0x08000000) - #elif defined CONFIG_ARCH_MX2 --#ifdef CONFIG_MACH_MX21 -+# if defined(CONFIG_MACH_MX21) - #define PHYS_OFFSET UL(0xC0000000) --#endif --#ifdef CONFIG_MACH_MX27 -+# elif defined(CONFIG_MACH_MX27) - #define PHYS_OFFSET UL(0xA0000000) --#endif -+# elif defined(CONFIG_MACH_MX25) -+#define PHYS_OFFSET UL(0x80000000) -+# endif - #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 18:02:13.000000000 +0200 -@@ -0,0 +1,482 @@ -+/* -+ * Copyright 2008-2009 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 -+ */ -+ -+/*! -+ * @file arch-mxc/mx25.h -+ * @brief This file contains register definitions. -+ * -+ * @ingroup MSL_MX25 -+ */ -+ -+#ifndef __ASM_ARCH_MXC_MX25_H__ -+#define __ASM_ARCH_MXC_MX25_H__ -+ -+#ifndef __ASM_ARCH_MXC_HARDWARE_H__ -+#error "Do not include directly." -+#endif -+ -+#ifdef CONFIG_DEBUG_LL -+#ifdef CONFIG_MACH_TX25 -+#include -+#endif -+#endif // CONFIG_DEBUG_LL -+ -+/* -+ * MX25 memory map: -+ * -+ * Virt Phys Size What -+ * --------------------------------------------------------------------------- -+ * FC000000 43F00000 1M AIPS 1 -+ * FC100000 50000000 1M SPBA -+ * FC200000 53F00000 1M AIPS 2 -+ * FC300000 60000000 1M ROMPATCH (128M) -+ * FC400000 68000000 1M ASIC (128M) -+ * FC500000 78000000 128K FBC RAM (IRAM) -+ * 80000000 256M SDRAM0 -+ * 90000000 256M SDRAM1 -+ * A0000000 128M CS0 Flash -+ * A8000000 128M CS1 Flash -+ * B0000000 32M CS2 SRAM -+ * B2000000 32M CS3 -+ * B4000000 32M CS4 -+ * B6000000 32M CS5 -+ * FC520000 B8000000 64K SDRAM, WEIM, M3IF, EMI controllers -+ * FC530000 BB000000 8K NFC -+ */ -+ -+#include -+#define VA(x) _AT(void __force __iomem *,x) -+ -+/* -+ * IRAM -+ */ -+#define IRAM_BASE_ADDR UL(0x78000000) /* internal ram */ -+#define IRAM_BASE_ADDR_VIRT VA(0xFC500000) -+#define IRAM_SIZE SZ_128K -+ -+/* -+ * AIPS 1 -+ */ -+#define AIPS1_BASE_ADDR UL(0x43F00000) -+#define AIPS1_BASE_ADDR_VIRT VA(0xFC000000) -+#define AIPS1_SIZE SZ_1M -+ -+#define MAX_BASE_ADDR (AIPS1_BASE_ADDR + 0x00004000) -+#define CLKCTL_BASE_ADDR (AIPS1_BASE_ADDR + 0x00008000) -+#define ETB_SLOT4_BASE_ADDR (AIPS1_BASE_ADDR + 0x0000C000) -+#define ETB_SLOT5_BASE_ADDR (AIPS1_BASE_ADDR + 0x00010000) -+#define AAPE_BASE_ADDR (AIPS1_BASE_ADDR + 0x00014000) -+#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 UART1_BASE_ADDR (AIPS1_BASE_ADDR + 0x00090000) -+#define UART2_BASE_ADDR (AIPS1_BASE_ADDR + 0x00094000) -+#define I2C2_BASE_ADDR (AIPS1_BASE_ADDR + 0x00098000) -+#define OWIRE_BASE_ADDR (AIPS1_BASE_ADDR + 0x0009C000) -+#define ATA_BASE_ADDR (AIPS1_BASE_ADDR + 0x000A0000) -+#define CSPI1_BASE_ADDR (AIPS1_BASE_ADDR + 0x000A4000) -+#define KPP_BASE_ADDR (AIPS1_BASE_ADDR + 0x000A8000) -+#define IOMUXC_BASE_ADDR (AIPS1_BASE_ADDR + 0x000AC000) -+#define AUDMUX_BASE_ADDR (AIPS1_BASE_ADDR + 0x000B0000) -+#define ECT_A_BASE_ADDR (AIPS1_BASE_ADDR + 0x000B8000) -+#define ECT_B_BASE_ADDR (AIPS1_BASE_ADDR + 0x000BC000) -+ -+/* -+ * SPBA global module enabled #0 -+ */ -+#define SPBA0_BASE_ADDR UL(0x50000000) -+#define SPBA0_BASE_ADDR_VIRT VA(0xFC100000) -+#define SPBA0_SIZE SZ_1M -+ -+#define CSPI3_BASE_ADDR (SPBA0_BASE_ADDR + 0x00004000) -+#define UART4_BASE_ADDR (SPBA0_BASE_ADDR + 0x00008000) -+#define UART3_BASE_ADDR (SPBA0_BASE_ADDR + 0x0000C000) -+#define CSPI2_BASE_ADDR (SPBA0_BASE_ADDR + 0x00010000) -+#define SSI2_BASE_ADDR (SPBA0_BASE_ADDR + 0x00014000) -+#define ESAI_BASE_ADDR (SPBA0_BASE_ADDR + 0x00018000) -+#define ATA_DMA_BASE_ADDR (SPBA0_BASE_ADDR + 0x00020000) -+#define SIM1_BASE_ADDR (SPBA0_BASE_ADDR + 0x00024000) -+#define SIM2_BASE_ADDR (SPBA0_BASE_ADDR + 0x00028000) -+#define UART5_BASE_ADDR (SPBA0_BASE_ADDR + 0x0002C000) -+#define TSC_BASE_ADDR (SPBA0_BASE_ADDR + 0x00030000) -+#define SSI1_BASE_ADDR (SPBA0_BASE_ADDR + 0x00034000) -+#define FEC_BASE_ADDR (SPBA0_BASE_ADDR + 0x00038000) -+#define SPBA_CTRL_BASE_ADDR (SPBA0_BASE_ADDR + 0x0003C000) -+ -+/*! -+ * defines for SPBA modules -+ */ -+#define SPBA_CSPI3 (0x1 << 2) -+#define SPBA_UART4 (0x2 << 2) -+#define SPBA_UART3 (0x3 << 2) -+#define SPBA_CSPI2 (0x4 << 2) -+#define SPBA_SSI2 (0x5 << 2) -+#define SPBA_ESAI (0x6 << 2) -+#define SPBA_ATA (0x8 << 2) -+#define SPBA_SIM1 (0x9 << 2) -+#define SPBA_SIM2 (0xA << 2) -+#define SPBA_UART5 (0xB << 2) -+#define SPBA_ANALOG (0xC << 2) -+#define SPBA_SSI1 (0xD << 2) -+#define SPBA_FEC (0xE << 2) -+ -+/*! -+ * Defines for modules using static and dynamic DMA channels -+ */ -+#define MXC_DMA_CHANNEL_IRAM 30 -+#define MXC_DMA_CHANNEL_UART1_RX MXC_DMA_DYNAMIC_CHANNEL -+#define MXC_DMA_CHANNEL_UART1_TX MXC_DMA_DYNAMIC_CHANNEL -+#define MXC_DMA_CHANNEL_UART2_RX MXC_DMA_DYNAMIC_CHANNEL -+#define MXC_DMA_CHANNEL_UART2_TX MXC_DMA_DYNAMIC_CHANNEL -+#define MXC_DMA_CHANNEL_UART3_RX MXC_DMA_DYNAMIC_CHANNEL -+#define MXC_DMA_CHANNEL_UART3_TX MXC_DMA_DYNAMIC_CHANNEL -+#define MXC_DMA_CHANNEL_UART4_RX MXC_DMA_DYNAMIC_CHANNEL -+#define MXC_DMA_CHANNEL_UART4_TX MXC_DMA_DYNAMIC_CHANNEL -+#define MXC_DMA_CHANNEL_UART5_RX MXC_DMA_DYNAMIC_CHANNEL -+#define MXC_DMA_CHANNEL_UART5_TX MXC_DMA_DYNAMIC_CHANNEL -+#define MXC_DMA_CHANNEL_MMC1 MXC_DMA_DYNAMIC_CHANNEL -+#define MXC_DMA_CHANNEL_SSI1_RX MXC_DMA_DYNAMIC_CHANNEL -+#ifdef CONFIG_SDMA_IRAM -+#define MXC_DMA_CHANNEL_SSI1_TX (MXC_DMA_CHANNEL_IRAM + 1) -+#else -+#define MXC_DMA_CHANNEL_SSI1_TX MXC_DMA_DYNAMIC_CHANNEL -+#endif -+#define MXC_DMA_CHANNEL_SSI2_RX MXC_DMA_DYNAMIC_CHANNEL -+#define MXC_DMA_CHANNEL_SSI2_TX MXC_DMA_DYNAMIC_CHANNEL -+#define MXC_DMA_CHANNEL_CSPI1_RX MXC_DMA_DYNAMIC_CHANNEL -+#define MXC_DMA_CHANNEL_CSPI1_TX MXC_DMA_DYNAMIC_CHANNEL -+#define MXC_DMA_CHANNEL_CSPI2_RX MXC_DMA_DYNAMIC_CHANNEL -+#define MXC_DMA_CHANNEL_CSPI2_TX MXC_DMA_DYNAMIC_CHANNEL -+#define MXC_DMA_CHANNEL_CSPI3_RX MXC_DMA_DYNAMIC_CHANNEL -+#define MXC_DMA_CHANNEL_CSPI3_TX MXC_DMA_DYNAMIC_CHANNEL -+#define MXC_DMA_CHANNEL_ATA_RX MXC_DMA_DYNAMIC_CHANNEL -+#define MXC_DMA_CHANNEL_ATA_TX MXC_DMA_DYNAMIC_CHANNEL -+#define MXC_DMA_CHANNEL_MEMORY MXC_DMA_DYNAMIC_CHANNEL -+#define MXC_DMA_CHANNEL_ESAI_RX MXC_DMA_DYNAMIC_CHANNEL -+#define MXC_DMA_CHANNEL_ESAI_TX MXC_DMA_DYNAMIC_CHANNEL -+ -+/* -+ * AIPS 2 -+ */ -+#define AIPS2_BASE_ADDR UL(0x53F00000) -+#define AIPS2_BASE_ADDR_VIRT VA(0xFC200000) -+#define AIPS2_SIZE SZ_1M -+ -+#define CCM_BASE_ADDR (AIPS2_BASE_ADDR + 0x00080000) -+#define GPT4_BASE_ADDR (AIPS2_BASE_ADDR + 0x00084000) -+#define GPT3_BASE_ADDR (AIPS2_BASE_ADDR + 0x00088000) -+#define GPT2_BASE_ADDR (AIPS2_BASE_ADDR + 0x0008C000) -+#define GPT1_BASE_ADDR (AIPS2_BASE_ADDR + 0x00090000) -+#define EPIT1_BASE_ADDR (AIPS2_BASE_ADDR + 0x00094000) -+#define EPIT2_BASE_ADDR (AIPS2_BASE_ADDR + 0x00098000) -+#define GPIO4_BASE_ADDR (AIPS2_BASE_ADDR + 0x0009C000) -+#define PWM2_BASE_ADDR (AIPS2_BASE_ADDR + 0x000A0000) -+#define GPIO3_BASE_ADDR (AIPS2_BASE_ADDR + 0x000A4000) -+#define PWM3_BASE_ADDR (AIPS2_BASE_ADDR + 0x000A8000) -+#define SCC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000AC000) -+#define RNGD_BASE_ADDR (AIPS2_BASE_ADDR + 0x000B0000) -+#define MMC_SDHC1_BASE_ADDR (AIPS2_BASE_ADDR + 0x000B4000) -+#define MMC_SDHC2_BASE_ADDR (AIPS2_BASE_ADDR + 0x000B8000) -+#define LCDC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000BC000) -+#define SLCDC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000C0000) -+#define PWM4_BASE_ADDR (AIPS2_BASE_ADDR + 0x000C8000) -+#define GPIO1_BASE_ADDR (AIPS2_BASE_ADDR + 0x000CC000) -+#define GPIO2_BASE_ADDR (AIPS2_BASE_ADDR + 0x000D0000) -+#define SDMA_BASE_ADDR (AIPS2_BASE_ADDR + 0x000D4000) -+#define WDOG_BASE_ADDR (AIPS2_BASE_ADDR + 0x000DC000) -+#define PWM1_BASE_ADDR (AIPS2_BASE_ADDR + 0x000E0000) -+#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 CSI_BASE_ADDR (AIPS2_BASE_ADDR + 0x000F8000) -+#define DRYICE_BASE_ADDR (AIPS2_BASE_ADDR + 0x000FC000) -+ -+/* -+ * ROMP and ASIC -+ */ -+#define ROMP_BASE_ADDR UL(0x60000000) -+#define ROMP_BASE_ADDR_VIRT VA(0xFC300000) -+#define ROMP_SIZE SZ_1M -+ -+#define ASIC_BASE_ADDR UL(0x68000000) -+#define ASIC_BASE_ADDR_VIRT VA(0xFC400000) -+#define ASIC_SIZE SZ_1M -+#define AVIC_BASE_ADDR ASIC_BASE_ADDR -+#define AVIC_BASE_ADDR_VIRT ASIC_BASE_ADDR_VIRT -+#define AVIC_SIZE ASIC_SIZE -+ -+/* -+ * SDRAM, WEIM, M3IF, EMI controllers -+ */ -+#define X_MEMC_BASE_ADDR UL(0xB8000000) -+#define X_MEMC_BASE_ADDR_VIRT VA(0xFC520000) -+#define X_MEMC_SIZE SZ_64K -+ -+#define SDRAMC_BASE_ADDR (X_MEMC_BASE_ADDR + 0x1000) -+#define WEIM_BASE_ADDR (X_MEMC_BASE_ADDR + 0x2000) -+#define M3IF_BASE_ADDR (X_MEMC_BASE_ADDR + 0x3000) -+#define EMI_CTL_BASE_ADDR (X_MEMC_BASE_ADDR + 0x4000) -+ -+/* -+ * NFC controller -+ */ -+#define NFC_BASE_ADDR UL(0xBB000000) -+#define NFC_BASE_ADDR_VIRT VA(0xFC530000) -+#define NFC_SIZE SZ_8K -+ -+/* -+ * Memory regions and CS -+ */ -+#define CSD0_BASE_ADDR UL(0x80000000) -+#define CSD1_BASE_ADDR UL(0x90000000) -+ -+#define SDRAM_BASE_ADDR CSD0_BASE_ADDR -+ -+#define CS0_BASE_ADDR UL(0xA0000000) -+#define CS1_BASE_ADDR UL(0xA8000000) -+#define CS2_BASE_ADDR UL(0xB0000000) -+#define CS3_BASE_ADDR UL(0xB2000000) -+#define CS4_BASE_ADDR UL(0xB4000000) -+#define CS4_SIZE SZ_32M -+#define CS5_BASE_ADDR UL(0xB6000000) -+#define CS5_SIZE SZ_32M -+ -+/*! -+ * 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 -+ * and returning the virtual address. If the physical address is not mapped, -+ * it returns 0 -+ */ -+#define IO_ADDRESS(x) \ -+ VA((((x) >= AIPS1_BASE_ADDR) && ((x) < (AIPS1_BASE_ADDR + AIPS1_SIZE))) ? AIPS1_IO_ADDRESS(x): \ -+ (((x) >= SPBA0_BASE_ADDR) && ((x) < (SPBA0_BASE_ADDR + SPBA0_SIZE))) ? SPBA0_IO_ADDRESS(x): \ -+ (((x) >= AIPS2_BASE_ADDR) && ((x) < (AIPS2_BASE_ADDR + AIPS2_SIZE))) ? AIPS2_IO_ADDRESS(x): \ -+ (((x) >= ROMP_BASE_ADDR) && ((x) < (ROMP_BASE_ADDR + ROMP_SIZE))) ? ROMP_IO_ADDRESS(x): \ -+ (((x) >= ASIC_BASE_ADDR) && ((x) < (ASIC_BASE_ADDR + AVIC_SIZE))) ? ASIC_IO_ADDRESS(x): \ -+ (((x) >= IRAM_BASE_ADDR) && ((x) < (IRAM_BASE_ADDR + IRAM_SIZE))) ? IRAM_IO_ADDRESS(x): \ -+ (((x) >= X_MEMC_BASE_ADDR) && ((x) < (X_MEMC_BASE_ADDR + X_MEMC_SIZE))) ? X_MEMC_IO_ADDRESS(x): \ -+ (((x) >= NFC_BASE_ADDR) && ((x) < (NFC_BASE_ADDR + NFC_SIZE))) ? NFC_IO_ADDRESS(x): \ -+ 0) -+ -+#define MXC_VADDR_RANGE(v,n) \ -+ (((v)) >= n##_BASE_ADDR_VIRT) && \ -+ (((v)) < n##_BASE_ADDR_VIRT + n##_SIZE) ? \ -+ ((v)-n##_BASE_ADDR_VIRT + n##_BASE_ADDR) : -+ -+#define MXC_PHYS_ADDRESS(v) \ -+ UL(MXC_VADDR_RANGE(v,AIPS1) \ -+ MXC_VADDR_RANGE(v,AIPS2) \ -+ MXC_VADDR_RANGE(v,SPBA0) \ -+ MXC_VADDR_RANGE(v,ROMP) \ -+ MXC_VADDR_RANGE(v,ASIC) \ -+ MXC_VADDR_RANGE(v,IRAM) \ -+ MXC_VADDR_RANGE(v,X_MEMC) \ -+ MXC_VADDR_RANGE(v,NFC) \ -+ 0) -+ -+#define GPIO_BASE_ADDR(port) \ -+ ((port == 1 ? GPIO1_BASE_ADDR : \ -+ (port == 2 ? GPIO2_BASE_ADDR : \ -+ (port == 3 ? GPIO3_BASE_ADDR : \ -+ (port == 4 ? GPIO4_BASE_ADDR : 0))))) -+ -+/* -+ * define the address mapping macros: in physical address order -+ */ -+ -+#define AIPS1_IO_ADDRESS(x) \ -+ (((x) - AIPS1_BASE_ADDR) + AIPS1_BASE_ADDR_VIRT) -+ -+#define SPBA0_IO_ADDRESS(x) \ -+ (((x) - SPBA0_BASE_ADDR) + SPBA0_BASE_ADDR_VIRT) -+ -+#define AIPS2_IO_ADDRESS(x) \ -+ (((x) - AIPS2_BASE_ADDR) + AIPS2_BASE_ADDR_VIRT) -+ -+#define ROMP_IO_ADDRESS(x) \ -+ (((x) - ROMP_BASE_ADDR) + ROMP_BASE_ADDR_VIRT) -+ -+#define ASIC_IO_ADDRESS(x) \ -+ (((x) - ASIC_BASE_ADDR) + ASIC_BASE_ADDR_VIRT) -+ -+/* for entry-macro.S */ -+#define AVIC_IO_ADDRESS(x) ASIC_IO_ADDRESS(x) -+ -+#define IRAM_IO_ADDRESS(x) \ -+ (((x) - IRAM_BASE_ADDR) + IRAM_BASE_ADDR_VIRT) -+ -+#define X_MEMC_IO_ADDRESS(x) \ -+ (((x) - X_MEMC_BASE_ADDR) + X_MEMC_BASE_ADDR_VIRT) -+ -+#define NFC_IO_ADDRESS(x) \ -+ (((x) - NFC_BASE_ADDR) + NFC_BASE_ADDR_VIRT) -+ -+/* -+ * DMA request assignments -+ */ -+#define DMA_REQ_EXTREQ0 0 -+#define DMA_REQ_CCM 1 -+#define DMA_REQ_ATA_TX_END 2 -+#define DMA_REQ_ATA_TX 3 -+#define DMA_REQ_ATA_RX 4 -+#define DMA_REQ_CSPI2_RX 6 -+#define DMA_REQ_CSPI2_TX 7 -+#define DMA_REQ_CSPI1_RX 8 -+#define DMA_REQ_CSPI1_TX 9 -+#define DMA_REQ_UART3_RX 10 -+#define DMA_REQ_UART3_TX 11 -+#define DMA_REQ_UART4_RX 12 -+#define DMA_REQ_UART4_TX 13 -+#define DMA_REQ_EXTREQ1 14 -+#define DMA_REQ_EXTREQ2 15 -+#define DMA_REQ_UART2_RX 16 -+#define DMA_REQ_UART2_TX 17 -+#define DMA_REQ_UART1_RX 18 -+#define DMA_REQ_UART1_TX 19 -+#define DMA_REQ_SSI2_RX1 22 -+#define DMA_REQ_SSI2_TX1 23 -+#define DMA_REQ_SSI2_RX0 24 -+#define DMA_REQ_SSI2_TX0 25 -+#define DMA_REQ_SSI1_RX1 26 -+#define DMA_REQ_SSI1_TX1 27 -+#define DMA_REQ_SSI1_RX0 28 -+#define DMA_REQ_SSI1_TX0 29 -+#define DMA_REQ_NFC 30 -+#define DMA_REQ_ECT 31 -+#define DMA_REQ_ESAI_RX 32 -+#define DMA_REQ_ESAI_TX 33 -+#define DMA_REQ_CSPI3_RX 34 -+#define DMA_REQ_CSPI3_TX 35 -+#define DMA_REQ_SIM2_RX 36 -+#define DMA_REQ_SIM2_TX 37 -+#define DMA_REQ_SIM1_RX 38 -+#define DMA_REQ_SIM1_TX 39 -+#define DMA_REQ_TSC_GCQ 44 -+#define DMA_REQ_TSC_TCQ 45 -+#define DMA_REQ_UART5_RX 46 -+#define DMA_REQ_UART5_TX 47 -+ -+/* -+ * Interrupt numbers -+ */ -+#define MXC_INT_CSPI3 0 -+#define MXC_INT_GPT4 1 -+#define MXC_INT_OWIRE 2 -+#define MXC_INT_I2C 3 -+#define MXC_INT_I2C2 4 -+#define MXC_INT_UART4 5 -+#define MXC_INT_RTIC 6 -+#define MXC_INT_ESAI 7 -+#define MXC_INT_SDHC2 8 -+#define MXC_INT_SDHC1 9 -+#define MXC_INT_I2C3 10 -+#define MXC_INT_SSI2 11 -+#define MXC_INT_SSI1 12 -+#define MXC_INT_CSPI2 13 -+#define MXC_INT_CSPI1 14 -+#define MXC_INT_ATA 15 -+#define MXC_INT_GPIO3 16 -+#define MXC_INT_CSI 17 -+#define MXC_INT_UART3 18 -+#define MXC_INT_IIM 19 -+#define MXC_INT_SIM1 20 -+#define MXC_INT_SIM2 21 -+#define MXC_INT_RNGD 22 -+#define MXC_INT_GPIO4 23 -+#define MXC_INT_KPP 24 -+#define MXC_INT_DRYICE_RTC 25 -+#define MXC_INT_PWM 26 -+#define MXC_INT_EPIT2 27 -+#define MXC_INT_EPIT1 28 -+#define MXC_INT_GPT3 29 -+#define MXC_INT_POWER_FAIL 30 -+#define MXC_INT_CRM 31 -+#define MXC_INT_UART2 32 -+#define MXC_INT_NANDFC 33 -+#define MXC_INT_SDMA 34 -+#define MXC_INT_USB_HTG 35 -+#define MXC_INT_PWM2 36 -+#define MXC_INT_USB_OTG 37 -+#define MXC_INT_SLCDC 38 -+#define MXC_INT_LCDC 39 -+#define MXC_INT_UART5 40 -+#define MXC_INT_PWM3 41 -+#define MXC_INT_PWM4 42 -+#define MXC_INT_CAN1 43 -+#define MXC_INT_CAN2 44 -+#define MXC_INT_UART1 45 -+#define MXC_INT_TSC 46 -+#define MXC_INT_ECT 48 -+#define MXC_INT_SCC_SCM 49 -+#define MXC_INT_SCC_SMN 50 -+#define MXC_INT_GPIO2 51 -+#define MXC_INT_GPIO1 52 -+#define MXC_INT_GPT2 53 -+#define MXC_INT_GPT1 54 -+#define MXC_INT_WDOG 55 -+#define MXC_INT_DRYICE 56 -+#define MXC_INT_FEC 57 -+#define MXC_INT_EXT_INT5 58 -+#define MXC_INT_EXT_INT4 59 -+#define MXC_INT_EXT_INT3 60 -+#define MXC_INT_EXT_INT2 61 -+#define MXC_INT_EXT_INT1 62 -+#define MXC_INT_EXT_INT0 63 -+ -+#define MXC_INT_GPT MXC_INT_GPT1 -+ -+/* silicon revisions specific to i.MX25 */ -+#define CHIP_REV_1_0 0x00 -+#define CHIP_REV_1_1 0x01 -+ -+/* gpio and gpio based interrupt handling */ -+#define GPIO_DR 0x00 -+#define GPIO_GDIR 0x04 -+#define GPIO_PSR 0x08 -+#define GPIO_ICR1 0x0C -+#define GPIO_ICR2 0x10 -+#define GPIO_IMR 0x14 -+#define GPIO_ISR 0x18 -+#define GPIO_INT_LOW_LEV 0x0 -+#define GPIO_INT_HIGH_LEV 0x1 -+#define GPIO_INT_RISE_EDGE 0x2 -+#define GPIO_INT_FALL_EDGE 0x3 -+#define GPIO_INT_NONE 0x4 -+ -+/* Mandatory defines used globally */ -+ -+/* this CPU supports up to 96 GPIOs */ -+#define ARCH_NR_GPIOS 128 -+ -+#define MXC_TIMER_GPT1 1 -+#define MXC_TIMER_GPT2 2 -+#define MXC_TIMER_GPT3 3 -+#define MXC_TIMER_GPT4 4 -+ -+/*! -+ * NFMS bit in RCSR register for pagesize of nandflash -+ */ -+#define NFMS_REG IO_ADDRESS(CCM_BASE_ADDR + 0x28) -+#define NFMS_NF_DWIDTH 14 -+#define NFMS_NF_PG_SZ 8 -+ -+#if !defined(__ASSEMBLY__) && !defined(__MXC_BOOT_UNCOMPRESS) -+#include -+ -+extern int mx25_revision(void); -+ -+#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 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 - * and returning the virtual address. If the physical address is not mapped, -- * it returns 0xDEADBEEF -+ * it returns 0 - */ - #define IO_ADDRESS(x) \ - (void __force __iomem *) \ -@@ -88,7 +88,7 @@ - ((x >= SAHB1_BASE_ADDR) && (x < (SAHB1_BASE_ADDR + SAHB1_SIZE))) ? \ - SAHB1_IO_ADDRESS(x) : \ - ((x >= X_MEMC_BASE_ADDR) && (x < (X_MEMC_BASE_ADDR + X_MEMC_SIZE))) ? \ -- X_MEMC_IO_ADDRESS(x) : 0xDEADBEEF) -+ X_MEMC_IO_ADDRESS(x) : 0) - - /* 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 18:02:12.000000000 +0200 -@@ -27,6 +27,7 @@ - #define MXC_CPU_MX1 1 - #define MXC_CPU_MX21 21 - #define MXC_CPU_MX27 27 -+#define MXC_CPU_MX25 25 - #define MXC_CPU_MX31 31 - #define MXC_CPU_MX35 35 - -@@ -70,6 +71,18 @@ extern unsigned int __mxc_cpu_type; - # define cpu_is_mx27() (0) - #endif - -+#ifdef CONFIG_MACH_MX25 -+# ifdef mxc_cpu_type -+# undef mxc_cpu_type -+# define mxc_cpu_type __mxc_cpu_type -+# else -+# define mxc_cpu_type MXC_CPU_MX25 -+# endif -+# define cpu_is_mx25() (mxc_cpu_type == MXC_CPU_MX25) -+#else -+# define cpu_is_mx25() (0) -+#endif -+ - #ifdef CONFIG_ARCH_MX31 - # ifdef mxc_cpu_type - # undef mxc_cpu_type -@@ -101,6 +114,6 @@ extern unsigned int __mxc_cpu_type; - #endif - - #define cpu_is_mx3() (cpu_is_mx31() || cpu_is_mx35()) --#define cpu_is_mx2() (cpu_is_mx21() || cpu_is_mx27()) -+#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 18:02:13.000000000 +0200 -@@ -0,0 +1,504 @@ -+ -+/* -+ * Copyright 2004-2008 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_SDMA_H__ -+#define __ASM_ARCH_MXC_SDMA_H__ -+ -+/*! -+ * @defgroup SDMA Smart Direct Memory Access (SDMA) Driver -+ */ -+ -+/*! -+ * @file arch-mxc/sdma.h -+ * -+ * @brief This file contains the SDMA API declarations. -+ * -+ * SDMA is responsible on moving data between peripherals and memories (MCU, EMI and DSP). -+ * -+ * @ingroup SDMA -+ */ -+ -+#include -+#include -+#include -+#include -+ -+/*! -+ * This defines maximum DMA address -+ */ -+#define MAX_DMA_ADDRESS 0xffffffff -+ -+/*! -+ * This defines maximum number of DMA channels -+ */ -+#ifdef CONFIG_MXC_SDMA_API -+#define MAX_DMA_CHANNELS 32 -+#define MAX_BD_NUMBER 16 -+#define MXC_SDMA_DEFAULT_PRIORITY 1 -+#define MXC_SDMA_MIN_PRIORITY 1 -+#define MXC_SDMA_MAX_PRIORITY 7 -+#else -+#define MAX_DMA_CHANNELS 0 -+#endif -+ -+#define MXC_FIFO_MEM_DEST_FIXED 0x1 -+#define MXC_FIFO_MEM_SRC_FIXED 0x2 -+/*! -+ * This enumerates transfer types -+ */ -+typedef enum { -+ emi_2_per = 0, /*!< EMI memory to peripheral */ -+ emi_2_int, /*!< EMI memory to internal RAM */ -+ emi_2_emi, /*!< EMI memory to EMI memory */ -+ emi_2_dsp, /*!< EMI memory to DSP memory */ -+ per_2_int, /*!< Peripheral to internal RAM */ -+ per_2_emi, /*!< Peripheral to internal EMI memory */ -+ per_2_dsp, /*!< Peripheral to DSP memory */ -+ per_2_per, /*!< Peripheral to Peripheral */ -+ int_2_per, /*!< Internal RAM to peripheral */ -+ int_2_int, /*!< Internal RAM to Internal RAM */ -+ int_2_emi, /*!< Internal RAM to EMI memory */ -+ int_2_dsp, /*!< Internal RAM to DSP memory */ -+ dsp_2_per, /*!< DSP memory to peripheral */ -+ dsp_2_int, /*!< DSP memory to internal RAM */ -+ dsp_2_emi, /*!< DSP memory to EMI memory */ -+ dsp_2_dsp, /*!< DSP memory to DSP memory */ -+ emi_2_dsp_loop, /*!< EMI memory to DSP memory loopback */ -+ dsp_2_emi_loop, /*!< DSP memory to EMI memory loopback */ -+ dvfs_pll, /*!< DVFS script with PLL change */ -+ dvfs_pdr /*!< DVFS script without PLL change */ -+} sdma_transferT; -+ -+/*! -+ * This enumerates peripheral types -+ */ -+typedef enum { -+ SSI, /*!< MCU domain SSI */ -+ SSI_SP, /*!< Shared SSI */ -+ MMC, /*!< MMC */ -+ SDHC, /*!< SDHC */ -+ UART, /*!< MCU domain UART */ -+ UART_SP, /*!< Shared UART */ -+ FIRI, /*!< FIRI */ -+ CSPI, /*!< MCU domain CSPI */ -+ CSPI_SP, /*!< Shared CSPI */ -+ SIM, /*!< SIM */ -+ ATA, /*!< ATA */ -+ CCM, /*!< CCM */ -+ EXT, /*!< External peripheral */ -+ MSHC, /*!< Memory Stick Host Controller */ -+ MSHC_SP, /*!< Shared Memory Stick Host Controller */ -+ DSP, /*!< DSP */ -+ MEMORY, /*!< Memory */ -+ FIFO_MEMORY, /*!< FIFO type Memory */ -+ SPDIF, /*!< SPDIF */ -+ IPU_MEMORY, /*!< IPU Memory */ -+ ASRC, /*!< ASRC */ -+ ESAI, /*!< ESAI */ -+} sdma_periphT; -+ -+#ifndef TRANSFER_32BIT -+/*! -+ * This defines SDMA access data size -+ */ -+#define TRANSFER_32BIT 0x00 -+#define TRANSFER_8BIT 0x01 -+#define TRANSFER_16BIT 0x02 -+#define TRANSFER_24BIT 0x03 -+ -+#endif -+ -+/*! -+ * This defines maximum device name length passed during mxc_request_dma(). -+ */ -+#define MAX_DEVNAME_LENGTH 32 -+ -+/*! -+ * This defines SDMA interrupt callback function prototype. -+ */ -+typedef void (*dma_callback_t) (void *arg); -+ -+/*! -+ * Structure containing sdma channel parameters. -+ */ -+typedef struct { -+ __u32 watermark_level; /*!< Lower/upper threshold that -+ * triggers SDMA event -+ */ -+ __u32 per_address; /*!< Peripheral source/destination -+ * physical address -+ */ -+ sdma_periphT peripheral_type; /*!< Peripheral type */ -+ sdma_transferT transfer_type; /*!< Transfer type */ -+ int event_id; /*!< Event number, -+ * needed by all channels -+ * that started by peripherals dma -+ * request (per_2_*,*_2_per) -+ * Not used for memory and DSP -+ * transfers. -+ */ -+ int event_id2; /*!< Second event number, -+ * used in ATA scripts only. -+ */ -+ int bd_number; /*!< Buffer descriptors number. -+ * If not set, single buffer -+ * descriptor will be used. -+ */ -+ dma_callback_t callback; /*! callback function */ -+ void *arg; /*! callback argument */ -+ unsigned long word_size:8; /*!< SDMA data access word size */ -+} dma_channel_params; -+ -+/*! -+ * Structure containing sdma request parameters. -+ */ -+typedef struct { -+ /*! physical source memory address */ -+ __u8 *sourceAddr; -+ /*! physical destination memory address */ -+ __u8 *destAddr; -+ /*! amount of data to transfer, -+ * updated during mxc_dma_get_config -+ */ -+ __u16 count; -+ /*!< DONE bit of the buffer descriptor, -+ * updated during mxc_dma_get_config -+ * 0 - means the BD is done and closed by SDMA -+ * 1 - means the BD is still being processed by SDMA -+ */ -+ int bd_done; -+ /*!< CONT bit of the buffer descriptor, -+ * set it if full multi-buffer descriptor mechanism -+ * required. -+ */ -+ int bd_cont; -+ /*!< ERROR bit of the buffer descriptor, -+ * updated during mxc_dma_get_config. -+ * If it is set - there was an error during BD processing. -+ */ -+ int bd_error; -+} dma_request_t; -+ -+/*! -+ * Structure containing sdma request parameters. -+ */ -+typedef struct { -+ /*! address of ap_2_ap script */ -+ int mxc_sdma_ap_2_ap_addr; -+ /*! address of ap_2_bp script */ -+ int mxc_sdma_ap_2_bp_addr; -+ /*! address of ap_2_ap_fixed script */ -+ int mxc_sdma_ap_2_ap_fixed_addr; -+ /*! address of bp_2_ap script */ -+ int mxc_sdma_bp_2_ap_addr; -+ /*! address of loopback_on_dsp_side script */ -+ int mxc_sdma_loopback_on_dsp_side_addr; -+ /*! address of mcu_interrupt_only script */ -+ int mxc_sdma_mcu_interrupt_only_addr; -+ -+ /*! address of firi_2_per script */ -+ int mxc_sdma_firi_2_per_addr; -+ /*! address of firi_2_mcu script */ -+ int mxc_sdma_firi_2_mcu_addr; -+ /*! address of per_2_firi script */ -+ int mxc_sdma_per_2_firi_addr; -+ /*! address of mcu_2_firi script */ -+ int mxc_sdma_mcu_2_firi_addr; -+ -+ /*! address of uart_2_per script */ -+ int mxc_sdma_uart_2_per_addr; -+ /*! address of uart_2_mcu script */ -+ int mxc_sdma_uart_2_mcu_addr; -+ /*! address of per_2_app script */ -+ int mxc_sdma_per_2_app_addr; -+ /*! address of mcu_2_app script */ -+ int mxc_sdma_mcu_2_app_addr; -+ /*! address of per_2_per script */ -+ int mxc_sdma_per_2_per_addr; -+ -+ /*! address of uartsh_2_per script */ -+ int mxc_sdma_uartsh_2_per_addr; -+ /*! address of uartsh_2_mcu script */ -+ int mxc_sdma_uartsh_2_mcu_addr; -+ /*! address of per_2_shp script */ -+ int mxc_sdma_per_2_shp_addr; -+ /*! address of mcu_2_shp script */ -+ int mxc_sdma_mcu_2_shp_addr; -+ -+ /*! address of ata_2_mcu script */ -+ int mxc_sdma_ata_2_mcu_addr; -+ /*! address of mcu_2_ata script */ -+ int mxc_sdma_mcu_2_ata_addr; -+ -+ /*! address of app_2_per script */ -+ int mxc_sdma_app_2_per_addr; -+ /*! address of app_2_mcu script */ -+ int mxc_sdma_app_2_mcu_addr; -+ /*! address of shp_2_per script */ -+ int mxc_sdma_shp_2_per_addr; -+ /*! address of shp_2_mcu script */ -+ int mxc_sdma_shp_2_mcu_addr; -+ -+ /*! address of mshc_2_mcu script */ -+ int mxc_sdma_mshc_2_mcu_addr; -+ /*! address of mcu_2_mshc script */ -+ int mxc_sdma_mcu_2_mshc_addr; -+ -+ /*! address of spdif_2_mcu script */ -+ int mxc_sdma_spdif_2_mcu_addr; -+ /*! address of mcu_2_spdif script */ -+ int mxc_sdma_mcu_2_spdif_addr; -+ -+ /*! address of asrc_2_mcu script */ -+ int mxc_sdma_asrc_2_mcu_addr; -+ -+ /*! address of ext_mem_2_ipu script */ -+ int mxc_sdma_ext_mem_2_ipu_addr; -+ -+ /*! address of descrambler script */ -+ int mxc_sdma_descrambler_addr; -+ -+ /*! address of dptc_dvfs script */ -+ int mxc_sdma_dptc_dvfs_addr; -+ -+ int mxc_sdma_utra_addr; -+ -+ /*! address where ram code starts */ -+ int mxc_sdma_ram_code_start_addr; -+ /*! size of the ram code */ -+ int mxc_sdma_ram_code_size; -+ /*! RAM image address */ -+ unsigned short *mxc_sdma_start_addr; -+} sdma_script_start_addrs; -+ -+/*! Structure to store the initialized dma_channel parameters */ -+typedef struct mxc_sdma_channel_params { -+ /*! Channel params */ -+ dma_channel_params chnl_params; -+ /*! Channel type (static channel number or dynamic channel) */ -+ unsigned int channel_num; -+ /*! Channel priority [0x1(lowest) - 0x7(highest)] */ -+ unsigned int chnl_priority; -+} mxc_sdma_channel_params_t; -+ -+/*! Private SDMA data structure */ -+typedef struct mxc_dma_channel_private { -+ /*! ID of the buffer that was processed */ -+ unsigned int buf_tail; -+ /*! Tasklet for the channel */ -+ struct tasklet_struct chnl_tasklet; -+ /*! Flag indicates if interrupt is required after every BD transfer */ -+ int intr_after_every_bd; -+} mxc_dma_channel_private_t; -+ -+/*! -+ * Setup channel according to parameters. -+ * Must be called once after mxc_request_dma() -+ * -+ * @param channel channel number -+ * @param p channel parameters pointer -+ * @return 0 on success, error code on fail -+ */ -+int mxc_dma_setup_channel(int channel, dma_channel_params * p); -+ -+/*! -+ * Setup the channel priority. This can be used to change the default priority -+ * for the channel. -+ * -+ * @param channel channel number -+ * @param priority priority to be set for the channel -+ * -+ * @return 0 on success, error code on failure -+ */ -+int mxc_dma_set_channel_priority(unsigned int channel, unsigned int priority); -+ -+/*! -+ * Allocates dma channel. -+ * If channel's value is 0, then the function allocates a free channel -+ * dynamically and sets its value to channel. -+ * Else allocates requested channel if it is free. -+ * If the channel is busy or no free channels (in dynamic allocation) -EBUSY returned. -+ * -+ * @param channel pointer to channel number -+ * @param devicename device name -+ * @return 0 on success, error code on fail -+ */ -+int mxc_request_dma(int *channel, const char *devicename); -+ -+/*! -+ * Configures request parameters. Can be called multiple times after -+ * mxc_request_dma() and mxc_dma_setup_channel(). -+ * -+ * -+ * @param channel channel number -+ * @param p request parameters pointer -+ * @param bd_index index of buffer descriptor to set -+ * @return 0 on success, error code on fail -+ */ -+/* int mxc_dma_set_config(int channel, dma_request_t *p, int bd_index); */ -+int mxc_dma_set_config(int channel, dma_request_t * p, int bd_index); -+ -+/*! -+ * Returns request parameters. -+ * -+ * @param channel channel number -+ * @param p request parameters pointer -+ * @param bd_index index of buffer descriptor to get -+ * @return 0 on success, error code on fail -+ */ -+/* int mxc_dma_get_config(int channel, dma_request_t *p, int bd_index); */ -+int mxc_dma_get_config(int channel, dma_request_t * p, int bd_index); -+ -+/*! -+ * This function is used by MXC IPC's write_ex2. It passes the a pointer to the -+ * data control structure to iapi_write_ipcv2() -+ * -+ * @param channel SDMA channel number -+ * @param ctrl_ptr Data Control structure pointer -+ */ -+int mxc_sdma_write_ipcv2(int channel, void *ctrl_ptr); -+ -+/*! -+ * This function is used by MXC IPC's read_ex2. It passes the a pointer to the -+ * data control structure to iapi_read_ipcv2() -+ * -+ * @param channel SDMA channel number -+ * @param ctrl_ptr Data Control structure pointer -+ */ -+int mxc_sdma_read_ipcv2(int channel, void *ctrl_ptr); -+ -+/*! -+ * Starts dma channel. -+ * -+ * @param channel channel number -+ */ -+int mxc_dma_start(int channel); -+ -+/*! -+ * Stops dma channel. -+ * -+ * @param channel channel number -+ */ -+int mxc_dma_stop(int channel); -+ -+/*! -+ * Frees dma channel. -+ * -+ * @param channel channel number -+ */ -+void mxc_free_dma(int channel); -+ -+/*! -+ * Sets callback function. Used with standard dma api -+ * for supporting interrupts -+ * -+ * @param channel channel number -+ * @param callback callback function pointer -+ * @param arg argument for callback function -+ */ -+void mxc_dma_set_callback(int channel, dma_callback_t callback, void *arg); -+ -+/*! -+ * Allocates uncachable buffer. Uses hash table. -+ * -+ * @param size size of allocated buffer -+ * @return pointer to buffer -+ */ -+void *sdma_malloc(size_t size); -+ -+#ifdef CONFIG_SDMA_IRAM -+/*! -+ * Allocates uncachable buffer from IRAM.. -+ * -+ * @param size size of allocated buffer -+ * @return pointer to buffer -+ */ -+void *sdma_iram_malloc(size_t size); -+#endif /*CONFIG_SDMA_IRAM */ -+ -+/*! -+ * Frees uncachable buffer. Uses hash table. -+ */ -+void sdma_free(void *buf); -+ -+/*! -+ * Converts virtual to physical address. Uses hash table. -+ * -+ * @param buf virtual address pointer -+ * @return physical address value -+ */ -+unsigned long sdma_virt_to_phys(void *buf); -+ -+/*! -+ * Converts physical to virtual address. Uses hash table. -+ * -+ * @param buf physical address value -+ * @return virtual address pointer -+ */ -+void *sdma_phys_to_virt(unsigned long buf); -+ -+/*! -+ * Configures the BD_INTR bit on a buffer descriptor parameters. -+ * -+ * -+ * @param channel channel number -+ * @param bd_index index of buffer descriptor to set -+ * @param bd_intr flag to set or clear the BD_INTR bit -+ */ -+void mxc_dma_set_bd_intr(int channel, int bd_index, int bd_intr); -+ -+/*! -+ * Gets the BD_INTR bit on a buffer descriptor. -+ * -+ * -+ * @param channel channel number -+ * @param bd_index index of buffer descriptor to set -+ * -+ * @return returns the BD_INTR bit status -+ */ -+int mxc_dma_get_bd_intr(int channel, int bd_index); -+ -+/*! -+ * Stop the current transfer -+ * -+ * @param channel channel number -+ * @param buffer_number number of buffers (beginning with 0), -+ * whose done bits should be reset to 0 -+ */ -+int mxc_dma_reset(int channel, int buffer_number); -+ -+/*! -+ * This functions Returns the SDMA paramaters associated for a module -+ * -+ * @param channel_id the ID of the module requesting DMA -+ * @return returns the sdma parameters structure for the device -+ */ -+mxc_sdma_channel_params_t *mxc_sdma_get_channel_params(mxc_dma_device_t -+ channel_id); -+ -+/*! -+ * This functions marks the SDMA channels that are statically allocated -+ * -+ * @param chnl the channel array used to store channel information -+ */ -+void mxc_get_static_channels(mxc_dma_channel_t * chnl); -+ -+/*! -+ * Initializes SDMA driver -+ */ -+int __init sdma_init(void); -+ -+#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 18:02:13.000000000 +0200 -@@ -0,0 +1,66 @@ -+ -+/* -+ * Copyright 2004-2008 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 -+ */ -+ -+/*! -+ * @defgroup SPBA Shared Peripheral Bus Arbiter (SPBA) -+ * @ingroup MSL_MX31 MSL_MX35 MSL_MX37 MSL_MX51 MSL_MXC91321 -+ */ -+ -+/*! -+ * @file arch-mxc/spba.h -+ * @brief This file contains the Shared Peripheral Bus Arbiter (spba) API. -+ * -+ * @ingroup SPBA -+ */ -+ -+#ifndef __ASM_ARCH_MXC_SPBA_H__ -+#define __ASM_ARCH_MXC_SPBA_H__ -+ -+#ifdef __KERNEL__ -+ -+#define MXC_SPBA_RAR_MASK 0x7 -+ -+/*! -+ * Defines three SPBA masters: A - ARM, C - SDMA (no master B for MX31) -+ */ -+enum spba_masters { -+ SPBA_MASTER_A = 1, -+ SPBA_MASTER_B = 2, -+ SPBA_MASTER_C = 4, -+}; -+ -+/*! -+ * This function allows the three masters (A, B, C) to take ownership of a -+ * shared peripheral. -+ * -+ * @param mod specified module as defined in \b enum \b #spba_module -+ * @param master one of more (or-ed together) masters as defined in \b enum \b #spba_masters -+ * -+ * @return 0 if successful; -1 otherwise. -+ */ -+int spba_take_ownership(int mod, int master); -+ -+/*! -+ * This function releases the ownership for a shared peripheral. -+ * -+ * @param mod specified module as defined in \b enum \b #spba_module -+ * @param master one of more (or-ed together) masters as defined in \b enum \b #spba_masters -+ * -+ * @return 0 if successful; -1 otherwise. -+ */ -+int spba_rel_ownership(int mod, int master); -+ -+#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 18:02:12.000000000 +0200 -@@ -23,7 +23,11 @@ - #if defined CONFIG_ARCH_MX1 - #define CLOCK_TICK_RATE 16000000 - #elif defined CONFIG_ARCH_MX2 -+#ifndef CONFIG_MACH_MX25 - #define CLOCK_TICK_RATE 13300000 -+#else -+#define CLOCK_TICK_RATE 12000000 -+#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 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)); - - if (pin < 16) { -+#ifndef CONFIG_MACH_MX25 - tmp = __raw_readl(VA_GPIO_BASE + MXC_OCR1(port)); - tmp &= ~(3 << (pin * 2)); - tmp |= (ocr << (pin * 2)); - __raw_writel(tmp, VA_GPIO_BASE + MXC_OCR1(port)); -- -+#endif - tmp = __raw_readl(VA_GPIO_BASE + MXC_ICONFA1(port)); - tmp &= ~(3 << (pin * 2)); - tmp |= ((gpio_mode >> GPIO_AOUT_SHIFT) & 3) << (pin * 2); -@@ -90,12 +91,12 @@ void mxc_gpio_mode(int gpio_mode) - __raw_writel(tmp, VA_GPIO_BASE + MXC_ICONFB1(port)); - } else { - pin -= 16; -- -+#ifndef CONFIG_MACH_MX25 - tmp = __raw_readl(VA_GPIO_BASE + MXC_OCR2(port)); - tmp &= ~(3 << (pin * 2)); - tmp |= (ocr << (pin * 2)); - __raw_writel(tmp, VA_GPIO_BASE + MXC_OCR2(port)); -- -+#endif - 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 18:02:02.000000000 +0200 -@@ -31,7 +31,24 @@ - - #define IOMUX_BASE IO_ADDRESS(IOMUXC_BASE_ADDR) - --static unsigned long iomux_v3_pad_alloc_map[0x200 / BITS_PER_LONG]; -+#ifdef CONFIG_MACH_MX25 -+#define NUM_PADS 0x228 -+#else -+#define NUM_PADS 0x200 -+#endif -+ -+static unsigned long iomux_v3_pad_alloc_map[NUM_PADS / BITS_PER_LONG]; -+ -+static inline int mxc_iomux_v3_pad_offset(struct pad_desc *pad) -+{ -+ int pad_ofs; -+ if (cpu_is_mx25()) -+ pad_ofs = pad->mux_ctrl_ofs; -+ else -+ pad_ofs = pad->pad_ctrl_ofs; -+ BUG_ON((pad_ofs >> 7) >= ARRAY_SIZE(iomux_v3_pad_alloc_map)); -+ return pad_ofs; -+} - - /* - * setups a single pin: -@@ -40,7 +57,7 @@ static unsigned long iomux_v3_pad_alloc_ - */ - int mxc_iomux_v3_setup_pad(struct pad_desc *pad) - { -- unsigned int pad_ofs = pad->pad_ctrl_ofs; -+ unsigned int pad_ofs = mxc_iomux_v3_pad_offset(pad); - - if (test_and_set_bit(pad_ofs >> 2, iomux_v3_pad_alloc_map)) - return -EBUSY; -@@ -65,8 +82,10 @@ int mxc_iomux_v3_setup_multiple_pads(str - - for (i = 0; i < count; i++) { - ret = mxc_iomux_v3_setup_pad(p); -- if (ret) -+ if (ret) { -+ printk(KERN_ERR "Failed to setup PAD[%d]: %d\n", i, ret); - goto setup_error; -+ } - p++; - } - return 0; -@@ -79,7 +98,7 @@ EXPORT_SYMBOL(mxc_iomux_v3_setup_multipl - - void mxc_iomux_v3_release_pad(struct pad_desc *pad) - { -- unsigned int pad_ofs = pad->pad_ctrl_ofs; -+ unsigned int pad_ofs = mxc_iomux_v3_pad_offset(pad); - - 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 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; - -- if (cpu_is_mx27() || cpu_is_mx3()) { -+ if (cpu_is_mx27() || cpu_is_mx3() || cpu_is_mx25()) { - 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 18:02:03.000000000 +0200 -@@ -0,0 +1,143 @@ -+/* -+ * Copyright 2004-2008 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 -+ */ -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+/*! -+ * @file plat-mxc/spba.c -+ * -+ * @brief This file contains the SPBA API implementation details. -+ * -+ * @ingroup SPBA -+ */ -+ -+static DEFINE_SPINLOCK(spba_lock); -+ -+#define SPBA_MASTER_MIN 1 -+#define SPBA_MASTER_MAX 7 -+ -+/*! -+ * the base addresses for the SPBA modules -+ */ -+static unsigned long spba_base = (unsigned long)IO_ADDRESS(SPBA_CTRL_BASE_ADDR); -+ -+/*! -+ * SPBA clock -+ */ -+static struct clk *spba_clk; -+/*! -+ * This function allows the three masters (A, B, C) to take ownership of a -+ * shared peripheral. -+ * -+ * @param mod specified module as defined in \b enum \b #spba_module -+ * @param master one of more (or-ed together) masters as defined in \b enum \b #spba_masters -+ * -+ * @return 0 if successful; a negative errno value otherwise. -+ */ -+int spba_take_ownership(int mod, int master) -+{ -+ unsigned long spba_flags; -+ int rtn_val = -EIO; -+ -+ if (master < SPBA_MASTER_MIN || master > SPBA_MASTER_MAX) { -+ printk("%s() invalid master %d\n", __FUNCTION__, master); -+ return -EINVAL; -+ } -+ -+ if (spba_clk == NULL) { -+ spba_clk = clk_get(NULL, "spba"); -+ if (IS_ERR(spba_clk)) { -+ int ret = PTR_ERR(spba_clk); -+ -+ spba_clk = NULL; -+ return ret; -+ } -+ } -+ clk_enable(spba_clk); -+ -+ spin_lock_irqsave(&spba_lock, spba_flags); -+ __raw_writel(master, spba_base + mod); -+ -+ if ((__raw_readl(spba_base + mod) & MXC_SPBA_RAR_MASK) == master) { -+ rtn_val = 0; -+ } -+ -+ spin_unlock_irqrestore(&spba_lock, spba_flags); -+ -+ clk_disable(spba_clk); -+ return rtn_val; -+} -+ -+/*! -+ * This function releases the ownership for a shared peripheral. -+ * -+ * @param mod specified module as defined in \b enum \b #spba_module -+ * @param master one of more (or-ed together) masters as defined in \b enum \b #spba_masters -+ * -+ * @return 0 if successful; a negativ errno value otherwise. -+ */ -+int spba_rel_ownership(int mod, int master) -+{ -+ unsigned long spba_flags; -+ volatile unsigned long rar; -+ -+ if (master < SPBA_MASTER_MIN || master > SPBA_MASTER_MAX) { -+ printk("%s() invalid master %d\n", __FUNCTION__, master); -+ return -EINVAL; -+ } -+ -+ if (spba_clk == NULL) { -+ spba_clk = clk_get(NULL, "spba"); -+ if (IS_ERR(spba_clk)) { -+ int ret = PTR_ERR(spba_clk); -+ spba_clk = NULL; -+ return ret; -+ } -+ } -+ clk_enable(spba_clk); -+ -+ if ((__raw_readl(spba_base + mod) & master) == 0) { -+ clk_disable(spba_clk); -+ return -EBUSY; /* does not own it */ -+ } -+ -+ spin_lock_irqsave(&spba_lock, spba_flags); -+ -+ /* Since only the last 3 bits are writeable, doesn't need to mask off -+ bits 31-3 */ -+ rar = __raw_readl(spba_base + mod) & (~master); -+ __raw_writel(rar, spba_base + mod); -+ -+ if ((__raw_readl(spba_base + mod) & master) != 0) { -+ spin_unlock_irqrestore(&spba_lock, spba_flags); -+ clk_disable(spba_clk); -+ return -EIO; -+ } -+ spin_unlock_irqrestore(&spba_lock, spba_flags); -+ -+ clk_disable(spba_clk); -+ return 0; -+} -+ -+EXPORT_SYMBOL(spba_take_ownership); -+EXPORT_SYMBOL(spba_rel_ownership); -+ -+MODULE_AUTHOR("Freescale Semiconductor, Inc."); -+MODULE_DESCRIPTION("SPBA"); -+MODULE_LICENSE("GPL"); -diff -urNp linux-2.6.30-rc4/arch/arm/plat-mxc/system.c linux-2.6.30-rc4-karo/arch/arm/plat-mxc/system.c ---- linux-2.6.30-rc4/arch/arm/plat-mxc/system.c 2009-05-13 09:46:19.000000000 +0200 -+++ linux-2.6.30-rc4-karo/arch/arm/plat-mxc/system.c 2009-06-08 12:48:23.000000000 +0200 -@@ -21,6 +21,7 @@ - */ - - #include -+#include - #include - #include - #include -@@ -38,18 +39,15 @@ - #define WDOG_WCR_ENABLE (1 << 2) - #endif - -+static struct clk *mxc_wdt_clk; -+ - /* - * Reset the system. It is called by machine_restart(). - */ - 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); -- } -+ if (mxc_wdt_clk) -+ clk_enable(mxc_wdt_clk); - - /* Assert SRS signal */ - __raw_writew(WDOG_WCR_ENABLE, WDOG_WCR_REG); -@@ -65,3 +63,20 @@ 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) -+{ -+ if (cpu_is_mx1()) -+ return 0; -+ -+ mxc_wdt_clk = clk_get_sys("imx-wdt.0", NULL); -+ if (IS_ERR(mxc_wdt_clk)) { -+ int ret = PTR_ERR(mxc_wdt_clk); -+ -+ printk(KERN_ERR "%s: Failed to get imx-wdt.0 clk: %d\n", __FUNCTION__, ret); -+ mxc_wdt_clk = NULL; -+ return ret; -+ } -+ return 0; -+} -+arch_initcall(mxc_wdt_init); -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 18:02:02.000000000 +0200 -@@ -66,7 +66,7 @@ static inline void gpt_irq_disable(void) - { - unsigned int tmp; - -- if (cpu_is_mx3()) -+ if (cpu_is_mx3() || cpu_is_mx25()) - __raw_writel(0, timer_base + MX3_IR); - else { - tmp = __raw_readl(timer_base + MXC_TCTL); -@@ -76,7 +76,7 @@ static inline void gpt_irq_disable(void) - - static inline void gpt_irq_enable(void) - { -- if (cpu_is_mx3()) -+ if (cpu_is_mx3() || cpu_is_mx25()) - __raw_writel(1<<0, timer_base + MX3_IR); - else { - __raw_writel(__raw_readl(timer_base + MXC_TCTL) | MX1_2_TCTL_IRQEN, -@@ -88,9 +88,9 @@ static void gpt_irq_acknowledge(void) - { - if (cpu_is_mx1()) - __raw_writel(0, timer_base + MX1_2_TSTAT); -- if (cpu_is_mx2()) -+ if (cpu_is_mx2() && !cpu_is_mx25()) - __raw_writel(MX2_TSTAT_CAPT | MX2_TSTAT_COMP, timer_base + MX1_2_TSTAT); -- if (cpu_is_mx3()) -+ if (cpu_is_mx3() || cpu_is_mx25()) - __raw_writel(MX3_TSTAT_OF1, timer_base + MX3_TSTAT); - } - -@@ -117,7 +117,7 @@ static int __init mxc_clocksource_init(s - { - unsigned int c = clk_get_rate(timer_clk); - -- if (cpu_is_mx3()) -+ if (cpu_is_mx3() || cpu_is_mx25()) - clocksource_mxc.read = mx3_get_cycles; - - clocksource_mxc.mult = clocksource_hz2mult(c, -@@ -180,7 +180,7 @@ static void mxc_set_mode(enum clock_even - - if (mode != clockevent_mode) { - /* Set event time into far-far future */ -- if (cpu_is_mx3()) -+ if (cpu_is_mx3() || cpu_is_mx25()) - __raw_writel(__raw_readl(timer_base + MX3_TCN) - 3, - timer_base + MX3_TCMP); - else -@@ -233,7 +233,7 @@ static irqreturn_t mxc_timer_interrupt(i - struct clock_event_device *evt = &clockevent_mxc; - uint32_t tstat; - -- if (cpu_is_mx3()) -+ if (cpu_is_mx3() || cpu_is_mx25()) - tstat = __raw_readl(timer_base + MX3_TSTAT); - else - tstat = __raw_readl(timer_base + MX1_2_TSTAT); -@@ -264,7 +264,7 @@ static int __init mxc_clockevent_init(st - { - unsigned int c = clk_get_rate(timer_clk); - -- if (cpu_is_mx3()) -+ if (cpu_is_mx3() || cpu_is_mx25()) - 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 - __raw_writel(0, timer_base + MXC_TCTL); - __raw_writel(0, timer_base + MXC_TPRER); /* see datasheet note */ - -- if (cpu_is_mx3()) -+ if (cpu_is_mx3() || cpu_is_mx25()) - 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 18:02:54.000000000 +0200 -@@ -12,7 +12,7 @@ - # - # http://www.arm.linux.org.uk/developer/machines/?action=new - # --# Last update: Mon Mar 23 20:09:01 2009 -+# Last update: Mon Apr 20 10:31:38 2009 - # - # machine_is_xxx CONFIG_xxxx MACH_TYPE_xxx number - # -@@ -1721,7 +1721,7 @@ sapphire MACH_SAPPHIRE SAPPHIRE 1729 - csb637xo MACH_CSB637XO CSB637XO 1730 - evisiong MACH_EVISIONG EVISIONG 1731 - stmp37xx MACH_STMP37XX STMP37XX 1732 --stmp378x MACH_STMP38XX STMP38XX 1733 -+stmp378x MACH_STMP378X STMP378X 1733 - tnt MACH_TNT TNT 1734 - tbxt MACH_TBXT TBXT 1735 - playmate MACH_PLAYMATE PLAYMATE 1736 -@@ -2132,3 +2132,41 @@ apollo MACH_APOLLO APOLLO 2141 - at91cap9stk MACH_AT91CAP9STK AT91CAP9STK 2142 - spc300 MACH_SPC300 SPC300 2143 - eko MACH_EKO EKO 2144 -+ccw9m2443 MACH_CCW9M2443 CCW9M2443 2145 -+ccw9m2443js MACH_CCW9M2443JS CCW9M2443JS 2146 -+m2m_router_device MACH_M2M_ROUTER_DEVICE M2M_ROUTER_DEVICE 2147 -+str9104nas MACH_STAR9104NAS STAR9104NAS 2148 -+pca100 MACH_PCA100 PCA100 2149 -+z3_dm365_mod_01 MACH_Z3_DM365_MOD_01 Z3_DM365_MOD_01 2150 -+hipox MACH_HIPOX HIPOX 2151 -+omap3_piteds MACH_OMAP3_PITEDS OMAP3_PITEDS 2152 -+bm150r MACH_BM150R BM150R 2153 -+tbone MACH_TBONE TBONE 2154 -+merlin MACH_MERLIN MERLIN 2155 -+falcon MACH_FALCON FALCON 2156 -+davinci_da850_evm MACH_DAVINCI_DA850_EVM DAVINCI_DA850_EVM 2157 -+s5p6440 MACH_S5P6440 S5P6440 2158 -+at91sam9g10ek MACH_AT91SAM9G10EK AT91SAM9G10EK 2159 -+omap_4430sdp MACH_OMAP_4430SDP OMAP_4430SDP 2160 -+lpc313x MACH_LPC313X LPC313X 2161 -+magx_zn5 MACH_MAGX_ZN5 MAGX_ZN5 2162 -+magx_em30 MACH_MAGX_EM30 MAGX_EM30 2163 -+magx_ve66 MACH_MAGX_VE66 MAGX_VE66 2164 -+meesc MACH_MEESC MEESC 2165 -+otc570 MACH_OTC570 OTC570 2166 -+bcu2412 MACH_BCU2412 BCU2412 2167 -+beacon MACH_BEACON BEACON 2168 -+actia_tgw MACH_ACTIA_TGW ACTIA_TGW 2169 -+e4430 MACH_E4430 E4430 2170 -+ql300 MACH_QL300 QL300 2171 -+btmavb101 MACH_BTMAVB101 BTMAVB101 2172 -+btmawb101 MACH_BTMAWB101 BTMAWB101 2173 -+sq201 MACH_SQ201 SQ201 2174 -+quatro45xx MACH_QUATRO45XX QUATRO45XX 2175 -+openpad MACH_OPENPAD OPENPAD 2176 -+tx25 MACH_TX25 TX25 2177 -+omap3_torpedo MACH_OMAP3_TORPEDO OMAP3_TORPEDO 2178 -+htcraphael_k MACH_HTCRAPHAEL_K HTCRAPHAEL_K 2179 -+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 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", - template->gpio, template->name); -- return 0; -+ return -EINVAL; - } - - 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 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. - -+config MTD_NAND_MXC_FLASH_BBT -+ bool "Support a flash based bad block table" -+ depends on MTD_NAND_MXC -+ -+config ARCH_MXC_HAS_NFC_V1 -+ bool -+ -+config ARCH_MXC_HAS_NFC_V1_1 -+ select ARCH_MXC_HAS_NFC_V1 -+ bool -+ -+config ARCH_MXC_HAS_NFC_V2 -+ bool -+ -+config ARCH_MXC_HAS_NFC_V2_1 -+ bool -+ select ARCH_MXC_HAS_NFC_V2 -+ -+config ARCH_MXC_HAS_NFC_V3 -+ bool -+ - 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/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-08 12:51:07.000000000 +0200 -@@ -34,23 +34,52 @@ - #include - #include - -+#ifdef CONFIG_MTD_DEBUG -+static int debug = 0; -+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(l, fmt...) DBG(l, fmt) -+#else -+static int debug; -+module_param(debug, int, 0); -+ -+#define dbg_lvl(n) 0 -+#define DBG(lvl, fmt...) do { } while (0) -+#endif -+ -+ - #define DRIVER_NAME "mxc_nand" - - /* Addresses for NFC registers */ --#define NFC_BUF_SIZE 0xE00 --#define NFC_BUF_ADDR 0xE04 --#define NFC_FLASH_ADDR 0xE06 --#define NFC_FLASH_CMD 0xE08 --#define NFC_CONFIG 0xE0A --#define NFC_ECC_STATUS_RESULT 0xE0C --#define NFC_RSLTMAIN_AREA 0xE0E --#define NFC_RSLTSPARE_AREA 0xE10 --#define NFC_WRPROT 0xE12 --#define NFC_UNLOCKSTART_BLKADDR 0xE14 --#define NFC_UNLOCKEND_BLKADDR 0xE16 --#define NFC_NF_WRPRST 0xE18 --#define NFC_CONFIG1 0xE1A --#define NFC_CONFIG2 0xE1C -+#define NFC_BUF_SIZE 0x000 -+#define NFC_BUF_ADDR 0x004 -+#define NFC_FLASH_ADDR 0x006 -+#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_UNLOCKSTART_BLKADDR 0x014 -+#define NFC_UNLOCKEND_BLKADDR 0x016 -+#endif -+#define NFC_NF_WRPRST 0x018 -+#define NFC_CONFIG1 0x01A -+#define NFC_CONFIG2 0x01C -+#ifdef CONFIG_ARCH_MXC_HAS_NFC_V1_1 -+#define NFC_UNLOCKSTART_BLKADDR 0x020 -+#define NFC_UNLOCKEND_BLKADDR 0x022 -+#define NFC_UNLOCKSTART_BLKADDR1 0x024 -+#define NFC_UNLOCKEND_BLKADDR1 0x026 -+#define NFC_UNLOCKSTART_BLKADDR2 0x028 -+#define NFC_UNLOCKEND_BLKADDR2 0x02a -+#define NFC_UNLOCKSTART_BLKADDR3 0x02c -+#define NFC_UNLOCKEND_BLKADDR3 0x02e -+#endif - - /* Addresses for NFC RAM BUFFER Main area 0 */ - #define MAIN_AREA0 0x000 -@@ -59,10 +88,27 @@ - #define MAIN_AREA3 0x600 - - /* Addresses for NFC SPARE BUFFER Spare area 0 */ -+#ifndef CONFIG_ARCH_MXC_HAS_NFC_V1_1 -+#define SPARE_AREA_SIZE 16 - #define SPARE_AREA0 0x800 - #define SPARE_AREA1 0x810 - #define SPARE_AREA2 0x820 - #define SPARE_AREA3 0x830 -+#else -+#define SPARE_AREA_SIZE 64 -+#define MAIN_AREA4 0x800 -+#define MAIN_AREA5 0xa00 -+#define MAIN_AREA6 0xc00 -+#define MAIN_AREA7 0xe00 -+#define SPARE_AREA0 0x1000 -+#define SPARE_AREA1 0x1040 -+#define SPARE_AREA2 0x1080 -+#define SPARE_AREA3 0x10c0 -+#define SPARE_AREA4 0x1100 -+#define SPARE_AREA5 0x1140 -+#define SPARE_AREA6 0x1180 -+#define SPARE_AREA7 0x11c0 -+#endif - - /* 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 { - struct device *dev; - - void __iomem *regs; -+ void __iomem *nfc_buf; - int spare_only; - int status_request; - int pagesize_2k; -@@ -120,40 +167,149 @@ 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}} -+}; -+ - static struct nand_ecclayout nand_hw_eccoob_8 = { - .eccbytes = 5, - .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}} -+}; -+ -+#ifdef CONFIG_MTD_NAND_MXC_FLASH_BBT -+static u8 bbt_pattern[] = {'B', 'b', 't', '0' }; -+static u8 mirror_pattern[] = {'1', 't', 'b', 'B' }; -+ -+static struct nand_bbt_descr bbt_main_descr = { -+ .options = (NAND_BBT_LASTBLOCK | NAND_BBT_WRITE | -+ NAND_BBT_2BIT | NAND_BBT_VERSION | NAND_BBT_PERCHIP), -+ .offs = 12, -+ .len = 4, -+ .veroffs = 11, -+ .maxblocks = 4, -+ .pattern = bbt_pattern, - }; - -+static struct nand_bbt_descr bbt_mirror_descr = { -+ .options = (NAND_BBT_LASTBLOCK | NAND_BBT_WRITE | -+ NAND_BBT_2BIT | NAND_BBT_VERSION | NAND_BBT_PERCHIP), -+ .offs = 12, -+ .len = 4, -+ .veroffs = 11, -+ .maxblocks = 4, -+ .pattern = mirror_pattern, -+}; -+#endif -+#else -+/* -+ * 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 = {{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}, -+ .oobfree = {{0, 4}}, -+}; -+ -+static struct nand_ecclayout nand_hw_eccoob2k_16 = { -+ .eccbytes = 9, -+ .eccpos = {6, 7, 8, 9, 10, 11, 12, 13, 14}, -+ .oobfree = {{2, 4}, {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 -+*/ -+static u8 bbt_pattern[] = { 'B', 'b', 't', '0' }; -+static u8 mirror_pattern[] = { '1', 't', 'b', 'B' }; -+ -+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 -+}; -+ -+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 -+}; -+#endif -+#endif -+ - #ifdef CONFIG_MTD_PARTITIONS - static const char *part_probes[] = { "RedBoot", "cmdlinepart", NULL }; - #endif - -+#ifdef CONFIG_MTD_DEBUG -+#define nfc_read_reg(b, r) __nfc_read_reg(b, r, #r, __FUNCTION__) -+static inline u16 __nfc_read_reg(void __iomem *base, unsigned int reg, -+ const char *name, const char *fn) -+{ -+ u16 val = readw(base + reg); -+ DBG(3, "%s: Read %04x from %s[%02x]\n", fn, val, name, reg); -+ return val; -+} -+ -+#define nfc_write_reg(v, b, r) __nfc_write_reg(v, b, r, #r, __FUNCTION__) -+static inline void __nfc_write_reg(u16 val, void __iomem *base, unsigned int reg, -+ const char *name, const char *fn) -+{ -+ DBG(3, "%s: Writing %04x to %s[%02x]\n", fn, val, name, reg); -+ writew(val, base + reg); -+} -+#else -+#define nfc_read_reg(b, r) readw(b + r) -+#define nfc_write_reg(v, b, r) writew(v, b + r) -+#endif -+ - 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_LEVEL3, "%s(%d)\n", __FUNCTION__, irq); -+ -+ tmp = nfc_read_reg(host->regs, NFC_CONFIG1); - tmp |= NFC_INT_MSK; /* Disable interrupt */ -- writew(tmp, host->regs + NFC_CONFIG1); -+ nfc_write_reg(tmp, host->regs, NFC_CONFIG1); - - wake_up(&host->irq_waitq); - -@@ -166,35 +322,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; -- - if (useirq) { -- if ((readw(host->regs + NFC_CONFIG2) & NFC_INT) == 0) { -- -- tmp = readw(host->regs + NFC_CONFIG1); -- tmp &= ~NFC_INT_MSK; /* Enable interrupt */ -- writew(tmp, host->regs + NFC_CONFIG1); -- -- wait_event(host->irq_waitq, -- readw(host->regs + NFC_CONFIG2) & NFC_INT); -- -- tmp = readw(host->regs + NFC_CONFIG2); -- tmp &= ~NFC_INT; -- writew(tmp, host->regs + NFC_CONFIG2); -+ if (!(nfc_read_reg(host->regs, NFC_CONFIG2) & NFC_INT)) { -+ uint32_t cfg1; -+ 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_read_reg(host->regs, NFC_CONFIG2) & -+ NFC_INT, timeout); - } - } else { -- while (max_retries-- > 0) { -- if (readw(host->regs + NFC_CONFIG2) & NFC_INT) { -- tmp = readw(host->regs + NFC_CONFIG2); -- tmp &= ~NFC_INT; -- writew(tmp, host->regs + NFC_CONFIG2); -- break; -- } -+ 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); - } - } - -@@ -204,8 +354,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 +369,9 @@ 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); -@@ -230,22 +382,28 @@ static void send_addr(struct mxc_nand_ho - static void send_prog_page(struct mxc_nand_host *host, uint8_t buf_id, - int spare_only) - { -+ int i; - DEBUG(MTD_DEBUG_LEVEL3, "send_prog_page (%d)\n", spare_only); - -+ for (i = 0; i < 4; i++) { -+ void *src = host->nfc_buf + SPARE_AREA0 + i * 16; -+ void *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); -+ nfc_write_reg(buf_id, host->regs, NFC_BUF_ADDR); - - /* Configure spare or page+spare access */ - if (!host->pagesize_2k) { -- uint16_t config1 = readw(host->regs + NFC_CONFIG1); -+ uint16_t config1 = nfc_read_reg(host->regs, NFC_CONFIG1); - if (spare_only) - config1 |= NFC_SP_EN; - else -- 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); -@@ -256,25 +414,33 @@ 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 */ -- writew(buf_id, host->regs + NFC_BUF_ADDR); -+ nfc_write_reg(buf_id, host->regs, NFC_BUF_ADDR); - - /* Configure spare or page+spare access */ - if (!host->pagesize_2k) { -- uint32_t config1 = readw(host->regs + NFC_CONFIG1); -+ uint32_t config1 = nfc_read_reg(host->regs, NFC_CONFIG1); - if (spare_only) - config1 |= NFC_SP_EN; - else - config1 &= ~NFC_SP_EN; -- writew(config1, host->regs + NFC_CONFIG1); -+ nfc_write_reg(config1, host->regs, NFC_CONFIG1); - } - -- 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); -+ for (i = 0; i < 4; i++) { -+ void *src = host->nfc_buf + SPARE_AREA0 + i * 64; -+ void *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 +450,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 */ -- tmp = readw(host->regs + NFC_CONFIG1); -+ tmp = nfc_read_reg(host->regs, NFC_CONFIG1); - tmp &= ~NFC_SP_EN; -- writew(tmp, host->regs + NFC_CONFIG1); -+ 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 */ - wait_op_done(host, TROP_US_DELAY, 0, true); - - 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,32 +480,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_AREA1; - uint32_t store; - uint16_t ret, tmp; - /* 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 - * corruption of read/write buffer on status requests. */ -- writew(1, 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); -+ tmp = nfc_read_reg(host->regs, NFC_CONFIG1); - tmp &= ~NFC_SP_EN; -- writew(tmp, host->regs + NFC_CONFIG1); -+ nfc_write_reg(tmp, host->regs, NFC_CONFIG1); - -- writew(NFC_STATUS, host->regs + NFC_CONFIG2); -+ WARN_ON(nfc_read_reg(host->regs, NFC_CONFIG2)); -+ nfc_write_reg(NFC_STATUS, host->regs, NFC_CONFIG2); - - /* Wait for operation to complete */ - wait_op_done(host, TROP_US_DELAY, 0, true); - - /* Status is placed in first word of main buffer */ -- /* get status, then recovery area 1 data */ -+ /* get status, then recover area 1 data */ - ret = readw(main_buf); - writel(store, main_buf); - -+ DBG(0, "%s: status=%02x\n", __FUNCTION__, ret); -+ - return ret; - } - -@@ -369,7 +541,7 @@ static int mxc_nand_correct_data(struct - * 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, -@@ -392,8 +564,10 @@ 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; -- uint16_t __iomem *main_buf = host->regs + MAIN_AREA0; -- 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; -+ -+ WARN_ON(host->spare_only && host->col_addr >= 16); - - /* Check for status request */ - if (host->status_request) -@@ -431,14 +605,16 @@ static uint16_t mxc_nand_read_word(struc - "mxc_nand_read_word(col = %d)\n", host->col_addr); - - col = host->col_addr; -+ - /* Adjust saved column address */ - if (col < mtd->writesize && host->spare_only) - col += mtd->writesize; -+ WARN_ON(col >= mtd->writesize + 16); - - if (col < mtd->writesize) -- p = (host->regs + MAIN_AREA0) + (col >> 1); -+ p = (host->nfc_buf + MAIN_AREA0) + (col >> 1); - else -- p = (host->regs + SPARE_AREA0) + ((col - mtd->writesize) >> 1); -+ p = (host->nfc_buf + SPARE_AREA0) + ((col - mtd->writesize) >> 1); - - if (col & 1) { - rd_word = readw(p); -@@ -474,10 +650,13 @@ static void mxc_nand_write_buf(struct mt - /* 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 -+ 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); - -@@ -485,10 +664,10 @@ static void mxc_nand_write_buf(struct mt - void __iomem *p; - - if (col < mtd->writesize) -- p = host->regs + MAIN_AREA0 + (col & ~3); -+ p = host->nfc_buf + MAIN_AREA0 + (col & ~3); - else -- p = host->regs + SPARE_AREA0 - -- mtd->writesize + (col & ~3); -+ p = host->nfc_buf + SPARE_AREA0 + -+ (col & ~3) - mtd->writesize; - - DEBUG(MTD_DEBUG_LEVEL3, "%s:%d: p = %p\n", __func__, - __LINE__, p); -@@ -542,6 +721,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); - - memcpy(p, &buf[i], m); - col += m; -@@ -571,18 +751,28 @@ static void mxc_nand_read_buf(struct mtd - /* 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 -+ /* 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; - - if (col < mtd->writesize) -- p = host->regs + MAIN_AREA0 + (col & ~3); -+ p = host->nfc_buf + MAIN_AREA0 + (col & ~3); - else -- p = host->regs + SPARE_AREA0 - -- mtd->writesize + (col & ~3); -+ p = host->nfc_buf + SPARE_AREA0 + -+ (col & ~3) - mtd->writesize; -+ -+ if (dbg_lvl(3)) { -+ print_hex_dump(KERN_DEBUG, "spare: ", DUMP_PREFIX_ADDRESS, -+ 16, 2, p, 64, 0); -+ } - - if (((col | (int)&buf[i]) & 3) || n < 16) { - uint32_t data; -@@ -621,15 +811,20 @@ static void mxc_nand_read_buf(struct mtd - m += mtd->oobsize; - - 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; - } - } -+ 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 -@@ -637,7 +832,22 @@ 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; -+ -+ for (i = 0; i < len >> 1; i++) { -+ u16 w = *wp++; -+ u8 c1 = *buf++; -+ u8 c2 = *buf++; -+ if ((w & 0xff) != c1 || (w >> 8) != c2) { -+ DBG(0, "%s: verify error @ %03x: read: %02x %02x expected: %02x %02x\n", -+ __FUNCTION__, i, w & 0xff, w >> 8, c1, c2); -+ return -EFAULT; -+ } -+ } -+ return 0; - } - - /* This function is used by upper layer for select and -@@ -655,13 +865,15 @@ 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); - 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); - #endif - - switch (chip) { -@@ -679,9 +891,6 @@ static void mxc_nand_select_chip(struct - host->clk_act = 1; - } - break; -- -- default: -- break; - } - } - -@@ -692,7 +901,7 @@ 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", -@@ -712,13 +921,11 @@ static void mxc_nand_command(struct mtd_ - case NAND_CMD_READ0: - 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; -@@ -751,23 +958,25 @@ 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); -- -+#ifndef CONFIG_ARCH_MXC_HAS_NFC_V1_1 - if (host->pagesize_2k) { - /* 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); - } -- -+#endif -+ useirq = true; - break; - - case NAND_CMD_ERASE1: -- useirq = false; -+ break; -+ case NAND_CMD_ERASE2: -+ useirq = true; - break; - } - -@@ -791,23 +1000,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 +1022,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); -+#ifndef CONFIG_ARCH_MXC_HAS_NFC_V1_1 - send_read_page(host, 1, host->spare_only); - send_read_page(host, 2, host->spare_only); - send_read_page(host, 3, host->spare_only); -+#endif - } else - send_read_page(host, 0, host->spare_only); - break; - - case NAND_CMD_READID: -+ host->col_addr = 0; - send_read_id(host); - break; - -@@ -851,9 +1053,12 @@ 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; -- struct resource *res; -+ struct resource *res1, *res2; - 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 +1073,6 @@ static int __init mxcnd_probe(struct pla - mtd->owner = THIS_MODULE; - mtd->dev.parent = &pdev->dev; - -- /* 50 us command delay time */ -- this->chip_delay = 5; -- - this->priv = host; - this->dev_ready = mxc_nand_dev_ready; - this->cmdfunc = mxc_nand_command; -@@ -880,29 +1082,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; -+#ifdef CONFIG_MTD_NAND_MXC_FLASH_BBT -+ this->bbt_td = &bbt_main_descr; -+ this->bbt_md = &bbt_mirror_descr; -+ this->options |= NAND_USE_FLASH_BBT; -+#endif - -- host->clk = clk_get(&pdev->dev, "nfc"); -- if (IS_ERR(host->clk)) -+ host->clk = clk_get(&pdev->dev, "nfc_clk"); -+ if (IS_ERR(host->clk)) { -+ err = PTR_ERR(host->clk); - goto eclk; -+ } - - clk_enable(host->clk); - host->clk_act = 1; - -- res = platform_get_resource(pdev, IORESOURCE_MEM, 0); -- if (!res) { -+ res1 = platform_get_resource(pdev, IORESOURCE_MEM, 0); -+ res2 = platform_get_resource(pdev, IORESOURCE_MEM, 1); -+ if (!res1 || !res2) { - err = -ENODEV; - goto eres; - } - -- 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; -+ } -+ -+ if (!request_mem_region(res2->start, resource_size(res2), "mxc_nand buffer")) { -+ err = -EBUSY; -+ goto ereq2; -+ } -+ -+ host->regs = ioremap(res1->start, resource_size(res1)); - if (!host->regs) { -- err = -EIO; -- goto eres; -+ err = -ENOMEM; -+ goto eunmap1; - } - -- tmp = readw(host->regs + NFC_CONFIG1); -+ 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); - -@@ -912,57 +1139,84 @@ static int __init mxcnd_probe(struct pla - if (err) - goto eirq; - -- 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_ECC_EN; -- writew(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; -- tmp = readw(host->regs + NFC_CONFIG1); -- tmp &= ~NFC_ECC_EN; -- writew(tmp, host->regs + NFC_CONFIG1); -- } -- - /* Reset NAND */ - this->cmdfunc(mtd, NAND_CMD_RESET, -1, -1); - - /* preset operation */ - /* Unlock the internal RAM Buffer */ -- writew(0x2, host->regs + NFC_CONFIG); -+ nfc_write_reg(0x2, host->regs, NFC_CONFIG); - - /* Blocks to be unlocked */ -- writew(0x0, host->regs + NFC_UNLOCKSTART_BLKADDR); -- writew(0x4000, host->regs + NFC_UNLOCKEND_BLKADDR); -+ nfc_write_reg(0x0, host->regs, NFC_UNLOCKSTART_BLKADDR); -+ nfc_write_reg(0x4000, host->regs, NFC_UNLOCKEND_BLKADDR); - - /* Unlock Block Command for given address range */ -- writew(0x4, host->regs + NFC_WRPROT); -+ nfc_write_reg(0x4, host->regs, NFC_WRPROT); - - /* NAND bus width determines access funtions used by upper layer */ - if (pdata->width == 2) { - this->options |= NAND_BUSWIDTH_16; -- this->ecc.layout = &nand_hw_eccoob_16; - } - -- host->pagesize_2k = 0; -- - /* Scan to find existence of the device */ -- if (nand_scan(mtd, 1)) { -+ err = nand_scan_ident(mtd, 1); -+ if (err) { - DEBUG(MTD_DEBUG_LEVEL0, - "MXC_ND: Unable to find any NAND device.\n"); -- err = -ENXIO; -+ goto escan; -+ } -+ /* this is required before completing the scan */ -+ host->pagesize_2k = (mtd->writesize == 2048); -+ tmp = nfc_read_reg(host->regs, NFC_CONFIG1); -+ tmp |= NFC_ONE_CYCLE; -+ tmp &= ~(3 << 9); /* clear PPB mask */ -+ DBG(0, "%s: ppb=%d (%02x)\n", __FUNCTION__, -+ mtd->erasesize / mtd->writesize, -+ ffs(mtd->erasesize / mtd->writesize) - 6); -+ -+ /* set PPB (pages per block */ -+ tmp |= (ffs(mtd->erasesize / mtd->writesize) - 6) << 9; -+ nfc_write_reg(tmp, host->regs, NFC_CONFIG1); -+ if (pdata->width == 2) { -+ if (host->pagesize_2k) { -+ this->ecc.layout = &nand_hw_eccoob2k_16; -+ } else { -+ this->ecc.layout = &nand_hw_eccoob_16; -+ } -+ } 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; -+ nfc_write_reg(tmp, host->regs, NFC_CONFIG1); -+ } -+ -+ err = nand_scan_tail(mtd); -+ if (err) { - goto escan; - } - -+ 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 +1235,19 @@ static int __init mxcnd_probe(struct pla - return 0; - - escan: -- free_irq(host->irq, NULL); -+ free_irq(host->irq, host); - eirq: -+ if (res2) -+ iounmap(host->nfc_buf); -+eunmap2: - iounmap(host->regs); -+eunmap1: -+ release_mem_region(res2->start, resource_size(res2)); -+ereq2: -+ release_mem_region(res1->start, resource_size(res1)); -+ereq1: - eres: -+ clk_disable(host->clk); - clk_put(host->clk); - eclk: - kfree(host); -@@ -995,46 +1258,63 @@ eclk: - static int __devexit mxcnd_remove(struct platform_device *pdev) - { - struct mxc_nand_host *host = platform_get_drvdata(pdev); -+ struct resource *res; - -+ if (host->clk_act) -+ clk_disable(host->clk); - clk_put(host->clk); - -- platform_set_drvdata(pdev, NULL); -- - nand_release(&host->mtd); -- free_irq(host->irq, NULL); -+ free_irq(host->irq, host); - iounmap(host->regs); - kfree(host); - -+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0); -+ if (res) { -+ release_mem_region(res->start, resource_size(res)); -+ } -+ res = platform_get_resource(pdev, IORESOURCE_MEM, 1); -+ if (res) { -+ release_mem_region(res->start, resource_size(res)); -+ } - return 0; - } - - #ifdef CONFIG_PM - static int mxcnd_suspend(struct platform_device *pdev, pm_message_t state) - { -- struct mtd_info *info = platform_get_drvdata(pdev); -+ struct mtd_info *mtd = platform_get_drvdata(pdev); -+ struct nand_chip *nand_chip = mtd->priv; -+ struct mxc_nand_host *host = nand_chip->priv; - int ret = 0; - - DEBUG(MTD_DEBUG_LEVEL0, "MXC_ND : NAND suspend\n"); -- if (info) -- ret = info->suspend(info); -+ if (mtd) -+ ret = mtd->suspend(mtd); - -- /* Disable the NFC clock */ -- clk_disable(nfc_clk); /* FIXME */ -+ if (host->clk_act) { -+ /* Disable the NFC clock */ -+ clk_disable(host->clk); -+ } - - return ret; - } - - static int mxcnd_resume(struct platform_device *pdev) - { -- struct mtd_info *info = platform_get_drvdata(pdev); -+ struct mtd_info *mtd = platform_get_drvdata(pdev); -+ struct nand_chip *nand_chip = mtd->priv; -+ struct mxc_nand_host *host = nand_chip->priv; - int ret = 0; - - DEBUG(MTD_DEBUG_LEVEL0, "MXC_ND : NAND resume\n"); -- /* Enable the NFC clock */ -- clk_enable(nfc_clk); /* FIXME */ - -- if (info) -- info->resume(info); -+ if (host->clk_act) { -+ /* Enable the NFC clock */ -+ clk_enable(host->clk); -+ } -+ if (mtd) -+ mtd->resume(mtd); - - return ret; - } -@@ -1047,7 +1327,7 @@ static int mxcnd_resume(struct platform_ - static struct platform_driver mxcnd_driver = { - .driver = { - .name = DRIVER_NAME, -- }, -+ }, - .remove = __exit_p(mxcnd_remove), - .suspend = mxcnd_suspend, - .resume = mxcnd_resume, -@@ -1055,13 +1335,14 @@ static struct platform_driver mxcnd_driv - - static int __init mxc_nd_init(void) - { -+ int ret; -+ - /* Register the device driver structure. */ -- pr_info("MXC MTD nand Driver\n"); -- if (platform_driver_probe(&mxcnd_driver, mxcnd_probe) != 0) { -+ ret = platform_driver_probe(&mxcnd_driver, mxcnd_probe); -+ if (ret != 0) { - printk(KERN_ERR "Driver register failed for mxcnd_driver\n"); -- return -ENODEV; - } -- return 0; -+ return ret; - } - - static void __exit mxc_nd_cleanup(void) -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 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 -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 18:43:03.000000000 +0200 -@@ -2,6 +2,12 @@ - * Fast Ethernet Controller (FEC) driver for Motorola MPC8xx. - * Copyright (c) 1997 Dan Malek (dmalek@jlc.net) - * -+ * This version of the driver is specific to the FADS implementation, -+ * since the board contains control registers external to the processor -+ * for the control of the LevelOne LXT970 transceiver. The MPC860T manual -+ * describes connections using the internal parallel port I/O, which -+ * is basically all of Port D. -+ * - * Right now, I am very wasteful with the buffers. I allocate memory - * pages and then divide them into 2K frame buffers. This way I know I - * have buffers large enough to hold one frame within one buffer descriptor. -@@ -18,77 +24,123 @@ - * Bug fixes and cleanup by Philippe De Muyter (phdm@macqel.be) - * Copyright (c) 2004-2006 Macq Electronique SA. - */ -+/* -+ * Copyright 2006-2007 Freescale Semiconductor, Inc. All Rights Reserved. -+ */ - - #include - #include --#include --#include -+#include - #include - #include - #include - #include --#include --#include -+#include - #include -+#include - #include - #include - #include - #include --#include --#include --#include --#include -+#include - #include --#include -+#include -+#include - --#include -+#include -+#include - --#ifndef CONFIG_ARCH_MXC --#include --#include -+#define DRV_NAME "fec" -+#define DEBUG -+ -+#ifdef DEBUG -+static int debug = 0; -+#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 - -+#if defined(CONFIG_M523x) || defined(CONFIG_M527x) || \ -+ defined(CONFIG_M5272) || defined(CONFIG_M528x) || \ -+ defined(CONFIG_M520x) || defined(CONFIG_M532x) -+#include -+#include - #include "fec.h" -- --#ifdef CONFIG_ARCH_MXC -+#define FEC_ALIGNMENT (0x03) /*FEC needs 4bytes alignment*/ -+#elif defined(CONFIG_ARCH_MXC) - #include --#define FEC_ALIGNMENT 0xf -+#include -+#include "fec.h" -+#define FEC_ALIGNMENT (0x0F) /*FEC needs 128bits(16bytes) alignment*/ - #else --#define FEC_ALIGNMENT 0x3 -+#include -+#include -+#include "commproc.h" -+#define FEC_ALIGNMENT (0x03) /*FEC needs 4bytes alignment */ - #endif - -+#define FEC_ADDR_ALIGNMENT(x) ((unsigned char *)(((unsigned long)(x) + (FEC_ALIGNMENT)) & (~FEC_ALIGNMENT))) -+ -+#if 0 - /* - * Define the fixed address of the FEC hardware. - */ -+/* USE resources provided by platform_device! */ -+static unsigned int fec_hw[] = { - #if defined(CONFIG_M5272) --#define HAVE_mii_link_interrupt -- --static unsigned char fec_mac_default[] = { -- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, -+ (MCF_MBAR + 0x840), -+#elif defined(CONFIG_M527x) -+ (MCF_MBAR + 0x1000), -+ (MCF_MBAR + 0x1800), -+#elif defined(CONFIG_M523x) || defined(CONFIG_M528x) -+ (MCF_MBAR + 0x1000), -+#elif defined(CONFIG_M520x) -+ (MCF_MBAR+0x30000), -+#elif defined(CONFIG_M532x) -+ (MCF_MBAR+0xfc030000), -+#elif defined(CONFIG_ARCH_MXC) -+ (IO_ADDRESS(FEC_BASE_ADDR)), -+#else -+ &(((immap_t *)IMAP_ADDR)->im_cpm.cp_fec), -+#endif - }; -+#endif - -+#if 0 - /* - * Some hardware gets it MAC address out of local flash memory. - * if this is non-zero then assume it is the address to get MAC from. - */ -+/* implemented using platform_data! */ - #if defined(CONFIG_NETtel) - #define FEC_FLASHMAC 0xf0006006 - #elif defined(CONFIG_GILBARCONAP) || defined(CONFIG_SCALES) - #define FEC_FLASHMAC 0xf0006000 -+#elif defined (CONFIG_MTD_KeyTechnology) -+#define FEC_FLASHMAC 0xffe04000 - #elif defined(CONFIG_CANCam) - #define FEC_FLASHMAC 0xf0020000 - #elif defined (CONFIG_M5272C3) - #define FEC_FLASHMAC (0xffe04000 + 4) - #elif defined(CONFIG_MOD5272) --#define FEC_FLASHMAC 0xffc0406b -+#define FEC_FLASHMAC 0xffc0406b - #else - #define FEC_FLASHMAC 0 - #endif --#endif /* CONFIG_M5272 */ -+#endif -+ -+#define platform_func(p, args...) ((p) ? (p)(args) : 0) - - /* Forward declarations of some structures to support different PHYs - */ -- -+#ifndef CONFIG_PHYLIB - typedef struct { - uint mii_data; - void (*funct)(uint mii_reg, struct net_device *dev); -@@ -103,6 +155,7 @@ typedef struct { - const phy_cmd_t *ack_int; - const phy_cmd_t *shutdown; - } phy_info_t; -+#endif - - /* The number of Tx and Rx buffers. These are allocated from the page - * pool. The code may assume these are power of two, so it it best -@@ -116,12 +169,13 @@ typedef struct { - #define RX_RING_SIZE (FEC_ENET_RX_FRPPG * FEC_ENET_RX_PAGES) - #define FEC_ENET_TX_FRSIZE 2048 - #define FEC_ENET_TX_FRPPG (PAGE_SIZE / FEC_ENET_TX_FRSIZE) --#define TX_RING_SIZE 16 /* Must be power of two */ --#define TX_RING_MOD_MASK 15 /* for this to work */ -+#define TX_RING_SIZE 16 /* Must be power of two */ -+#define TX_RING_MOD_MASK (TX_RING_SIZE - 1) /* for this to work */ - - #if (((RX_RING_SIZE + TX_RING_SIZE) * 8) > PAGE_SIZE) - #error "FEC: descriptor ring size constants too large" - #endif -+#define CBD_BUF_SIZE ((RX_RING_SIZE + TX_RING_SIZE) * sizeof(cbd_t)) - - /* Interrupt events/masks. - */ -@@ -136,6 +190,17 @@ typedef struct { - #define FEC_ENET_MII ((uint)0x00800000) /* MII interrupt */ - #define FEC_ENET_EBERR ((uint)0x00400000) /* SDMA bus error */ - -+/* MXC arch interrupt bits */ -+#define FEC_ENET_LC ((uint)0x00200000) /* Late collision */ -+#define FEC_ENET_RL ((uint)0x00100000) /* Collision retry limit exceeded */ -+#define FEC_ENET_UN ((uint)0x00080000) /* TX Fifo underrun */ -+ -+#ifndef CONFIG_ARCH_MXC -+#define FEC_ENET_MASK ((uint)0xffc00000) -+#else -+#define FEC_ENET_MASK ((uint)0xfff80000) -+#endif -+ - /* The FEC stores dest/src/type, data, and checksum for receive packets. - */ - #define PKT_MAXBUF_SIZE 1518 -@@ -150,7 +215,7 @@ typedef struct { - */ - #if defined(CONFIG_M523x) || defined(CONFIG_M527x) || defined(CONFIG_M528x) || \ - defined(CONFIG_M520x) || defined(CONFIG_M532x) || defined(CONFIG_ARCH_MXC) --#define OPT_FRAME_SIZE (PKT_MAXBUF_SIZE << 16) -+#define OPT_FRAME_SIZE (RCR_MAX_FL_set(PKT_MAXBUF_SIZE)) - #else - #define OPT_FRAME_SIZE 0 - #endif -@@ -165,31 +230,45 @@ typedef struct { - */ - struct fec_enet_private { - /* Hardware registers of the FEC device */ -- volatile fec_t *hwp; -- -- struct net_device *netdev; -- -- struct clk *clk; -+ void __iomem *reg_base; -+ void __iomem *mib_base; -+ struct resource *res_mem1; -+ struct resource *res_mem2; -+ int etn_irq; -+ int mii_irq; -+#ifndef CONFIG_PHYLIB -+ struct timer_list *phy_timer; -+#else -+ struct mii_bus *mii; -+ int mii_complete; -+#endif -+ u32 msg_enable; - - /* The saved address of a sent-in-place packet/buffer, for skfree(). */ -- unsigned char *tx_bounce[TX_RING_SIZE]; -+ void *tx_bounce[TX_RING_SIZE]; - struct sk_buff* tx_skbuff[TX_RING_SIZE]; -+ struct sk_buff* rx_skbuff[RX_RING_SIZE]; - ushort skb_cur; - ushort skb_dirty; - - /* CPM dual port RAM relative addresses. - */ -- dma_addr_t bd_dma; -+ struct device *dma_dev; /* pointer to (platform_)device for dma_sync*() functions */ -+ void *cbd_mem_base; /* save the virtual base address of rx&tx buffer descriptor */ -+ dma_addr_t cbd_phys_base; /* physical address of buffer descriptor memory for access by FEC HW */ -+ - cbd_t *rx_bd_base; /* Address of Rx and Tx buffers. */ - cbd_t *tx_bd_base; -- cbd_t *cur_rx, *cur_tx; /* The next free ring entry */ -- cbd_t *dirty_tx; /* The ring entries to be free()ed. */ -+ cbd_t *cur_rx, *cur_tx; /* The next free ring entry */ -+ cbd_t *dirty_tx; /* The ring entries to be free()ed. */ -+ struct net_device_stats stats; - uint tx_full; -- /* hold while accessing the HW like ringbuffer for tx/rx but not MAC */ -- spinlock_t hw_lock; -- /* hold while accessing the mii_list_t() elements */ -- spinlock_t mii_lock; -+ spinlock_t lock; - -+#ifdef CONFIG_PHYLIB -+ struct phy_device *phy; -+ uint phy_speed; -+#else - uint phy_id; - uint phy_id_done; - uint phy_status; -@@ -199,28 +278,41 @@ struct fec_enet_private { - - uint sequence_done; - uint mii_phy_task_queued; -- -+#endif - uint phy_addr; - -- int index; -- int opened; -- int link; -- int old_link; -- int full_duplex; -+ unsigned int opened:1; -+ unsigned int phy_int_enabled:1; -+ unsigned int linkstatus:1; -+#ifndef CONFIG_PHYLIB -+ unsigned int old_linkstatus:1; -+#endif -+ unsigned int full_duplex:1; -+ -+ struct clk *clk; - }; - --static int fec_enet_open(struct net_device *dev); --static int fec_enet_start_xmit(struct sk_buff *skb, struct net_device *dev); --static void fec_enet_mii(struct net_device *dev); --static irqreturn_t fec_enet_interrupt(int irq, void * dev_id); -+#ifdef CONFIG_PHYLIB -+static int fec_connect_phy(struct net_device *dev, struct fec_enet_private *fep); -+#else -+static irqreturn_t mii_link_interrupt(int irq, void *dev_id); -+#endif -+static void fec_restart(struct net_device *dev, int duplex); - static void fec_enet_tx(struct net_device *dev); - static void fec_enet_rx(struct net_device *dev); --static int fec_enet_close(struct net_device *dev); --static void set_multicast_list(struct net_device *dev); --static void fec_restart(struct net_device *dev, int duplex); -+static void fec_enet_mii(struct net_device *dev); - static void fec_stop(struct net_device *dev); --static void fec_set_mac_address(struct net_device *dev); -+static void _fec_set_mac_address(struct net_device *dev); - -+/* -+ * fec_copy_threshold controls the copy when receiving ethernet frame. -+ * If ethernet header is aligned on a 4byte boundary, the ip header and -+ * higher level header will not be aligned. -+ * The reason is, that an ethernet header is 14bytes long. -+ * And the max size of tcp & ip header is 128bytes. Normally it is 40bytes. -+ * So I set the default value between 128 to 256. -+ */ -+static int fec_copy_threshold = 192; - - /* MII processing. We keep this as simple as possible. Requests are - * placed on the list (if there is room). When the request is finished -@@ -232,14 +324,16 @@ typedef struct mii_list { - struct mii_list *mii_next; - } mii_list_t; - -+#ifndef CONFIG_PHYLIB - #define NMII 20 - static mii_list_t mii_cmds[NMII]; - static mii_list_t *mii_free; - static mii_list_t *mii_head; - static mii_list_t *mii_tail; - --static int mii_queue(struct net_device *dev, int request, -- void (*func)(uint, struct net_device *)); -+static int mii_queue(struct net_device *dev, int request, -+ void (*func)(uint, struct net_device *)); -+#endif - - /* Make MII read/write commands for the FEC. - */ -@@ -284,87 +378,233 @@ 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 */ - -+#ifndef DEBUG -+static inline unsigned long fec_reg_read(struct fec_enet_private *fep, unsigned int reg) -+{ -+ return readl(fep->reg_base + reg); -+} -+ -+static inline void fec_reg_write(struct fec_enet_private *fep, unsigned int reg, unsigned long val) -+{ -+ writel(val, fep->reg_base + reg); -+} -+#else -+#define fec_reg_read(fep, reg) __fec_reg_read(fep, reg, __FUNCTION__, #reg) -+#define fec_reg_write(fep, reg, val) __fec_reg_write(fep, reg, val, __FUNCTION__, #reg) -+ -+static inline unsigned long __fec_reg_read(struct fec_enet_private *fep, unsigned int reg, -+ const char *func, const char *reg_name) -+{ -+ unsigned long val = readl(fep->reg_base + reg); -+ DBG(3, "%s: Read %08lx from %s(%03x)\n", func, val, reg_name, reg); -+ return val; -+} -+ -+static inline void __fec_reg_write(struct fec_enet_private *fep, unsigned int reg, -+ unsigned long val, const char *func, const char *reg_name) -+{ -+ DBG(3, "%s: Writing %08lx to %s(%03x)\n", func, val, reg_name, reg); -+ writel(val, fep->reg_base + reg); -+} -+#endif -+ -+static inline void fec_enet_cbd_get(struct fec_enet_private *fep) -+{ -+ DBG(2, "%s: Requesting cbd area: %08lx\n", __FUNCTION__, -+ (unsigned long)fep->cbd_phys_base); -+ dma_sync_single_for_cpu(fep->dma_dev, fep->cbd_phys_base, -+ CBD_BUF_SIZE, DMA_BIDIRECTIONAL); -+} -+ -+static inline void fec_enet_cbd_put(struct fec_enet_private *fep) -+{ -+ DBG(2, "%s: Flushing changes to cbd area\n", __FUNCTION__); -+ dma_sync_single_for_device(fep->dma_dev, fep->cbd_phys_base, -+ CBD_BUF_SIZE, DMA_BIDIRECTIONAL); -+} -+ -+static inline void fec_enet_rxbuf_get(struct fec_enet_private *fep, cbd_t *bdp, ushort len) -+{ -+ DBG(2, "%s: Requesting RX buffer %08lx(%u)\n", __FUNCTION__, -+ (unsigned long)bdp->cbd_bufaddr, len); -+ dma_sync_single_for_cpu(fep->dma_dev, bdp->cbd_bufaddr, -+ len, DMA_FROM_DEVICE); -+} -+ -+static inline void fec_enet_rxbuf_put(struct fec_enet_private *fep, cbd_t *bdp, ushort len) -+{ -+ DBG(2, "%s: Releasing RX buffer %08lx(%u)\n", __FUNCTION__, (ulong)bdp->cbd_bufaddr, len); -+ dma_sync_single_for_device(fep->dma_dev, bdp->cbd_bufaddr, len, DMA_FROM_DEVICE); -+} -+ -+static inline void fec_enet_rxbuf_map(struct fec_enet_private *fep, cbd_t *bdp, -+ void *buf, ushort len) -+{ -+ BUG_ON(!dma_mapping_error(fep->dma_dev, bdp->cbd_bufaddr)); -+ bdp->cbd_bufaddr = dma_map_single(fep->dma_dev, buf, -+ len, DMA_FROM_DEVICE); -+ DBG(2, "%s: RX buffer %p(%u) mapped to %08lx\n", __FUNCTION__, -+ buf, len, (unsigned long)bdp->cbd_bufaddr); -+} -+ -+static inline void fec_enet_rxbuf_unmap(struct fec_enet_private *fep, cbd_t *bdp, ushort len) -+{ -+ DBG(2, "%s: Unmapping RX buffer %08lx(%u)\n", __FUNCTION__, -+ (unsigned long)bdp->cbd_bufaddr, len); -+ BUG_ON(dma_mapping_error(fep->dma_dev, bdp->cbd_bufaddr)); -+ dma_unmap_single(fep->dma_dev, bdp->cbd_bufaddr, -+ len, DMA_FROM_DEVICE); -+ bdp->cbd_bufaddr = ~0; -+} -+ -+static inline void fec_enet_txbuf_map(struct fec_enet_private *fep, cbd_t *bdp, -+ void *buf, ushort len) -+{ -+ BUG_ON(!dma_mapping_error(fep->dma_dev, bdp->cbd_bufaddr)); -+ bdp->cbd_bufaddr = dma_map_single(fep->dma_dev, buf, -+ len, DMA_TO_DEVICE); -+ DBG(2, "%s: TX buffer %p(%u) mapped to %08lx\n", __FUNCTION__, -+ buf, len, (unsigned long)bdp->cbd_bufaddr); -+} -+ -+static inline void fec_enet_txbuf_unmap(struct fec_enet_private *fep, cbd_t *bdp, ushort len) -+{ -+ DBG(2, "%s: Unmapping TX buffer %08lx(%u)\n", __FUNCTION__, -+ (unsigned long)bdp->cbd_bufaddr, len); -+ BUG_ON(dma_mapping_error(fep->dma_dev, bdp->cbd_bufaddr)); -+ dma_unmap_single(fep->dma_dev, bdp->cbd_bufaddr, -+ len, DMA_TO_DEVICE); -+ bdp->cbd_bufaddr = ~0; -+} -+ -+static inline void fec_enet_txbuf_get(struct fec_enet_private *fep, cbd_t *bdp, ushort len) -+{ -+ DBG(2, "%s: Requesting TX buffer %08lx(%u)\n", __FUNCTION__, -+ (unsigned long)bdp->cbd_bufaddr, len); -+ dma_sync_single_for_cpu(fep->dma_dev, bdp->cbd_bufaddr, -+ len, DMA_TO_DEVICE); -+} -+ -+static inline void fec_enet_txbuf_put(struct fec_enet_private *fep, cbd_t *bdp, ushort len) -+{ -+ DBG(2, "%s: Releasing TX buffer %08lx(%u)\n", __FUNCTION__, -+ (unsigned long)bdp->cbd_bufaddr, len); -+ 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) - { -- struct fec_enet_private *fep; -- volatile fec_t *fecp; -- volatile cbd_t *bdp; -- unsigned short status; -+ struct fec_enet_private *fep = netdev_priv(dev); -+ cbd_t *bdp; -+ unsigned short status; - unsigned long flags; - -- fep = netdev_priv(dev); -- fecp = (volatile fec_t*)dev->base_addr; -- -- if (!fep->link) { -+ if (!fep->linkstatus) { -+ DBG(0, "%s: Cannot send packet; link is down\n", __FUNCTION__); - /* Link is down or autonegotiation is in progress. */ - return 1; - } - -- 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 */ - bdp = fep->cur_tx; - - status = bdp->cbd_sc; --#ifndef final_version -+#ifdef DEBUG - if (status & BD_ENET_TX_READY) { - /* Ooops. All transmit buffers are full. Bail out. - * This should not happen, since dev->tbusy should be set. - */ - printk("%s: tx queue full!.\n", dev->name); -- spin_unlock_irqrestore(&fep->hw_lock, flags); -+ fec_enet_cbd_put(fep); -+ spin_unlock_irqrestore(&fep->lock, flags); - return 1; - } - #endif -- - /* Clear all of the status flags. - */ - status &= ~BD_ENET_TX_STATS; - - /* Set buffer length and buffer pointer. - */ -- 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 - * 4-byte boundaries. Use bounce buffers to copy data - * and get it aligned. Ugh. - */ -- if (bdp->cbd_bufaddr & FEC_ALIGNMENT) { -+ if (unlikely((bdp->cbd_bufaddr) & FEC_ALIGNMENT)) { - unsigned int index; - index = bdp - fep->tx_bd_base; -- memcpy(fep->tx_bounce[index], (void *)skb->data, skb->len); -- bdp->cbd_bufaddr = __pa(fep->tx_bounce[index]); -+ memcpy(fep->tx_bounce[index], skb->data, skb->len); -+ fec_enet_txbuf_map(fep, bdp, fep->tx_bounce[index], skb->len); -+ } else { -+ fec_enet_txbuf_map(fep, bdp, skb->data, skb->len); - } - - /* Save skb pointer. - */ - fep->tx_skbuff[fep->skb_cur] = skb; - -- dev->stats.tx_bytes += skb->len; -- fep->skb_cur = (fep->skb_cur+1) & TX_RING_MOD_MASK; -- -- /* Push the data cache so the CPM does not get stale memory -- * data. -- */ -- dma_sync_single(NULL, bdp->cbd_bufaddr, -- bdp->cbd_datlen, DMA_TO_DEVICE); -+ fep->stats.tx_bytes += skb->len; -+ fep->skb_cur = (fep->skb_cur + 1) & TX_RING_MOD_MASK; - - /* Send it on its way. Tell FEC it's ready, interrupt when done, - * it's the last BD of the frame, and to put the CRC on the end. - */ -- - status |= (BD_ENET_TX_READY | BD_ENET_TX_INTR - | BD_ENET_TX_LAST | BD_ENET_TX_TC); - bdp->cbd_sc = status; - - dev->trans_start = jiffies; - -- /* Trigger transmission start */ -- fecp->fec_x_des_active = 0; -- - /* 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, - - if (bdp == fep->dirty_tx) { - fep->tx_full = 1; -+ DBG(0, "TX ring full, stopping netif queue\n"); - netif_stop_queue(dev); - } - -- 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; - } -@@ -390,101 +640,126 @@ fec_timeout(struct net_device *dev) - { - struct fec_enet_private *fep = netdev_priv(dev); - -- printk("%s: transmit timed out.\n", dev->name); -- dev->stats.tx_errors++; --#ifndef final_version -+ printk(KERN_WARNING "%s: transmit timed out.\n", dev->name); -+ fep->stats.tx_errors++; -+#ifdef DEBUG - { -- int i; -- cbd_t *bdp; -+ int i; -+ cbd_t *bdp; - -- printk("Ring data dump: cur_tx %lx%s, dirty_tx %lx cur_rx: %lx\n", -- (unsigned long)fep->cur_tx, fep->tx_full ? " (full)" : "", -- (unsigned long)fep->dirty_tx, -- (unsigned long)fep->cur_rx); -+ fec_enet_cbd_get(fep); - -- bdp = fep->tx_bd_base; -- printk(" tx: %u buffers\n", TX_RING_SIZE); -- for (i = 0 ; i < TX_RING_SIZE; i++) { -- printk(" %08x: %04x %04x %08x\n", -- (uint) bdp, -- bdp->cbd_sc, -- bdp->cbd_datlen, -- (int) bdp->cbd_bufaddr); -- bdp++; -- } -+ printk(KERN_DEBUG "%s: Ring data dump: cur_tx %p%s, dirty_tx %p cur_rx: %p\n", -+ __FUNCTION__, -+ fep->cur_tx, fep->tx_full ? " (full)" : "", -+ fep->dirty_tx, -+ fep->cur_rx); - -- bdp = fep->rx_bd_base; -- printk(" rx: %lu buffers\n", (unsigned long) RX_RING_SIZE); -- for (i = 0 ; i < RX_RING_SIZE; i++) { -- printk(" %08x: %04x %04x %08x\n", -- (uint) bdp, -- bdp->cbd_sc, -- bdp->cbd_datlen, -- (int) bdp->cbd_bufaddr); -- bdp++; -- } -+ bdp = fep->tx_bd_base; -+ printk(" tx: %u buffers\n", TX_RING_SIZE); -+ for (i = 0; i < TX_RING_SIZE; i++) { -+ printk(" %p: %04x %04x %08x\n", -+ bdp, -+ bdp->cbd_sc, -+ bdp->cbd_datlen, -+ bdp->cbd_bufaddr); -+ bdp++; -+ } -+ -+ bdp = fep->rx_bd_base; -+ printk(" rx: %lu buffers\n", RX_RING_SIZE); -+ for (i = 0; i < RX_RING_SIZE; i++) { -+ printk(" %p: %04x %04x %08x\n", -+ bdp, -+ bdp->cbd_sc, -+ bdp->cbd_datlen, -+ bdp->cbd_bufaddr); -+ bdp++; -+ } -+ fec_enet_cbd_put(fep); - } - #endif - fec_restart(dev, fep->full_duplex); -- netif_wake_queue(dev); -+ DBG(0, "%s: Scheduling netif queue\n", __FUNCTION__); -+ //netif_schedule(dev); - } - - /* The interrupt handler. - * This is called from the MPC core interrupt. - */ - static irqreturn_t --fec_enet_interrupt(int irq, void * dev_id) -+fec_enet_interrupt(int irq, void *dev_id) - { -- struct net_device *dev = dev_id; -- volatile fec_t *fecp; -- uint int_events; -- irqreturn_t ret = IRQ_NONE; -- -- fecp = (volatile fec_t*)dev->base_addr; -+ struct net_device *dev = dev_id; -+ struct fec_enet_private *fep = netdev_priv(dev); -+ uint int_events; -+ int handled = 0; -+ unsigned int eimr = fec_reg_read(fep, FEC_EIMR); - -+ DBG(2, "%s: %08lx:%08lx\n", __FUNCTION__, -+ fec_reg_read(fep, FEC_EIR), fec_reg_read(fep, FEC_EIMR)); - /* Get the interrupt events that caused us to be here. - */ -- do { -- int_events = fecp->fec_ievent; -- fecp->fec_ievent = int_events; -+ while ((int_events = fec_reg_read(fep, FEC_EIR) & FEC_ENET_MASK) != 0) { -+ if (int_events & ~eimr) { -+ printk(KERN_WARNING "%s: masked interrupt condition: %08x\n", -+ __FUNCTION__, int_events & ~eimr); -+ } -+ -+ fec_reg_write(fep, FEC_EIR, int_events); - - /* Handle receive event in its own function. - */ -- if (int_events & FEC_ENET_RXF) { -- ret = IRQ_HANDLED; -+ if (int_events & (FEC_ENET_RXF | FEC_ENET_RXB)) { -+ DBG(2, "%s: Handling RX Interrupt\n", __FUNCTION__); -+ handled = 1; - fec_enet_rx(dev); - } - -+ if (int_events & FEC_ENET_UN) { -+ printk(KERN_WARNING "TX fifo underrun"); -+ } - /* Transmit OK, or non-fatal error. Update the buffer - descriptors. FEC handles all errors, we just discover - them as part of the transmit process. - */ -- if (int_events & FEC_ENET_TXF) { -- ret = IRQ_HANDLED; -+ if (int_events & (FEC_ENET_TXF | FEC_ENET_TXB)) { -+ DBG(2, "%s: Handling TX Interrupt\n", __FUNCTION__); -+ handled = 1; - fec_enet_tx(dev); - } - -- if (int_events & FEC_ENET_MII) { -- ret = IRQ_HANDLED; -+ if (int_events & (FEC_ENET_MII | FEC_ENET_HBERR)) { -+ DBG(2, "%s: Handling MII Interrupt\n", __FUNCTION__); -+ handled = 1; - fec_enet_mii(dev); - } -- -- } while (int_events); -- -- return ret; -+ } -+ return IRQ_RETVAL(handled); - } - -+static void fec_free_skb(struct fec_enet_private *fep, cbd_t *bdp, struct sk_buff **pskb) -+{ -+ struct sk_buff *skb = *pskb; -+ if (!dma_mapping_error(fep->dma_dev, bdp->cbd_bufaddr)) { -+ fec_enet_txbuf_unmap(fep, bdp, skb->len); -+ } -+ dev_kfree_skb_any(skb); -+ *pskb = NULL; -+} - - static void - fec_enet_tx(struct net_device *dev) - { -- struct fec_enet_private *fep; -- volatile cbd_t *bdp; -+ struct fec_enet_private *fep = netdev_priv(dev); -+ cbd_t *bdp; - unsigned short status; -- struct sk_buff *skb; -+ struct sk_buff *skb; - -- fep = netdev_priv(dev); -- 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) - if (status & (BD_ENET_TX_HB | BD_ENET_TX_LC | - BD_ENET_TX_RL | BD_ENET_TX_UN | - BD_ENET_TX_CSL)) { -- dev->stats.tx_errors++; -+ fep->stats.tx_errors++; - if (status & BD_ENET_TX_HB) /* No heartbeat */ -- dev->stats.tx_heartbeat_errors++; -+ fep->stats.tx_heartbeat_errors++; - if (status & BD_ENET_TX_LC) /* Late collision */ -- dev->stats.tx_window_errors++; -+ fep->stats.tx_window_errors++; - if (status & BD_ENET_TX_RL) /* Retrans limit */ -- dev->stats.tx_aborted_errors++; -+ fep->stats.tx_aborted_errors++; - if (status & BD_ENET_TX_UN) /* Underrun */ -- dev->stats.tx_fifo_errors++; -+ fep->stats.tx_fifo_errors++; - if (status & BD_ENET_TX_CSL) /* Carrier lost */ -- dev->stats.tx_carrier_errors++; -+ fep->stats.tx_carrier_errors++; - } else { -- dev->stats.tx_packets++; -+ fep->stats.tx_packets++; - } - --#ifndef final_version -+#ifdef DEBUG - 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) - * 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); -- fep->tx_skbuff[fep->skb_dirty] = NULL; -+ fec_free_skb(fep, bdp, &fep->tx_skbuff[fep->skb_dirty]); - 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) - */ - if (fep->tx_full) { - fep->tx_full = 0; -- if (netif_queue_stopped(dev)) -+ if (netif_queue_stopped(dev)) { -+ DBG(0, "%s: Waking up netif queue\n", __FUNCTION__); - netif_wake_queue(dev); -+ } - } - } -- fep->dirty_tx = (cbd_t *)bdp; -- spin_unlock_irq(&fep->hw_lock); -+ fec_enet_cbd_put(fep); -+ fep->dirty_tx = bdp; -+ spin_unlock(&fep->lock); - } - - -@@ -555,22 +834,22 @@ fec_enet_tx(struct net_device *dev) - static void - fec_enet_rx(struct net_device *dev) - { -- struct fec_enet_private *fep; -- volatile fec_t *fecp; -- volatile cbd_t *bdp; -+ struct fec_enet_private *fep = netdev_priv(dev); -+ cbd_t *bdp; - unsigned short status; -- struct sk_buff *skb; -- ushort pkt_len; -- __u8 *data; -+ struct sk_buff *skb; -+ ushort pkt_len; -+ int rx_index; - - #ifdef CONFIG_M532x -+ /* This is probably nonsense -+ Proper use of dma-mapping functions should make this obsolete -+ */ - flush_cache_all(); - #endif -- -- fep = netdev_priv(dev); -- fecp = (volatile fec_t*)dev->base_addr; -- -- spin_lock_irq(&fep->hw_lock); -+ /* reserve the dual port memory area for our use */ -+ //WARN_ON(fec_reg_read(fep, FEC_RDAR) & RDAR_BUSY); -+ fec_enet_cbd_get(fep); - - /* 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) - bdp = fep->cur_rx; - - while (!((status = bdp->cbd_sc) & BD_ENET_RX_EMPTY)) { -- --#ifndef final_version -+ rx_index = bdp - fep->rx_bd_base; -+#ifdef DEBUG - /* Since we have allocated space to hold a complete frame, - * the last indicator should be set. - */ -- if ((status & BD_ENET_RX_LAST) == 0) -- printk("FEC ENET: rcv is not +last\n"); -+ WARN_ON(!(status & BD_ENET_RX_LAST)); - #endif - -- if (!fep->opened) -+ if (WARN_ON(!fep->opened)) { -+ DBG(0, "%s: Driver not opened; ignoring packet\n", __FUNCTION__); -+#if 0 - goto rx_processing_done; -- -+#endif -+ } - /* Check for errors. */ - if (status & (BD_ENET_RX_LG | BD_ENET_RX_SH | BD_ENET_RX_NO | - BD_ENET_RX_CR | BD_ENET_RX_OV)) { -- dev->stats.rx_errors++; -+ fep->stats.rx_errors++; - if (status & (BD_ENET_RX_LG | BD_ENET_RX_SH)) { - /* Frame too long or too short. */ -- dev->stats.rx_length_errors++; -+ fep->stats.rx_length_errors++; - } - if (status & BD_ENET_RX_NO) /* Frame alignment */ -- dev->stats.rx_frame_errors++; -+ fep->stats.rx_frame_errors++; - if (status & BD_ENET_RX_CR) /* CRC Error */ -- dev->stats.rx_crc_errors++; -+ fep->stats.rx_crc_errors++; - if (status & BD_ENET_RX_OV) /* FIFO overrun */ -- dev->stats.rx_fifo_errors++; -+ fep->stats.rx_fifo_errors++; - } - - /* Report late collisions as a frame error. -@@ -611,39 +892,91 @@ 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) { -- dev->stats.rx_errors++; -- dev->stats.rx_frame_errors++; -+ 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 - /* Process the incoming frame. - */ -- dev->stats.rx_packets++; -+ fep->stats.rx_packets++; - pkt_len = bdp->cbd_datlen; -- dev->stats.rx_bytes += pkt_len; -- data = (__u8*)__va(bdp->cbd_bufaddr); -- -- dma_sync_single(NULL, (unsigned long)__pa(data), -- pkt_len - 4, DMA_FROM_DEVICE); -+ fep->stats.rx_bytes += pkt_len; - - /* This does 16 byte alignment, exactly what we need. - * The packet length includes FCS, but we don't want to - * include that when passing upstream as it messes up - * bridging applications. - */ -- skb = dev_alloc_skb(pkt_len-4); -+ if ((pkt_len - 4) < fec_copy_threshold) { -+ skb = dev_alloc_skb(pkt_len); -+ } else { -+ skb = dev_alloc_skb(FEC_ENET_RX_FRSIZE); -+ } - - if (skb == NULL) { - printk("%s: Memory squeeze, dropping packet.\n", dev->name); -- dev->stats.rx_dropped++; -+ fep->stats.rx_dropped++; - } else { -- skb_put(skb,pkt_len-4); /* Make room */ -- skb_copy_to_linear_data(skb, data, pkt_len-4); -- skb->protocol=eth_type_trans(skb,dev); -+ if ((pkt_len - 4) < fec_copy_threshold) { -+ /* skip 2 bytes, so IP header is on a 4 bytes boundary */ -+ skb_reserve(skb, 2); -+ skb_put(skb, pkt_len - 4); /* Make room */ -+ fec_enet_rxbuf_get(fep, bdp, pkt_len - 4); -+ skb_copy_to_linear_data(skb, -+ fep->rx_skbuff[rx_index]->data, -+ pkt_len - 4); -+ fec_enet_rxbuf_put(fep, bdp, pkt_len - 4); -+ } else { -+ struct sk_buff *pskb = fep->rx_skbuff[rx_index]; -+ -+ /* unmap the skb we are going to hand down to the network layer */ -+ fec_enet_rxbuf_unmap(fep, bdp, FEC_ENET_RX_FRSIZE); -+ -+ /* init the newly allocated skb */ -+ fep->rx_skbuff[rx_index] = skb; -+ skb->data = FEC_ADDR_ALIGNMENT(skb->data); -+ /* map the newly allocated skb's data buffer for DMA */ -+ fec_enet_rxbuf_map(fep, bdp, skb->data, FEC_ENET_RX_FRSIZE); -+ -+ skb_put(pskb, pkt_len - 4); /* Make room */ -+ skb = pskb; -+ } -+ skb->dev = dev; -+ skb->protocol = eth_type_trans(skb, dev); - netif_rx(skb); - } - 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 - status |= BD_ENET_RX_EMPTY; - bdp->cbd_sc = status; - -+ /* release the dual port memory area for use by the FEC hardware */ -+ fec_enet_cbd_put(fep); -+ - /* Update BD pointer to next entry. - */ - if (status & BD_ENET_RX_WRAP) -@@ -665,10 +1001,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. - */ -- fecp->fec_r_des_active = 0; -+ fec_reg_write(fep, FEC_RDAR, DONT_CARE); - #endif - } /* while (!((status = bdp->cbd_sc) & BD_ENET_RX_EMPTY)) */ -- fep->cur_rx = (cbd_t *)bdp; -+ fep->cur_rx = bdp; - - #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 - * our way back to the interrupt return only to come right back - * here. - */ -- fecp->fec_r_des_active = 0; -+ fec_reg_write(fep, FEC_RDAR, DONT_CARE); - #endif -- -- spin_unlock_irq(&fep->hw_lock); - } - -- -+#ifdef CONFIG_PHYLIB - /* called from interrupt context */ -+static void fec_enet_mii(struct net_device *dev) -+{ -+ struct fec_enet_private *fep = netdev_priv(dev); -+ fep->mii_complete = 1; -+} -+#else - static void - fec_enet_mii(struct net_device *dev) - { -- struct fec_enet_private *fep; -- volatile fec_t *ep; -+ struct fec_enet_private *fep = netdev_priv(dev); - mii_list_t *mip; - uint mii_reg; - -- fep = netdev_priv(dev); -- spin_lock_irq(&fep->mii_lock); -+ mii_reg = fec_reg_read(fep, FEC_MMFR); - -- ep = fep->hwp; -- mii_reg = ep->fec_mii_data; -+ spin_lock(&fep->lock); - - if ((mip = mii_head) == NULL) { - printk("MII and no head!\n"); -@@ -713,27 +1050,27 @@ fec_enet_mii(struct net_device *dev) - mii_free = mip; - - if ((mip = mii_head) != NULL) -- ep->fec_mii_data = mip->mii_regval; -+ fec_reg_write(fep, FEC_MMFR, mip->mii_regval); - - unlock: -- spin_unlock_irq(&fep->mii_lock); -+ spin_unlock(&fep->lock); - } - - static int - mii_queue(struct net_device *dev, int regval, void (*func)(uint, struct net_device *)) - { -- struct fec_enet_private *fep; -+ struct fec_enet_private *fep = netdev_priv(dev); - unsigned long flags; - mii_list_t *mip; - int retval; - -+ retval = 0; -+ -+ spin_lock_irqsave(&fep->lock,flags); -+ - /* Add PHY address to register command. - */ -- fep = netdev_priv(dev); -- spin_lock_irqsave(&fep->mii_lock, flags); -- - regval |= fep->phy_addr << 23; -- retval = 0; - - if ((mip = mii_free) != NULL) { - mii_free = mip->mii_next; -@@ -745,32 +1082,32 @@ mii_queue(struct net_device *dev, int re - mii_tail = mip; - } else { - mii_head = mii_tail = mip; -- fep->hwp->fec_mii_data = regval; -+ fec_reg_write(fep, FEC_MMFR, regval); - } - } else { - retval = 1; - } - -- spin_unlock_irqrestore(&fep->mii_lock, flags); -- return retval; -+ spin_unlock_irqrestore(&fep->lock,flags); -+ -+ return(retval); - } - - static void mii_do_cmd(struct net_device *dev, const phy_cmd_t *c) - { -- if(!c) -- return; -+ int k; - -- for (; c->mii_data != mk_mii_end; c++) -- mii_queue(dev, c->mii_data, c->funct); -+ for (k = 0; c != NULL && c[k].mii_data != mk_mii_end; k++) { -+ mii_queue(dev, c[k].mii_data, c[k].funct); -+ } - } - - static void mii_parse_sr(uint mii_reg, struct net_device *dev) - { - struct fec_enet_private *fep = netdev_priv(dev); -- volatile uint *s = &(fep->phy_status); - uint status; - -- status = *s & ~(PHY_STAT_LINK | PHY_STAT_FAULT | PHY_STAT_ANC); -+ status = fep->phy_status & ~(PHY_STAT_LINK | PHY_STAT_FAULT | PHY_STAT_ANC); - - if (mii_reg & 0x0004) - status |= PHY_STAT_LINK; -@@ -778,31 +1115,30 @@ static void mii_parse_sr(uint mii_reg, s - status |= PHY_STAT_FAULT; - if (mii_reg & 0x0020) - status |= PHY_STAT_ANC; -- *s = status; -+ -+ fep->phy_status = status; - } - - static void mii_parse_cr(uint mii_reg, struct net_device *dev) - { - struct fec_enet_private *fep = netdev_priv(dev); -- volatile uint *s = &(fep->phy_status); - uint status; - -- status = *s & ~(PHY_CONF_ANE | PHY_CONF_LOOP); -+ status = fep->phy_status & ~(PHY_CONF_ANE | PHY_CONF_LOOP); - - if (mii_reg & 0x1000) - status |= PHY_CONF_ANE; - if (mii_reg & 0x4000) - status |= PHY_CONF_LOOP; -- *s = status; -+ fep->phy_status = status; - } - - static void mii_parse_anar(uint mii_reg, struct net_device *dev) - { - struct fec_enet_private *fep = netdev_priv(dev); -- volatile uint *s = &(fep->phy_status); - uint status; - -- status = *s & ~(PHY_CONF_SPMASK); -+ status = fep->phy_status & ~(PHY_CONF_SPMASK); - - if (mii_reg & 0x0020) - status |= PHY_CONF_10HDX; -@@ -812,7 +1148,7 @@ static void mii_parse_anar(uint mii_reg, - status |= PHY_CONF_100HDX; - if (mii_reg & 0x00100) - status |= PHY_CONF_100FDX; -- *s = status; -+ fep->phy_status = status; - } - - /* ------------------------------------------------------------------------- */ -@@ -827,10 +1163,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); -- volatile uint *s = &(fep->phy_status); - uint status; - -- status = *s & ~(PHY_STAT_SPMASK); -+ status = fep->phy_status & ~(PHY_STAT_SPMASK); - if (mii_reg & 0x0800) { - if (mii_reg & 0x1000) - status |= PHY_STAT_100FDX; -@@ -842,7 +1177,7 @@ static void mii_parse_lxt970_csr(uint mi - else - status |= PHY_STAT_10HDX; - } -- *s = status; -+ fep->phy_status = status; - } - - static phy_cmd_t const phy_cmd_lxt970_config[] = { -@@ -898,16 +1233,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); -- volatile uint *s = &(fep->phy_status); - uint status; - -- status = *s & ~(PHY_STAT_SPMASK | PHY_STAT_LINK | PHY_STAT_ANC); -+ status = fep->phy_status & ~(PHY_STAT_SPMASK | PHY_STAT_LINK | PHY_STAT_ANC); - - if (mii_reg & 0x0400) { -- fep->link = 1; -+ fep->linkstatus = 1; - status |= PHY_STAT_LINK; - } else { -- fep->link = 0; -+ fep->linkstatus = 0; - } - if (mii_reg & 0x0080) - status |= PHY_STAT_ANC; -@@ -925,7 +1259,7 @@ static void mii_parse_lxt971_sr2(uint mi - if (mii_reg & 0x0008) - status |= PHY_STAT_FAULT; - -- *s = status; -+ fep->phy_status = status; - } - - static phy_cmd_t const phy_cmd_lxt971_config[] = { -@@ -982,10 +1316,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); -- volatile uint *s = &(fep->phy_status); - uint status; - -- status = *s & ~(PHY_STAT_SPMASK); -+ status = fep->phy_status & ~(PHY_STAT_SPMASK); - - switch((mii_reg >> 2) & 7) { - case 1: status |= PHY_STAT_10HDX; break; -@@ -994,7 +1327,7 @@ static void mii_parse_qs6612_pcr(uint mi - case 6: status |= PHY_STAT_100FDX; break; - } - -- *s = status; -+ fep->phy_status = status; - } - - static phy_cmd_t const phy_cmd_qs6612_config[] = { -@@ -1052,10 +1385,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); -- volatile uint *s = &(fep->phy_status); - uint status; - -- status = *s & ~(PHY_STAT_SPMASK | PHY_STAT_ANC); -+ status = fep->phy_status & ~(PHY_STAT_SPMASK | PHY_STAT_ANC); - - if (mii_reg & 0x0080) - status |= PHY_STAT_ANC; -@@ -1064,7 +1396,7 @@ static void mii_parse_am79c874_dr(uint m - else - status |= ((mii_reg & 0x0800) ? PHY_STAT_10FDX : PHY_STAT_10HDX); - -- *s = status; -+ fep->phy_status = status; - } - - static phy_cmd_t const phy_cmd_am79c874_config[] = { -@@ -1107,7 +1439,7 @@ static phy_info_t const phy_info_am79c87 - /* register definitions for the 8721 */ - - #define MII_KS8721BL_RXERCR 21 --#define MII_KS8721BL_ICSR 27 -+#define MII_KS8721BL_ICSR 22 - #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 - static void mii_parse_dp8384x_sr2(uint mii_reg, struct net_device *dev) - { - struct fec_enet_private *fep = netdev_priv(dev); -- volatile uint *s = &(fep->phy_status); - -- *s &= ~(PHY_STAT_SPMASK | PHY_STAT_LINK | PHY_STAT_ANC); -+ fep->phy_status &= ~(PHY_STAT_SPMASK | PHY_STAT_LINK | PHY_STAT_ANC); - - /* Link up */ - if (mii_reg & 0x0001) { -- fep->link = 1; -- *s |= PHY_STAT_LINK; -+ fep->linkstatus = 1; -+ fep->phy_status |= PHY_STAT_LINK; - } else -- fep->link = 0; -+ fep->linkstatus = 0; - /* Status of link */ - if (mii_reg & 0x0010) /* Autonegotioation complete */ -- *s |= PHY_STAT_ANC; -+ fep->phy_status |= PHY_STAT_ANC; - if (mii_reg & 0x0002) { /* 10MBps? */ - if (mii_reg & 0x0004) /* Full Duplex? */ -- *s |= PHY_STAT_10FDX; -+ fep->phy_status |= PHY_STAT_10FDX; - else -- *s |= PHY_STAT_10HDX; -+ fep->phy_status |= PHY_STAT_10HDX; - } else { /* 100 Mbps? */ - if (mii_reg & 0x0004) /* Full Duplex? */ -- *s |= PHY_STAT_100FDX; -+ fep->phy_status |= PHY_STAT_100FDX; - else -- *s |= PHY_STAT_100HDX; -+ fep->phy_status |= PHY_STAT_100HDX; - } - if (mii_reg & 0x0008) -- *s |= PHY_STAT_FAULT; -+ fep->phy_status |= PHY_STAT_FAULT; - } - - static phy_info_t phy_info_dp83848= { -@@ -1211,92 +1542,362 @@ static phy_info_t const * const phy_info - &phy_info_dp83848, - NULL - }; -- --/* ------------------------------------------------------------------------- */ --#ifdef HAVE_mii_link_interrupt --static irqreturn_t --mii_link_interrupt(int irq, void * dev_id); -+#endif - - /* -- * This is specific to the MII interrupt setup of the M5272EVB. -+ * do some initializtion based architecture of this chip -+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; --} --#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) -+ 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__, -+ fep->linkstatus, phydev->link, fep->full_duplex ? "full" : "half", -+ phydev->duplex ? "full" : "half"); -+ if (phydev->link) { -+ fec_restart(dev, phydev->duplex); -+ } else { -+ fec_stop(dev); -+ } -+ if (fep->linkstatus != phydev->link && netif_msg_link(fep)) { -+ phy_print_status(phydev); -+ } -+ fep->linkstatus = phydev->link; -+#if 0 -+ int i; -+ for (i = 0; i < 32; i++) { -+ DBG(0, "%s: PHY reg[%02x]=%04x\n", __FUNCTION__, i, -+ fec_mii_read(fep->mii, fep->phy_addr, i)); -+ } -+#endif -+ } -+} -+#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; -+ 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; -+ } -+ fec_restart(dev, duplex); -+ 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]; -+ 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 fec_phy_timer(unsigned long data) - { -+ struct net_device *dev = (struct net_device *)data; - struct fec_enet_private *fep = netdev_priv(dev); -- volatile uint *s = &(fep->phy_status); -+ 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 -+ -+/* -+ * 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); -+ -+ fep->etn_irq = platform_get_irq(pdev, 0); -+ fep->mii_irq = platform_get_irq(pdev, 1); -+ -+ /* Setup interrupt handlers. */ -+ ret = request_irq(fep->etn_irq, fec_enet_interrupt, 0, "fec", dev); -+ if (ret != 0) { -+ printk(KERN_ERR "FEC: Could not allocate FEC IRQ(%d)!\n", fep->etn_irq); -+ return ret; -+ } -+#ifndef CONFIG_PHYLIB -+ if (fep->mii_irq >= 0) { -+ /* TODO: disable now due to CPLD issue */ -+ ret = request_irq(fep->mii_irq, mii_link_interrupt, 0, "fec(MII)", dev); -+ if (ret != 0) { -+ printk(KERN_ERR "FEC: Could not allocate FEC(MII) IRQ(%d)!\n", -+ fep->mii_irq); -+ free_irq(fep->etn_irq, dev); -+ return ret; -+ } -+ /* -+ * 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. -+ */ -+ fep->phy_int_enabled = 1; -+ } else { -+ fep->phy_timer = kzalloc(sizeof(struct timer_list), GFP_KERNEL); -+ if (fep->phy_timer == NULL) { -+ free_irq(fep->etn_irq, dev); -+ return -ENOMEM; -+ } -+ init_timer(fep->phy_timer); -+ fep->phy_timer->function = fec_phy_timer; -+ fep->phy_timer->data = (unsigned long)dev; -+ fec_link_change(dev); -+ } -+#endif -+ -+ return 0; -+} -+ -+static void fec_release_intrs(struct net_device *dev) -+{ -+ struct fec_enet_private *fep = netdev_priv(dev); -+ -+ free_irq(fep->etn_irq, dev); -+#ifndef CONFIG_PHYLIB -+ if (fep->mii_irq >= 0) { -+ free_irq(fep->mii_irq, dev); -+ } -+#endif -+} -+ -+#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 -+ -+#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) -+ -+#ifndef DEBUG -+static inline unsigned long fec_reg_read16(struct fec_enet_private *fep, unsigned int reg) -+{ -+ return readw(fep->reg_base + reg); -+} -+ -+static inline void fec_reg_write(struct fec_enet_private *fep, unsigned int reg, unsigned long val) -+{ -+ writew(val, fep->reg_base + reg); -+} -+#else -+#define fec_reg_read16(fep, reg) __fec_reg_read16(fep, reg, __FUNCTION__, #reg) -+#define fec_reg_write16(fep, reg, val) __fec_reg_write16(fep, reg, val, __FUNCTION__, #reg) -+ -+static inline u16 __fec_reg_read16(struct fec_enet_private *fep, unsigned int reg, -+ const char *func, const char *reg_name) -+{ -+ u16 val = readw(fep->reg_base + reg); -+ DBG(0, "%s: Read %04x from %s(%03x)\n", func, val, reg_name, reg); -+ return val; -+} -+ -+static inline void __fec_reg_write16(struct fec_enet_private *fep, unsigned int reg, -+ u16 val, const char *func, const char *reg_name) -+{ -+ DBG(0, "%s: Writing %04x to %s(%03x)\n", func, val, reg_name, reg); -+ writew(val, fep->reg_base + reg); -+} -+#endif -+ -+static void fec_localhw_setup(struct net_device *dev) -+{ -+ struct fec_enet_private *fep = netdev_priv(dev); -+ int loops; -+ const int max_loops = 10000; -+ -+ /* -+ * Set up the MII gasket for RMII mode -+ */ -+ dev_dbg(&dev->dev, "enable RMII gasket\n"); -+ -+ /* disable the gasket and wait */ -+ fec_reg_write16(fep, FEC_MIIGSK_ENR, 0); -+ DBG(0, "%s: Waiting for RMII gasket idle\n", __FUNCTION__); -+ while (fec_reg_read16(fep, FEC_MIIGSK_ENR) & FEC_MIIGSK_ENR_READY) -+ udelay(1); -+ DBG(0, "%s: RMII gasket idle\n", __FUNCTION__); -+ -+ /* 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); -+ -+#if 1 -+ DBG(0, "%s: Waiting for RMII gasket ready\n", __FUNCTION__); -+ for (loops = 0; loops < max_loops; loops++) { -+ if (readw(fep->reg_base + FEC_MIIGSK_ENR) & FEC_MIIGSK_ENR_READY) -+ break; -+ udelay(1); -+ } -+ if (fec_reg_read16(fep, FEC_MIIGSK_ENR) & FEC_MIIGSK_ENR_READY) { -+ DBG(0, "%s: RMII gasket ready after %u loops\n", __FUNCTION__, loops); -+ } else { -+ DBG(0, "%s: RMII gasket NOT ready after %u loops\n", __FUNCTION__, loops); -+ } -+#endif -+} -+#else -+static inline void fec_localhw_setup(struct net_device *dev) -+{ -+} -+#endif -+ -+static int fec_set_mii(struct net_device *dev, struct fec_enet_private *fep) -+{ -+ unsigned long rate; -+ struct clk *clk; -+ -+ DBG(0, "%s: \n", __FUNCTION__); -+ -+ fec_reg_write(fep, FEC_RCR, OPT_FRAME_SIZE | RCR_MII_MODE); -+ fec_reg_write(fep, FEC_TCR, 0x00); -+ -+ /* -+ * Set MII speed to 2.5 MHz -+ */ -+ clk = clk_get(fep->dma_dev, NULL); -+ if (!IS_ERR(clk)) { -+ rate = clk_get_rate(clk); -+ clk_put(clk); -+ } else { -+ printk(KERN_ERR "Failed to get fec clock: %ld\n", PTR_ERR(clk)); -+ return PTR_ERR(clk); -+ } -+ fep->phy_speed = ((((rate + 4999999) / 2500000) / 2) & 0x3F) << 1; -+ fec_reg_write(fep, FEC_MSCR, fep->phy_speed); -+ DBG(0, "%s: clkdiv set to %u for MII clock %u at base clock %lu\n", -+ __FUNCTION__, fep->phy_speed >> 1, 2500000, rate); -+ DBG(0, "%s: actual MII clock is: %lu\n", __FUNCTION__, rate / (fep->phy_speed)); -+ -+ return 0; -+} -+ -+static const unsigned char default_mac[ETH_ALEN] = { -+ 0x00, 0x04, 0x9f, 0x00, 0x74, 0x4a, -+}; -+ -+#define FEC_IIM_BASE IO_ADDRESS(IIM_BASE_ADDR) -+static void fec_get_mac(struct net_device *dev) -+{ -+#if 1 -+ // keep bootloader assigned MAC address -+ struct fec_enet_private *fep = netdev_priv(dev); -+ unsigned long eth_addr = fec_reg_read(fep, FEC_PALR); -+ dev->dev_addr[0] = eth_addr >> 24; -+ dev->dev_addr[1] = eth_addr >> 16; -+ dev->dev_addr[2] = eth_addr >> 8; -+ dev->dev_addr[3] = eth_addr >> 0; -+ eth_addr = fec_reg_read(fep, FEC_PAUR); -+ dev->dev_addr[5] = eth_addr >> 16; -+ dev->dev_addr[4] = eth_addr >> 24; -+#else -+ int i; -+ unsigned long fec_mac_base = FEC_IIM_BASE + MXC_IIMKEY0; -+ -+ if (cpu_is_mx27_rev(CHIP_REV_2_0) > 0) { -+ fec_mac_base = FEC_IIM_BASE + MXC_IIMMAC; -+ } -+ -+ DBG(0, "%s: Reading MAC address from %08lx\n", __FUNCTION__, fec_mac_base); -+ for (i = 0; i < ETH_ALEN; i++) { -+ dev->dev_addr[ETH_ALEN - 1 - i] = __raw_readb(fec_mac_base + i * 4); -+ } -+ //memcpy(dev->dev_addr, default_mac, ETH_ALEN); -+#endif -+} -+ -+#ifdef CONFIG_PHYLIB -+static inline void fec_enable_phy_intr(struct fec_enet_private *fep) -+{ -+} -+static inline void fec_disable_phy_intr(struct fec_enet_private *fep) -+{ -+} -+static inline void fec_phy_ack_intr(struct fec_enet_private *fep) -+{ -+} -+#else -+static inline void fec_enable_phy_intr(struct fec_enet_private *fep) -+{ -+ if (!fep->phy_int_enabled) { -+ fep->phy_int_enabled = 1; -+ enable_irq(fep->mii_irq); -+ } -+} -+ -+static inline void fec_disable_phy_intr(struct fec_enet_private *fep) -+{ -+ if (fep->phy_int_enabled) { -+ disable_irq(fep->mii_irq); -+ fep->phy_int_enabled = 0; -+ } -+} -+ -+static inline void fec_phy_ack_intr(struct fec_enet_private *fep) -+{ -+ if (fep->phy_int_enabled) { -+ disable_irq(fep->mii_irq); -+ fep->phy_int_enabled = 0; -+ } -+} -+#endif -+ -+/* ------------------------------------------------------------------------- */ -+ -+#ifndef CONFIG_PHYLIB -+static void mii_display_status(struct net_device *dev) -+{ -+ struct fec_enet_private *fep = netdev_priv(dev); -+ -+ if (!fep->linkstatus && !fep->old_linkstatus) { -+ /* Link is still down - don't print anything */ - return; - } - - printk("%s: status: ", dev->name); - -- if (!fep->link) { -+ if (!fep->linkstatus) { - printk("link down"); - } else { - printk("link up"); - -- switch(*s & PHY_STAT_SPMASK) { -+ 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) -+ if (fep->phy_status & PHY_STAT_ANC) - printk(", auto-negotiation complete"); - } - -- if (*s & PHY_STAT_FAULT) -+ if (fep->phy_status & PHY_STAT_FAULT) - printk(", remote fault"); - - printk(".\n"); - } - --static void mii_display_config(struct work_struct *work) -+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; - - /* -@@ -1326,7 +1926,7 @@ static void mii_display_config(struct wo - ** the workqueue. It is thus safe to allow to reuse it. - */ - fep->mii_phy_task_queued = 0; -- printk("%s: config: auto-negotiation ", dev->name); -+ //printk("%s: config: auto-negotiation ", dev->name); - - if (status & PHY_CONF_ANE) - printk("on"); -@@ -1351,11 +1951,21 @@ static void mii_display_config(struct wo - - fep->sequence_done = 1; - } -+#endif - --static void mii_relink(struct work_struct *work) -+#ifndef CONFIG_PHYLIB -+static inline void *priv_netdev(struct fec_enet_private *fep) - { -- struct fec_enet_private *fep = container_of(work, struct fec_enet_private, phy_task); -- struct net_device *dev = fep->netdev; -+ /* ugly hack, stolen from include linux/netdevice.h */ -+ return (char *)fep - ((sizeof(struct net_device) -+ + NETDEV_ALIGN_CONST) -+ & ~NETDEV_ALIGN_CONST); -+} -+ -+static void mii_relink(struct work_struct *w) -+{ -+ struct fec_enet_private *fep = container_of(w, struct fec_enet_private, phy_task); -+ struct net_device *dev = priv_netdev(fep); - int duplex; - - /* -@@ -1363,23 +1973,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; -- fep->link = (fep->phy_status & PHY_STAT_LINK) ? 1 : 0; -+ fep->linkstatus = (fep->phy_status & PHY_STAT_LINK) ? 1 : 0; - mii_display_status(dev); -- fep->old_link = fep->link; -+ fep->old_linkstatus = fep->linkstatus; - -- if (fep->link) { -+ if (fep->linkstatus) { - duplex = 0; -- if (fep->phy_status -- & (PHY_STAT_100FDX | PHY_STAT_10FDX)) -+ if (fep->phy_status & (PHY_STAT_100FDX | PHY_STAT_10FDX)) { - duplex = 1; -+ } - fec_restart(dev, duplex); -- } else -+ } else { - fec_stop(dev); -- --#if 0 -- enable_irq(fep->mii_irq); --#endif -- -+ } - } - - /* mii_queue_relink is called in interrupt context from mii_link_interrupt */ -@@ -1429,15 +2035,14 @@ phy_cmd_t const phy_cmd_config[] = { - static void - mii_discover_phy3(uint mii_reg, struct net_device *dev) - { -- struct fec_enet_private *fep; -+ struct fec_enet_private *fep = netdev_priv(dev); - int i; - -- fep = netdev_priv(dev); - fep->phy_id |= (mii_reg & 0xffff); - printk("fec: PHY @ 0x%x, ID 0x%08x", fep->phy_addr, fep->phy_id); - -- for(i = 0; phy_info[i]; i++) { -- if(phy_info[i]->id == (fep->phy_id >> 4)) -+ for (i = 0; phy_info[i]; i++) { -+ if (phy_info[i]->id == (fep->phy_id >> 4)) - break; - } - -@@ -1456,13 +2061,9 @@ mii_discover_phy3(uint mii_reg, struct n - static void - mii_discover_phy(uint mii_reg, struct net_device *dev) - { -- struct fec_enet_private *fep; -- volatile fec_t *fecp; -+ struct fec_enet_private *fep = netdev_priv(dev); - uint phytype; - -- fep = netdev_priv(dev); -- fecp = fep->hwp; -- - 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 - */ - fep->phy_id = phytype << 16; - mii_queue(dev, mk_mii_read(MII_REG_PHYIR2), -- mii_discover_phy3); -+ mii_discover_phy3); - } else { - fep->phy_addr++; - mii_queue(dev, mk_mii_read(MII_REG_PHYIR1), -- mii_discover_phy); -+ mii_discover_phy); - } - } else { - printk("FEC: No PHY device found.\n"); - /* Disable external MII interface */ -- fecp->fec_mii_speed = fep->phy_speed = 0; --#ifdef HAVE_mii_link_interrupt -- fec_disable_phy_intr(); --#endif -+ fec_disable_phy_intr(fep); -+ fec_reg_write(fep, FEC_MSCR, 0); - } - } -+#endif - --/* This interrupt occurs when the PHY detects a link change. --*/ --#ifdef HAVE_mii_link_interrupt -+#ifndef CONFIG_PHYLIB - static irqreturn_t --mii_link_interrupt(int irq, void * dev_id) -+mii_link_interrupt(int irq, void *dev_id) - { -- struct net_device *dev = dev_id; -+ struct net_device *dev = dev_id; - struct fec_enet_private *fep = netdev_priv(dev); - -- fec_phy_ack_intr(); -+ DBG(0, "%s: \n", __FUNCTION__); - --#if 0 -- disable_irq(fep->mii_irq); /* disable now, enable later */ --#endif -+ fec_phy_ack_intr(fep); - -- mii_do_cmd(dev, fep->phy->ack_int); -- mii_do_cmd(dev, phy_cmd_relink); /* restart and display status */ -+ /* -+ * Some board will trigger phy interrupt before phy enable. -+ * And at that moment , fep->phy is not initialized. -+ */ -+ if (fep->phy) { -+ mii_do_cmd(dev, fep->phy->ack_int); -+ mii_do_cmd(dev, phy_cmd_relink); /* restart and display status */ -+ } - - return IRQ_HANDLED; - } -@@ -1511,16 +2113,31 @@ mii_link_interrupt(int irq, void * dev_i - static int - fec_enet_open(struct net_device *dev) - { -+ int ret = 0; - struct fec_enet_private *fep = netdev_priv(dev); - - /* I should reset the ring buffers here, but I don't yet know - * a simple way to do that. - */ -- fec_set_mac_address(dev); -+ DBG(0, "%s: \n", __FUNCTION__); -+ _fec_set_mac_address(dev); - -- fep->sequence_done = 0; -- fep->link = 0; -+#ifdef CONFIG_PHYLIB -+ fec_restart(dev, 0); - -+ ret = fec_connect_phy(dev, fep); -+ if (ret != 0) { -+ DBG(0, "%s: Failed to connect to PHY: %d\n", __FUNCTION__, ret); -+ return ret; -+ } -+ phy_start(fep->phy); -+ -+ fep->linkstatus = fep->phy->link; -+ //fec_restart(dev, 0); -+ DBG(0, "%s: Link status is: %d\n", __FUNCTION__, fep->linkstatus); -+#else -+ fep->linkstatus = 0; -+ fep->sequence_done = 0; - 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) - * based on this device does not implement a PHY interrupt, - * so we are never notified of link change. - */ -- fep->link = 1; -+ fep->linkstatus = 1; - } else { -- fep->link = 1; /* lets just try it and see */ -+ fep->linkstatus = 1; /* lets just try it and see */ - /* no phy, go full duplex, it's most likely a hub chip */ - fec_restart(dev, 1); - } -- -- netif_start_queue(dev); -+ fep->old_linkstatus = fep->linkstatus; -+#endif - fep->opened = 1; -- return 0; /* Success */ -+#if 1 -+ /* enable receiver */ -+ fec_reg_write(fep, FEC_RDAR, DONT_CARE); -+#endif -+ return ret; - } - - static int -@@ -1559,15 +2180,46 @@ fec_enet_close(struct net_device *dev) - { - struct fec_enet_private *fep = netdev_priv(dev); - -- /* Don't know what to do yet. -- */ -+ DBG(0, "%s: \n", __FUNCTION__); -+ - fep->opened = 0; -- netif_stop_queue(dev); -- fec_stop(dev); -+ if (fep->linkstatus) { -+ fec_stop(dev); -+ } -+#ifdef CONFIG_PHYLIB -+ if (fep->phy) { -+ DBG(0, "%s: Stopping PHY %p\n", __FUNCTION__, fep->phy); -+ phy_stop(fep->phy); - -+ DBG(0, "%s: Disconnecting PHY %p\n", __FUNCTION__, fep->phy); -+ phy_disconnect(fep->phy); -+ fep->phy = NULL; -+ } -+#endif -+#if 1 -+ /* Whack a reset. We should wait for this. -+ */ -+ fec_reg_write(fep, FEC_ECR, FEC_ECR_RESET); -+ udelay(10); -+ -+ /* Mask and clear outstanding MII command interrupts. -+ */ -+ fec_reg_write(fep, FEC_EIMR, 0); -+ fec_reg_write(fep, FEC_EIR, FEC_ENET_MII); -+ fec_disable_phy_intr(fep); -+ /* Switch off MII */ -+ fec_reg_write(fep, FEC_MSCR, 0); -+#endif - return 0; - } - -+static struct net_device_stats *fec_enet_get_stats(struct net_device *dev) -+{ -+ struct fec_enet_private *fep = netdev_priv(dev); -+ -+ return &fep->stats; -+} -+ - /* 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) - - static void set_multicast_list(struct net_device *dev) - { -- struct fec_enet_private *fep; -- volatile fec_t *ep; -+ struct fec_enet_private *fep = netdev_priv(dev); - struct dev_mc_list *dmi; - unsigned int i, j, bit, data, crc; - unsigned char hash; - -- fep = netdev_priv(dev); -- ep = fep->hwp; -- -- if (dev->flags&IFF_PROMISC) { -- ep->fec_r_cntrl |= 0x0008; -+ if (dev->flags & IFF_PROMISC) { -+ fec_reg_write(fep, FEC_RCR, fec_reg_read(fep, FEC_RCR) | RCR_PROM); - } else { - -- ep->fec_r_cntrl &= ~0x0008; -+ fec_reg_write(fep, FEC_RCR, fec_reg_read(fep, FEC_RCR) & ~RCR_PROM); - - if (dev->flags & IFF_ALLMULTI) { - /* Catch all multicast addresses, so set the - * filter to all 1's. - */ -- ep->fec_grp_hash_table_high = 0xffffffff; -- ep->fec_grp_hash_table_low = 0xffffffff; -+ fec_reg_write(fep, FEC_IAUR, ~0); -+ fec_reg_write(fep, FEC_IALR, ~0); - } else { - /* Clear filter and add the addresses in hash register. - */ -- ep->fec_grp_hash_table_high = 0; -- ep->fec_grp_hash_table_low = 0; -+ fec_reg_write(fep, FEC_IAUR, 0); -+ fec_reg_write(fep, FEC_IALR, 0); - - dmi = dev->mc_list; - -- for (j = 0; j < dev->mc_count; j++, dmi = dmi->next) -- { -+ for (j = 0; j < dev->mc_count; j++, dmi = dmi->next) { - /* Only support group multicast for now. - */ - if (!(dmi->dmi_addr[0] & 1)) -@@ -1621,13 +2268,11 @@ static void set_multicast_list(struct ne - - /* calculate crc32 value of mac address - */ -- crc = 0xffffffff; -+ crc = ~0; - -- for (i = 0; i < dmi->dmi_addrlen; i++) -- { -+ for (i = 0; i < dmi->dmi_addrlen; i++) { - data = dmi->dmi_addr[i]; -- for (bit = 0; bit < 8; bit++, data >>= 1) -- { -+ for (bit = 0; bit < 8; bit++, data >>= 1) { - crc = (crc >> 1) ^ - (((crc ^ data) & 1) ? CRC32_POLY : 0); - } -@@ -1639,9 +2284,13 @@ static void set_multicast_list(struct ne - hash = (crc >> (32 - HASH_BITS)) & 0x3f; - - if (hash > 31) -- ep->fec_grp_hash_table_high |= 1 << (hash - 32); -+ fec_reg_write(fep, FEC_IAUR, -+ fec_reg_read(fep, FEC_IAUR) | -+ (1 << (hash - 32))); - else -- ep->fec_grp_hash_table_low |= 1 << hash; -+ fec_reg_write(fep, FEC_IALR, -+ fec_reg_read(fep, FEC_IALR) | -+ (1 << hash)); - } - } - } -@@ -1650,106 +2299,272 @@ static void set_multicast_list(struct ne - /* Set a MAC change in hardware. - */ - static void --fec_set_mac_address(struct net_device *dev) -+_fec_set_mac_address(struct net_device *dev) - { -- volatile fec_t *fecp; -- -- fecp = ((struct fec_enet_private *)netdev_priv(dev))->hwp; -+ struct fec_enet_private *fep = netdev_priv(dev); - - /* Set station address. */ -- fecp->fec_addr_low = dev->dev_addr[3] | (dev->dev_addr[2] << 8) | -- (dev->dev_addr[1] << 16) | (dev->dev_addr[0] << 24); -- fecp->fec_addr_high = (dev->dev_addr[5] << 16) | -- (dev->dev_addr[4] << 24); -+ fec_reg_write(fep, FEC_PALR, dev->dev_addr[3] | (dev->dev_addr[2] << 8) | -+ (dev->dev_addr[1] << 16) | (dev->dev_addr[0] << 24)); -+ 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) -+{ -+ struct sockaddr *addr = _addr; -+ -+ if (!is_valid_ether_addr((const char *)&addr->sa_data)) { -+ printk(KERN_WARNING "Bad ethernet address: %02x:%02x:%02x:%02x:%02x:%02x\n", -+ addr->sa_data[0], addr->sa_data[1], addr->sa_data[2], addr->sa_data[3], -+ addr->sa_data[4], addr->sa_data[5]); -+ return -EINVAL; -+ } -+ printk(KERN_DEBUG "Setting MAC address to %02x:%02x:%02x:%02x:%02x:%02x\n", -+ addr->sa_data[0], addr->sa_data[1], addr->sa_data[2], addr->sa_data[3], -+ addr->sa_data[4], addr->sa_data[5]); -+ -+ memcpy(&dev->dev_addr, &addr->sa_data, ETH_ALEN); - -+ _fec_set_mac_address(dev); -+ -+ return 0; - } - -- /* -- * XXX: We need to clean up on failure exits here. -- * -- * index is only used in legacy code -- */ --int __init fec_enet_init(struct net_device *dev, int index) -+static void fec_enet_free_buffers(struct fec_enet_private *fep) -+{ -+ cbd_t *bdp = fep->rx_bd_base; -+ int i; -+ -+ DBG(0, "%s: Freeing TX bounce buffers %p\n", __FUNCTION__, fep->tx_bounce[0]); -+ kfree(fep->tx_bounce[0]); -+ memset(fep->tx_bounce, 0, TX_RING_SIZE * sizeof(void*)); -+ for (i = 0; i < RX_RING_SIZE; i++, bdp++) { -+ if (fep->rx_skbuff[i] != NULL) { -+ DBG(0, "%s: Freeing RX skb %p\n", __FUNCTION__, fep->rx_skbuff[i]); -+ fec_enet_rxbuf_unmap(fep, bdp, FEC_ENET_RX_FRSIZE); -+ kfree_skb(fep->rx_skbuff[i]); -+ fep->rx_skbuff[i] = NULL; -+ } -+ } -+} -+ -+#ifdef CONFIG_PHYLIB -+/* called by the generic PHY layer in interrupt context */ -+static int phy_regs[32] = { [0 ... ARRAY_SIZE(phy_regs) - 1] = -1}; -+static int fec_mii_read(struct mii_bus *bus, int phy_id, int regnum) - { -+ int ret; -+ struct net_device *dev = bus->priv; - struct fec_enet_private *fep = netdev_priv(dev); -- unsigned long mem_addr; -- volatile cbd_t *bdp; -- cbd_t *cbd_base; -- volatile fec_t *fecp; -- int i, j; -+ unsigned long regval = mk_mii_read(regnum) | phy_id << 23; -+ unsigned long flags; -+ int loops = 0; - -- /* Allocate memory for buffer descriptors. -- */ -- mem_addr = (unsigned long)dma_alloc_coherent(NULL, PAGE_SIZE, -- &fep->bd_dma, GFP_KERNEL); -- if (mem_addr == 0) { -- printk("FEC: allocate descriptor memory failed?\n"); -+ DBG(1, "%s: \n", __FUNCTION__); -+#if 0 -+ DBG(0, "%s: ECR: %08lx\n", __FUNCTION__, fec_reg_read(fep, FEC_ECR)); -+ DBG(0, "%s: EIR: %08lx\n", __FUNCTION__, fec_reg_read(fep, FEC_EIR)); -+ DBG(0, "%s: EIMR: %08lx\n", __FUNCTION__, fec_reg_read(fep, FEC_EIMR)); -+ DBG(0, "%s: RCR: %08lx\n", __FUNCTION__, fec_reg_read(fep, FEC_RCR)); -+ DBG(0, "%s: TCR: %08lx\n", __FUNCTION__, fec_reg_read(fep, FEC_TCR)); -+#endif -+ spin_lock_irqsave(&fep->lock, flags); -+ fep->mii_complete = 0; -+ fec_reg_write(fep, FEC_MMFR, regval); -+ spin_unlock_irqrestore(&fep->lock, flags); -+ -+ while (!fep->mii_complete) { -+ if (loops++ == 1000) { -+ DBG(1, "%s: Waiting for MII completion\n", __FUNCTION__); -+ } -+ cpu_relax(); -+ } -+ if (loops >= 1000) { -+ DBG(1, "%s: MII transaction completed\n", __FUNCTION__); -+ } -+ ret = fec_reg_read(fep, FEC_MMFR); -+ if (ret < 0) { -+ DBG(0, "%s: Failed to read PHY[%02x] reg %02x: %d\n", __FUNCTION__, -+ phy_id, regnum, ret); -+ return ret; -+ } -+ ret &= 0xffff; -+ if (phy_regs[regnum] != ret) { -+ DBG(1, "%s: Read %04x from PHY[%02x] reg %02x\n", __FUNCTION__, -+ ret, phy_id, regnum); -+ phy_regs[regnum] = ret; -+ } -+ return ret; -+} -+ -+static int fec_mii_write(struct mii_bus *bus, int phy_id, int regnum, u16 val) -+{ -+ struct net_device *dev = bus->priv; -+ struct fec_enet_private *fep = netdev_priv(dev); -+ unsigned long regval = mk_mii_write(regnum, val) | phy_id << 23; -+ unsigned long flags; -+ -+ DBG(0, "%s: \n", __FUNCTION__); -+ -+ spin_lock_irqsave(&fep->lock, flags); -+ fep->mii_complete = 0; -+ fec_reg_write(fep, FEC_MMFR, regval); -+ spin_unlock_irqrestore(&fep->lock, flags); -+ -+ while (!fep->mii_complete) { -+ cpu_relax(); -+ } -+ DBG(1, "%s: Wrote %04x to PHY[%02x] reg %02x\n", __FUNCTION__, val, phy_id, regnum); -+ return 0; -+} -+ -+static int fec_mii_reset(struct mii_bus *bus) -+{ -+ DBG(0, "%s: \n", __FUNCTION__); -+ memset(phy_regs, -1, sizeof(phy_regs)); -+ return 0; -+} -+ -+static int fec_init_phy(struct net_device *dev, struct fec_enet_private *fep) -+{ -+ int ret; -+ int i; -+ struct mii_bus *mii; -+ -+ mii = mdiobus_alloc(); -+ if (mii == NULL) { - return -ENOMEM; - } -+ mii->name = "fec mii"; -+ mii->read = fec_mii_read; -+ mii->write = fec_mii_write; -+ mii->reset = fec_mii_reset; -+ mii->priv = dev; -+ snprintf(mii->id, MII_BUS_ID_SIZE, "%x", 0); -+ mii->irq = kmalloc(sizeof(int) * PHY_MAX_ADDR, GFP_KERNEL); -+ for (i = 0; i < PHY_MAX_ADDR; i++) { -+ mii->irq[i] = fep->mii_irq >= 0 ? fep->mii_irq : PHY_POLL; -+ } -+ -+ ret = mdiobus_register(mii); -+ if (ret != 0) { -+ DBG(0, "%s: Failed to register MII bus: %d\n", __FUNCTION__, ret); -+ kfree(mii->irq); -+ mdiobus_free(mii); -+ return ret; -+ } -+ fep->phy_addr = -1; -+ DBG(0, "%s: MII bus registered\n", __FUNCTION__); -+ for (i = 0; i < PHY_MAX_ADDR; i++) { -+ if (mii->phy_map[i] != NULL) { -+ fep->phy_addr = i; -+ break; -+ } -+ } -+ if (fep->phy_addr == -1) { -+ DBG(0, "%s: No PHY found\n", __FUNCTION__); -+ return -ENODEV; -+ } -+ DBG(0, "%s: Using PHY at addr %02x\n", __FUNCTION__, fep->phy_addr); -+ fep->mii = mii; - -- spin_lock_init(&fep->hw_lock); -- spin_lock_init(&fep->mii_lock); -+ return 0; -+} - -- /* Create an Ethernet device instance. -- */ -- fecp = (volatile fec_t *)dev->base_addr; -+static int fec_connect_phy(struct net_device *dev, struct fec_enet_private *fep) -+{ -+ struct mii_bus *mii = fep->mii; - -- fep->index = index; -- fep->hwp = fecp; -- fep->netdev = dev; -+ DBG(0, "%s: Connecting PHY at addr %02x\n", __FUNCTION__, -+ fep->phy_addr); - -- /* Whack a reset. We should wait for this. -- */ -- fecp->fec_ecntrl = 1; -- udelay(10); -+ fep->phy = phy_connect(dev, dev_name(&mii->phy_map[fep->phy_addr]->dev), -+ fec_link_change, 0, mii->phy_map[fep->phy_addr]->interface); -+ if (IS_ERR(fep->phy)) { -+ int ret = PTR_ERR(fep->phy); -+ printk(KERN_ERR "%s: Could not attach to PHY\n", dev->name); -+ fep->phy = NULL; -+ return ret; -+ } -+ DBG(0, "%s: Registered PHY %s[%02x] IRQ %d with %s\n", __FUNCTION__, -+ dev_name(&fep->phy->dev), fep->phy_addr, fep->phy->irq, dev->name); - -- /* Set the Ethernet address */ --#ifdef CONFIG_M5272 -- fec_get_mac(dev); -+ return 0; -+} - #else -- { -- unsigned long l; -- l = fecp->fec_addr_low; -- dev->dev_addr[0] = (unsigned char)((l & 0xFF000000) >> 24); -- dev->dev_addr[1] = (unsigned char)((l & 0x00FF0000) >> 16); -- dev->dev_addr[2] = (unsigned char)((l & 0x0000FF00) >> 8); -- dev->dev_addr[3] = (unsigned char)((l & 0x000000FF) >> 0); -- l = fecp->fec_addr_high; -- dev->dev_addr[4] = (unsigned char)((l & 0xFF000000) >> 24); -- dev->dev_addr[5] = (unsigned char)((l & 0x00FF0000) >> 16); -- } -+static int fec_init_phy(struct net_device *dev, struct fec_enet_private *fep) -+{ -+ /* Queue up command to detect the PHY and initialize the -+ * remainder of the interface. -+ */ -+ fep->phy_id_done = 0; -+ fep->phy_addr = 0; -+ mii_queue(dev, mk_mii_read(MII_REG_PHYIR1), mii_discover_phy); -+ -+ return 0; -+} - #endif - -- cbd_base = (cbd_t *)mem_addr; -+/* Initialize the FEC Ethernet on 860T (or ColdFire 5272). -+ */ -+ /* -+ * 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; -+ struct fec_enet_private *fep = netdev_priv(dev); -+ cbd_t *bdp; -+ struct sk_buff *pskb; -+ int i; -+ void *mem; -+ -+ spin_lock_init(&fep->lock); -+ -+ /* Whack a reset. We should wait for this. - */ -- fep->rx_bd_base = cbd_base; -- fep->tx_bd_base = cbd_base + RX_RING_SIZE; -+ fec_reg_write(fep, FEC_ECR, FEC_ECR_RESET); -+ udelay(10); -+ -+ /* Set the Ethernet address. If using multiple Enets on the 8xx, -+ * this needs some work to get unique addresses. -+ * -+ * This is our default MAC address unless the user changes -+ * it via eth_mac_addr (our dev->set_mac_addr handler). -+ */ -+ fec_get_mac(dev); - - fep->dirty_tx = fep->cur_tx = fep->tx_bd_base; - fep->cur_rx = fep->rx_bd_base; - - fep->skb_cur = fep->skb_dirty = 0; - -- /* Initialize the receive buffer descriptors. -+ /* allocate memory for TX bounce buffers */ -+ mem = kzalloc(TX_RING_SIZE * FEC_ENET_TX_FRSIZE, GFP_KERNEL); -+ if (mem == NULL) { -+ return -ENOMEM; -+ } -+ -+ fec_enet_cbd_get(fep); -+ -+ /* Initialize the transmit buffer descriptors. - */ -- bdp = fep->rx_bd_base; -- for (i=0; itx_bd_base; - -- /* Allocate a page. -- */ -- mem_addr = __get_free_page(GFP_KERNEL); -- /* XXX: missing check for allocation failure */ -+ DBG(0, "%s: Allocated %d byte of TX buffer memory @ %p\n", __FUNCTION__, -+ TX_RING_SIZE * FEC_ENET_TX_FRSIZE, mem); -+ for (i = 0; i < TX_RING_SIZE; i++) { -+ fep->tx_bounce[i] = mem; -+ DBG(0, "%s: TX bounce buffer[%d]=%p\n", __FUNCTION__, i, fep->tx_bounce[i]); -+ mem = (void *)((unsigned long)(mem + FEC_ENET_TX_FRSIZE)); - - /* Initialize the BD for every fragment in the page. - */ -- for (j=0; jcbd_sc = BD_ENET_RX_EMPTY; -- bdp->cbd_bufaddr = __pa(mem_addr); -- mem_addr += FEC_ENET_RX_FRSIZE; -- bdp++; -- } -+ bdp->cbd_bufaddr = ~0; -+ bdp++; - } - - /* Set the last buffer to wrap. -@@ -1757,87 +2572,88 @@ int __init fec_enet_init(struct net_devi - bdp--; - bdp->cbd_sc |= BD_SC_WRAP; - -- /* ...and the same for transmmit. -+ /* ...and the same for receive. - */ -- bdp = fep->tx_bd_base; -- for (i=0, j=FEC_ENET_TX_FRPPG; i= FEC_ENET_TX_FRPPG) { -- mem_addr = __get_free_page(GFP_KERNEL); -- j = 1; -- } else { -- mem_addr += FEC_ENET_TX_FRSIZE; -- j++; -+ bdp = fep->rx_bd_base; -+ for (i = 0; i < RX_RING_SIZE; i++, bdp++) { -+ pskb = __dev_alloc_skb(FEC_ENET_RX_FRSIZE, GFP_KERNEL); -+ if (pskb == NULL) { -+ DBG(0, "%s: Failed to allocate RX skb; cleaning up\n", __FUNCTION__); -+ ret = -ENOMEM; -+ goto cleanup; - } -- fep->tx_bounce[i] = (unsigned char *) mem_addr; -- -- /* Initialize the BD for every fragment in the page. -- */ -- bdp->cbd_sc = 0; -- bdp->cbd_bufaddr = 0; -- bdp++; -+ DBG(0, "%s: RX skb allocated @ %p\n", __FUNCTION__, pskb); -+ fep->rx_skbuff[i] = pskb; -+ pskb->data = FEC_ADDR_ALIGNMENT(pskb->data); -+ bdp->cbd_sc = BD_ENET_RX_EMPTY; -+ bdp->cbd_bufaddr = ~0; -+ fec_enet_rxbuf_map(fep, bdp, pskb->data, FEC_ENET_RX_FRSIZE); - } -- - /* Set the last buffer to wrap. - */ - bdp--; - bdp->cbd_sc |= BD_SC_WRAP; -+ fec_enet_cbd_put(fep); - - /* Set receive and transmit descriptor base. - */ -- fecp->fec_r_des_start = fep->bd_dma; -- fecp->fec_x_des_start = (unsigned long)fep->bd_dma + sizeof(cbd_t) -- * RX_RING_SIZE; -- --#ifdef HAVE_mii_link_interrupt -- fec_request_mii_intr(dev); --#endif -- -- fecp->fec_grp_hash_table_high = 0; -- fecp->fec_grp_hash_table_low = 0; -- fecp->fec_r_buff_size = PKT_MAXBLR_SIZE; -- fecp->fec_ecntrl = 2; -- fecp->fec_r_des_active = 0; --#ifndef CONFIG_M5272 -- fecp->fec_hash_table_high = 0; -- fecp->fec_hash_table_low = 0; --#endif -+ fec_reg_write(fep, FEC_ERDSR, fep->cbd_phys_base); -+ fec_reg_write(fep, FEC_ETDSR, fep->cbd_phys_base + RX_RING_SIZE * sizeof(cbd_t)); - -+ /* Install our interrupt handlers. This varies depending on -+ * the architecture. -+ */ -+ ret = fec_request_intrs(pdev, dev); -+ if (ret != 0) { -+ goto cleanup; -+ } -+ /* Clear and enable interrupts */ -+ fec_reg_write(fep, FEC_EIR, fec_reg_read(fep, FEC_EIR)); -+ fec_reg_write(fep, FEC_EIMR, FEC_ENET_TXF | FEC_ENET_TXB | -+ FEC_ENET_RXF | FEC_ENET_RXB | FEC_ENET_MII); -+ -+ fec_reg_write(fep, FEC_IAUR, 0); -+ fec_reg_write(fep, FEC_IALR, 0); -+ fec_reg_write(fep, FEC_EMRBR, PKT_MAXBLR_SIZE); -+ fec_reg_write(fep, FEC_ECR, FEC_ECR_ETHER_EN); -+ fec_localhw_setup(dev); -+#if 0 -+ /* do this in enet_open()! */ -+ fec_reg_write(fep, FEC_RDAR, DONT_CARE); -+#endif - /* The FEC Ethernet specific entries in the device structure. */ - dev->open = fec_enet_open; - dev->hard_start_xmit = fec_enet_start_xmit; - dev->tx_timeout = fec_timeout; - dev->watchdog_timeo = TX_TIMEOUT; - dev->stop = fec_enet_close; -+ dev->get_stats = fec_enet_get_stats; - dev->set_multicast_list = set_multicast_list; -+ dev->set_mac_address = fec_set_mac_address; - -- for (i=0; ifec_r_cntrl = OPT_FRAME_SIZE | 0x04; -- fecp->fec_x_cntrl = 0x00; -- -- /* -- * Set MII speed to 2.5 MHz -- */ -- fep->phy_speed = ((((clk_get_rate(fep->clk) / 2 + 4999999) -- / 2500000) / 2) & 0x3F) << 1; -- fecp->fec_mii_speed = fep->phy_speed; -- fec_restart(dev, 0); -- -- /* Clear and enable interrupts */ -- fecp->fec_ievent = 0xffc00000; -- fecp->fec_imask = (FEC_ENET_TXF | FEC_ENET_RXF | FEC_ENET_MII); -- -- /* Queue up command to detect the PHY and initialize the -- * remainder of the interface. -- */ -- fep->phy_id_done = 0; -- fep->phy_addr = 0; -- mii_queue(dev, mk_mii_read(MII_REG_PHYIR1), mii_discover_phy); -+ ret = fec_set_mii(dev, fep); -+ if (ret) { -+ DBG(0, "%s: Failed to initialize MII interface: %d\n", __FUNCTION__, ret); -+ goto cleanup; -+ } - -+ ret = fec_init_phy(dev, fep); -+ if (ret) { -+ DBG(0, "%s: Failed to initialize PHY: %d\n", __FUNCTION__, ret); -+ goto cleanup; -+ } - return 0; -+ cleanup: -+ fec_enet_free_buffers(fep); -+ fec_enet_cbd_put(fep); -+ return ret; - } - - /* 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 - static void - fec_restart(struct net_device *dev, int duplex) - { -- struct fec_enet_private *fep; -- volatile cbd_t *bdp; -- volatile fec_t *fecp; -+ struct fec_enet_private *fep = netdev_priv(dev); -+ cbd_t *bdp; - int i; -+ u32 rcr = OPT_FRAME_SIZE | RCR_MII_MODE; /* MII enable */ -+ u32 tcr = TCR_HBC; - -- fep = netdev_priv(dev); -- fecp = fep->hwp; -- -+ DBG(0, "%s: Restarting FEC in %s-duplex mode\n", __FUNCTION__, -+ duplex ? "full" : "half"); - /* Whack a reset. We should wait for this. -- */ -- fecp->fec_ecntrl = 1; -+ */ -+ fec_reg_write(fep, FEC_ECR, FEC_ECR_RESET); - udelay(10); - -+ /* Enable interrupts we wish to service. -+ */ -+ fec_reg_write(fep, FEC_EIMR, FEC_ENET_TXF | FEC_ENET_TXB | -+ FEC_ENET_RXF | FEC_ENET_RXB | FEC_ENET_MII); -+ - /* Clear any outstanding interrupt. -- */ -- fecp->fec_ievent = 0xffc00000; -+ * -+ */ -+ fec_reg_write(fep, FEC_EIR, FEC_ENET_MASK); -+ -+ fec_enable_phy_intr(fep); - - /* Set station address. -- */ -- fec_set_mac_address(dev); -+ */ -+ _fec_set_mac_address(dev); - - /* Reset all multicast. -- */ -- fecp->fec_grp_hash_table_high = 0; -- fecp->fec_grp_hash_table_low = 0; -+ */ -+ fec_reg_write(fep, FEC_IAUR, 0); -+ fec_reg_write(fep, FEC_IALR, 0); - - /* Set maximum receive buffer size. -- */ -- fecp->fec_r_buff_size = PKT_MAXBLR_SIZE; -+ */ -+ fec_reg_write(fep, FEC_EMRBR, PKT_MAXBLR_SIZE); - - /* Set receive and transmit descriptor base. -- */ -- fecp->fec_r_des_start = fep->bd_dma; -- fecp->fec_x_des_start = (unsigned long)fep->bd_dma + sizeof(cbd_t) -- * RX_RING_SIZE; -+ */ -+ fec_reg_write(fep, FEC_ERDSR, fep->cbd_phys_base); -+ fec_reg_write(fep, FEC_ETDSR, fep->cbd_phys_base + RX_RING_SIZE * sizeof(cbd_t)); - - fep->dirty_tx = fep->cur_tx = fep->tx_bd_base; - fep->cur_rx = fep->rx_bd_base; - - /* Reset SKB transmit buffers. -- */ -+ */ - fep->skb_cur = fep->skb_dirty = 0; -- for (i=0; i<=TX_RING_MOD_MASK; i++) { -+ bdp = fep->tx_bd_base; -+ for (i = 0; i <= TX_RING_MOD_MASK; i++) { - if (fep->tx_skbuff[i] != NULL) { -- dev_kfree_skb_any(fep->tx_skbuff[i]); -- fep->tx_skbuff[i] = NULL; -+ fec_free_skb(fep, bdp, &fep->tx_skbuff[i]); -+ bdp++; - } - } - - /* Initialize the receive buffer descriptors. -- */ -+ */ - bdp = fep->rx_bd_base; -- for (i=0; icbd_sc = BD_ENET_RX_EMPTY; -@@ -1908,246 +2731,366 @@ fec_restart(struct net_device *dev, int - } - - /* Set the last buffer to wrap. -- */ -+ */ - bdp--; - bdp->cbd_sc |= BD_SC_WRAP; - - /* ...and the same for transmmit. -- */ -+ */ - bdp = fep->tx_bd_base; -- for (i=0; icbd_sc = 0; -- bdp->cbd_bufaddr = 0; -+ bdp->cbd_bufaddr = ~0; - bdp++; - } - - /* Set the last buffer to wrap. -- */ -+ */ - bdp--; - bdp->cbd_sc |= BD_SC_WRAP; - - /* Enable MII mode. -- */ -+ */ - if (duplex) { -- fecp->fec_r_cntrl = OPT_FRAME_SIZE | 0x04;/* MII enable */ -- fecp->fec_x_cntrl = 0x04; /* FD enable */ -+ tcr |= TCR_FDEN; /* FD enable */ - } else { -- /* MII enable|No Rcv on Xmit */ -- fecp->fec_r_cntrl = OPT_FRAME_SIZE | 0x06; -- fecp->fec_x_cntrl = 0x00; -+ rcr |= RCR_DRT; /* No Rcv on Xmit */ - } -+ fec_reg_write(fep, FEC_RCR, rcr); -+ fec_reg_write(fep, FEC_TCR, tcr); - fep->full_duplex = duplex; - - /* Set MII speed. -- */ -- fecp->fec_mii_speed = fep->phy_speed; -+ */ -+ fec_reg_write(fep, FEC_MSCR, fep->phy_speed); - - /* And last, enable the transmit and receive processing. -- */ -- fecp->fec_ecntrl = 2; -- fecp->fec_r_des_active = 0; -+ */ -+ fec_reg_write(fep, FEC_ECR, FEC_ECR_ETHER_EN); -+ fec_localhw_setup(dev); -+ fec_reg_write(fep, FEC_RDAR, DONT_CARE); - -- /* Enable interrupts we wish to service. -- */ -- fecp->fec_imask = (FEC_ENET_TXF | FEC_ENET_RXF | FEC_ENET_MII); -+ DBG(0, "%s: Starting netif queue\n", __FUNCTION__); -+ netif_start_queue(dev); - } - - static void - fec_stop(struct net_device *dev) - { -- volatile fec_t *fecp; -- struct fec_enet_private *fep; -+ struct fec_enet_private *fep = netdev_priv(dev); - -- fep = netdev_priv(dev); -- fecp = fep->hwp; -+ DBG(0, "%s: Stopping netif queue\n", __FUNCTION__); -+ netif_stop_queue(dev); - - /* -- ** We cannot expect a graceful transmit stop without link !!! -- */ -- if (fep->link) -- { -- fecp->fec_x_cntrl = 0x01; /* Graceful transmit stop */ -+ * We cannot expect a graceful transmit stop without link! -+ */ -+ if (fep->linkstatus) { -+ fec_reg_write(fep, FEC_TCR, 0x01); /* Graceful transmit stop */ - udelay(10); -- if (!(fecp->fec_ievent & FEC_ENET_GRA)) -- printk("fec_stop : Graceful transmit stop did not complete !\n"); -- } -- -+ if (!(fec_reg_read(fep, FEC_EIR) & FEC_ENET_GRA)) -+ dev_warn(&dev->dev, "Graceful transmit stop did not complete!\n"); -+ } -+#if 0 - /* Whack a reset. We should wait for this. -- */ -- fecp->fec_ecntrl = 1; -+ */ -+ fec_reg_write(fep, FEC_ECR, FEC_ECR_RESET); - udelay(10); -- -- /* Clear outstanding MII command interrupts. -- */ -- fecp->fec_ievent = FEC_ENET_MII; -- -- fecp->fec_imask = FEC_ENET_MII; -- fecp->fec_mii_speed = fep->phy_speed; -+ /* Mask and clear outstanding MII command interrupts. -+ */ -+ fec_reg_write(fep, FEC_EIMR, 0); -+ fec_reg_write(fep, FEC_EIR, FEC_ENET_MII); -+ fec_enable_phy_intr(fep); -+ fec_reg_write(fep, FEC_MSCR, fep->phy_speed); -+#endif - } - --static int __devinit --fec_probe(struct platform_device *pdev) -+static int __devinit fec_enet_probe(struct platform_device *pdev) - { -+ int ret; - struct fec_enet_private *fep; -- struct net_device *ndev; -- int i, irq, ret = 0; -- struct resource *r; -- -- r = platform_get_resource(pdev, IORESOURCE_MEM, 0); -- if (!r) -- return -ENXIO; -+ struct net_device *dev; -+ struct fec_enet_platform_data *pdata = pdev->dev.platform_data; -+ struct resource *res_mem1; -+ struct resource *res_mem2; -+ -+ res_mem1 = platform_get_resource(pdev, IORESOURCE_MEM, 0); -+ if (res_mem1 == NULL) { -+ return -ENODEV; -+ } - -- r = request_mem_region(r->start, resource_size(r), pdev->name); -- if (!r) -+ res_mem1 = request_mem_region(res_mem1->start, -+ resource_size(res_mem1), -+ DRV_NAME); -+ if (res_mem1 == NULL) { - return -EBUSY; -+ } -+ res_mem2 = platform_get_resource(pdev, IORESOURCE_MEM, 1); -+ if (res_mem2 != NULL) { -+ res_mem2 = request_mem_region(res_mem2->start, -+ resource_size(res_mem2), -+ DRV_NAME); -+ if (res_mem2 == NULL) { -+ ret = -EBUSY; -+ goto release1; -+ } -+ } - -- /* Init network device */ -- ndev = alloc_etherdev(sizeof(struct fec_enet_private)); -- if (!ndev) -- return -ENOMEM; -- -- SET_NETDEV_DEV(ndev, &pdev->dev); -- -- /* setup board info structure */ -- fep = netdev_priv(ndev); -- memset(fep, 0, sizeof(*fep)); -+ dev = alloc_etherdev(sizeof(struct fec_enet_private)); -+ if (dev == NULL) { -+ ret = -ENOMEM; -+ goto release2; -+ } -+ platform_set_drvdata(pdev, dev); -+ fep = netdev_priv(dev); -+ fep->res_mem1 = res_mem1; -+ fep->res_mem2 = res_mem2; -+ fep->dma_dev = &pdev->dev; -+ -+ fep->reg_base = ioremap(res_mem1->start, resource_size(res_mem1)); -+ if (fep->reg_base == NULL) { -+ printk("FEC: Mapping FEC registers failed\n"); -+ ret = -ENOMEM; -+ goto free_netdev; -+ } -+ DBG(0, "%s: FEC registers @ %08lx mapped to %p\n", __FUNCTION__, -+ (unsigned long)res_mem1->start, fep->reg_base); - -- ndev->base_addr = (unsigned long)ioremap(r->start, resource_size(r)); -+ fep->mib_base = ioremap(res_mem2->start, resource_size(res_mem2)); -+ if (fep->mib_base == NULL) { -+ printk("FEC: Mapping FEC registers failed\n"); -+ ret = -ENOMEM; -+ goto unmap1; -+ } -+ DBG(0, "%s: FEC registers @ %08lx mapped to %p\n", __FUNCTION__, -+ (unsigned long)res_mem2->start, fep->mib_base); - -- if (!ndev->base_addr) { -+ /* Allocate memory for buffer descriptors. */ -+ fep->cbd_mem_base = dma_alloc_coherent(&pdev->dev, CBD_BUF_SIZE, -+ &fep->cbd_phys_base, -+ GFP_KERNEL); -+ if (fep->cbd_mem_base == NULL) { -+ printk("FEC: allocate descriptor memory failed\n"); - ret = -ENOMEM; -- goto failed_ioremap; -+ goto unmap2; - } -+ DBG(0, "%s: Allocated %lu [(%u + %lu) * %d] byte for CBD buffer @ %p[%08lx]\n", -+ __FUNCTION__, CBD_BUF_SIZE, TX_RING_SIZE, RX_RING_SIZE, -+ sizeof(cbd_t), fep->cbd_mem_base, -+ (unsigned long)fep->cbd_phys_base); - -- platform_set_drvdata(pdev, ndev); -+ /* Set receive and transmit descriptor base. -+ */ -+ fep->rx_bd_base = fep->cbd_mem_base; -+ fep->tx_bd_base = fep->rx_bd_base + RX_RING_SIZE; - -- /* This device has up to three irqs on some platforms */ -- for (i = 0; i < 3; i++) { -- irq = platform_get_irq(pdev, i); -- if (i && irq < 0) -- break; -- ret = request_irq(irq, fec_enet_interrupt, IRQF_DISABLED, pdev->name, ndev); -- if (ret) { -- while (i >= 0) { -- irq = platform_get_irq(pdev, i); -- free_irq(irq, ndev); -- i--; -- } -- goto failed_irq; -- } -+ printk("FEC ENET Driver\n"); -+ ret = platform_func(pdata->arch_init, pdev); -+ if (ret != 0) { -+ dev_err(&pdev->dev, "platform init failed: %d\n", ret); -+ goto free_dma; - } - -- fep->clk = clk_get(&pdev->dev, "fec_clk"); -- if (IS_ERR(fep->clk)) { -- ret = PTR_ERR(fep->clk); -- goto failed_clk; -+ ret = fec_enet_init(pdev, dev); -+ if (ret != 0) { -+ goto fec_disable; - } -- clk_enable(fep->clk); - -- ret = fec_enet_init(ndev, 0); -- if (ret) -- goto failed_init; -+ /* Enable most messages by default */ -+ fep->msg_enable = (NETIF_MSG_IFUP << 1) - 1; -+ ret = register_netdev(dev); -+ if (ret != 0) { -+ /* XXX: missing cleanup here */ -+ goto free_buffers; -+ } - -- ret = register_netdev(ndev); -- if (ret) -- goto failed_register; -+ printk(KERN_INFO "%s: ethernet %02x:%02x:%02x:%02x:%02x:%02x\n", dev->name, -+ dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2], -+ dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5]); - - return 0; - --failed_register: --failed_init: -- clk_disable(fep->clk); -- clk_put(fep->clk); --failed_clk: -- for (i = 0; i < 3; i++) { -- irq = platform_get_irq(pdev, i); -- if (irq > 0) -- free_irq(irq, ndev); -- } --failed_irq: -- iounmap((void __iomem *)ndev->base_addr); --failed_ioremap: -- free_netdev(ndev); -+ free_buffers: -+ fec_enet_free_buffers(fep); -+ -+ fec_disable: -+ platform_func(pdata->arch_exit, pdev); -+ -+ free_dma: -+ dma_free_coherent(&pdev->dev, CBD_BUF_SIZE, fep->cbd_mem_base, fep->cbd_phys_base); -+ -+ unmap2: -+ if (fep->mib_base) -+ iounmap(fep->mib_base); -+ -+ unmap1: -+ iounmap(fep->reg_base); -+ -+ free_netdev: -+ free_netdev(dev); -+ -+ release2: -+ if (res_mem2 != NULL) { -+ release_resource(res_mem2); -+ } -+ -+ release1: -+ release_resource(res_mem1); - - return ret; - } - --static int __devexit --fec_drv_remove(struct platform_device *pdev) -+static int __devexit fec_enet_remove(struct platform_device *pdev) - { -- struct net_device *ndev = platform_get_drvdata(pdev); -- struct fec_enet_private *fep = netdev_priv(ndev); -+ struct net_device *dev = platform_get_drvdata(pdev); -+ 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); -+ mdiobus_unregister(fep->mii); -+ } -+ mdiobus_free(fep->mii); -+#endif -+ fec_release_intrs(dev); -+ -+ DBG(0, "%s: Unmapping FEC registers %p\n", __FUNCTION__, fep->reg_base); -+ iounmap(fep->reg_base); -+ if (fep->mib_base) -+ iounmap(fep->mib_base); -+ -+ fec_enet_free_buffers(fep); - -- platform_set_drvdata(pdev, NULL); -+ DBG(0, "%s: Freeing CBD buffer area %p[%08lx]\n", __FUNCTION__, -+ fep->cbd_mem_base, (unsigned long)fep->cbd_phys_base); -+ dma_free_coherent(&pdev->dev, CBD_BUF_SIZE, fep->cbd_mem_base, fep->cbd_phys_base); - -- fec_stop(ndev); -- clk_disable(fep->clk); -- clk_put(fep->clk); -- iounmap((void __iomem *)ndev->base_addr); -- unregister_netdev(ndev); -- free_netdev(ndev); -+ release_resource(fep->res_mem1); -+ if (fep->res_mem2 != NULL) { -+ release_resource(fep->res_mem2); -+ } - return 0; - } - --static int --fec_suspend(struct platform_device *dev, pm_message_t state) -+static void fec_enet_shutdown(struct platform_device *pdev) - { -- struct net_device *ndev = platform_get_drvdata(dev); -- struct fec_enet_private *fep; -+ struct fec_enet_platform_data *pdata = pdev->dev.platform_data; -+ -+ DBG(0, "%s: Shutting down FEC Hardware\n", __FUNCTION__); -+ platform_func(pdata->arch_exit, pdev); -+} -+ -+#ifdef CONFIG_PM -+static int fec_enet_suspend(struct platform_device *pdev, pm_message_t state) -+{ -+ int ret; -+ struct fec_enet_platform_data *pdata = pdev->dev.platform_data; -+ struct net_device *ndev = platform_get_drvdata(pdev); -+ struct fec_enet_private *fep = netdev_priv(ndev); - -- if (ndev) { -- fep = netdev_priv(ndev); -- if (netif_running(ndev)) { -- netif_device_detach(ndev); -- fec_stop(ndev); -+ if (netif_running(ndev)) { -+ DBG(0, "%s: Detaching netif\n", __FUNCTION__); -+ netif_device_detach(ndev); -+#ifdef CONFIG_PHYLIB -+ DBG(0, "%s: Disconnecting PHY %p\n", __FUNCTION__, fep->phy); -+ phy_disconnect(fep->phy); -+ fep->phy = NULL; -+#endif -+ } -+#ifndef CONFIG_PHYLIB -+ if (fep->phy_timer) { -+ ret = del_timer_sync(fep->phy_timer); -+ if (ret != 0) { -+ DBG(0, "%s: Failed to delete PHY timer: %d\n", __FUNCTION__, ret); -+ return ret; - } - } -- return 0; -+#endif -+ DBG(0, "%s: Shutting down FEC Hardware %d\n", __FUNCTION__, -+ netif_running(ndev)); -+ ret = platform_func(pdata->suspend, pdev); -+ if (ret != 0 && netif_running(ndev)) { -+ DBG(0, "%s: Failed to suspend: %d\n", __FUNCTION__, ret); -+ /* Undo suspend */ -+#ifdef CONFIG_PHYLIB -+ DBG(0, "%s: Reconnecting PHY\n", __FUNCTION__); -+ if (fec_connect_phy(ndev, fep) != 0) { -+ DBG(0, "%s: Failed to connect to PHY\n", __FUNCTION__); -+ return ret; -+ } -+ phy_start(fep->phy); -+#endif -+ fec_link_change(ndev); -+ netif_device_attach(ndev); -+ } -+ return ret; - } - --static int --fec_resume(struct platform_device *dev) -+static int fec_enet_resume(struct platform_device *pdev) - { -- struct net_device *ndev = platform_get_drvdata(dev); -+ int ret; -+ struct fec_enet_platform_data *pdata = pdev->dev.platform_data; -+ struct net_device *ndev = platform_get_drvdata(pdev); - -- if (ndev) { -- if (netif_running(ndev)) { -- fec_enet_init(ndev, 0); -- netif_device_attach(ndev); -+ DBG(0, "%s: Powering up FEC Hardware %d\n", __FUNCTION__, -+ netif_running(ndev)); -+ ret = platform_func(pdata->resume, pdev); -+ if (ret != 0) { -+ DBG(0, "%s: Failed to resume: %d\n", __FUNCTION__, ret); -+ return ret; -+ } -+ if (netif_running(ndev)) { -+#ifdef CONFIG_PHYLIB -+ struct fec_enet_private *fep = netdev_priv(ndev); -+ -+ DBG(0, "%s: Reconnecting PHY\n", __FUNCTION__); -+ ret = fec_connect_phy(ndev, fep); -+ if (ret != 0) { -+ DBG(0, "%s: Failed to connect to PHY: %d\n", __FUNCTION__, ret); -+ return ret; - } -+ phy_start(fep->phy); -+#endif -+ fec_link_change(ndev); -+ netif_device_attach(ndev); - } - return 0; - } -+#else -+#define fec_enet_suspend NULL -+#define fec_enet_resume NULL -+#endif - --static struct platform_driver fec_driver = { -- .driver = { -- .name = "fec", -- .owner = THIS_MODULE, -+static struct platform_driver fec_enet_driver = { -+ .driver = { -+ .name = DRV_NAME, - }, -- .probe = fec_probe, -- .remove = __devexit_p(fec_drv_remove), -- .suspend = fec_suspend, -- .resume = fec_resume, -+ .probe = fec_enet_probe, -+ .remove = __devexit_p(fec_enet_remove), -+ .shutdown = fec_enet_shutdown, -+ .suspend = fec_enet_suspend, -+ .resume = fec_enet_resume, - }; - --static int __init --fec_enet_module_init(void) -+static int __init fec_enet_module_init(void) - { -- printk(KERN_INFO "FEC Ethernet Driver\n"); -+ int ret; -+ -+ ret = platform_driver_register(&fec_enet_driver); - -- return platform_driver_register(&fec_driver); -+ return ret; - } -+module_init(fec_enet_module_init); - --static void __exit --fec_enet_cleanup(void) -+static void __exit fec_enet_module_cleanup(void) - { -- platform_driver_unregister(&fec_driver); -+ platform_driver_unregister(&fec_enet_driver); - } -- --module_exit(fec_enet_cleanup); --module_init(fec_enet_module_init); -+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 18:43:03.000000000 +0200 -@@ -13,6 +13,15 @@ - #define FEC_H - /****************************************************************************/ - -+/* -+ * dummy value to write into RDAR,TDAR. FEC hardware will scan the TX/RX -+ * descriptors in memory upon any write access to those registers. -+ * The actual value written to those registers does not matter. -+*/ -+#define DONT_CARE 0 -+#define RDAR_BUSY (1 << 24) -+#define TDAR_BUSY (1 << 24) -+ - #if defined(CONFIG_M523x) || defined(CONFIG_M527x) || defined(CONFIG_M528x) || \ - defined(CONFIG_M520x) || defined(CONFIG_M532x) || defined(CONFIG_ARCH_MXC) - /* -@@ -20,6 +29,36 @@ - * registers in the same peripheral device on different models - * of the ColdFire! - */ -+// relying on structure alignment for hardware register is just evil -+#ifndef GARBAGE -+#define FEC_EIR 0x004 -+#define FEC_EIMR 0x008 -+#define FEC_RDAR 0x010 -+#define FEC_TDAR 0x014 -+#define FEC_ECR 0x024 -+#define FEC_MMFR 0x040 -+#define FEC_MSCR 0x044 -+#define FEC_MIBC 0x064 -+#define FEC_RCR 0x084 -+#define FEC_TCR 0x0c4 -+#define FEC_PALR 0x0e4 -+#define FEC_PAUR 0x0e8 -+#define FEC_OPD 0x0ec -+#define FEC_IAUR 0x118 -+#define FEC_IALR 0x11c -+#define FEC_GAUR 0x120 -+#define FEC_GALR 0x124 -+#define FEC_TFWR 0x144 -+#define FEC_FRBR 0x14c -+#define FEC_FRSR 0x150 -+#define FEC_ERDSR 0x180 -+#define FEC_ETDSR 0x184 -+#define FEC_EMRBR 0x188 -+ -+#define FEC_ECR_RESET (1 << 0) -+#define FEC_ECR_ETHER_EN (1 << 1) -+#else -+ - typedef struct fec { - unsigned long fec_reserved0; - unsigned long fec_ievent; /* Interrupt event reg */ -@@ -57,6 +96,7 @@ typedef struct fec { - unsigned long fec_x_des_start; /* Transmit descriptor ring */ - unsigned long fec_r_buff_size; /* Maximum receive buff size */ - } fec_t; -+#endif - - #else - -@@ -88,8 +128,8 @@ typedef struct fec { - unsigned long fec_reserved7[158]; - unsigned long fec_addr_low; /* Low 32bits MAC address */ - unsigned long fec_addr_high; /* High 16bits MAC address */ -- unsigned long fec_grp_hash_table_high;/* High 32bits hash table */ -- unsigned long fec_grp_hash_table_low; /* Low 32bits hash table */ -+ unsigned long fec_hash_table_high; /* High 32bits hash table */ -+ unsigned long fec_hash_table_low; /* Low 32bits hash table */ - unsigned long fec_r_des_start; /* Receive descriptor ring */ - unsigned long fec_x_des_start; /* Transmit descriptor ring */ - unsigned long fec_r_buff_size; /* Maximum receive buff size */ -@@ -103,17 +143,20 @@ typedef struct fec { - /* - * Define the buffer descriptor structure. - */ --#ifdef CONFIG_ARCH_MXC -+/* Please see "Receive Buffer Descriptor Field Definitions" in Specification. -+ * It's LE. -+ */ -+#if defined(CONFIG_ARCH_MXC) - typedef struct bufdesc { -- unsigned short cbd_datlen; /* Data length */ -- unsigned short cbd_sc; /* Control and status info */ -- unsigned long cbd_bufaddr; /* Buffer address */ -+ unsigned short cbd_datlen; /* Data length */ -+ unsigned short cbd_sc; /* Control and status info */ -+ dma_addr_t cbd_bufaddr; /* Buffer address as seen by FEC Hardware */ - } cbd_t; - #else - typedef struct bufdesc { - unsigned short cbd_sc; /* Control and status info */ - unsigned short cbd_datlen; /* Data length */ -- unsigned long cbd_bufaddr; /* Buffer address */ -+ dma_addr_t cbd_bufaddr; /* Buffer address */ - } cbd_t; - #endif - -@@ -121,7 +164,7 @@ typedef struct bufdesc { - * The following definitions courtesy of commproc.h, which where - * Copyright (c) 1997 Dan Malek (dmalek@jlc.net). - */ --#define BD_SC_EMPTY ((ushort)0x8000) /* Recieve is empty */ -+#define BD_SC_EMPTY ((ushort)0x8000) /* Receive is empty */ - #define BD_SC_READY ((ushort)0x8000) /* Transmit is ready */ - #define BD_SC_WRAP ((ushort)0x2000) /* Last buffer descriptor */ - #define BD_SC_INTRPT ((ushort)0x1000) /* Interrupt on change */ -@@ -168,5 +211,22 @@ typedef struct bufdesc { - #define BD_ENET_TX_STATS ((ushort)0x03ff) /* All status bits */ - - -+#define RCR_LOOP (1 << 0) -+#define RCR_DRT (1 << 1) -+#define RCR_MII_MODE (1 << 2) -+#define RCR_PROM (1 << 3) -+#define RCR_BC_REJ (1 << 4) -+#define RCR_FCE (1 << 5) -+#define RCR_MAX_FL_SHIFT 16 -+#define RCR_MAX_FL_MASK (0x7ff << (RCR_MAX_FL_SHIFT)) -+#define RCR_MAX_FL_set(n) (((n) << (RCR_MAX_FL_SHIFT)) & (RCR_MAX_FL_MASK)) -+#define RCR_MAX_FL_get(n) (((n) & (RCR_MAX_FL_MASK)) >> (RCR_MAX_FL_SHIFT)) -+ -+#define TCR_GTS (1 << 0) -+#define TCR_HBC (1 << 1) -+#define TCR_FDEN (1 << 2) -+#define TCR_TFCPAUSE (1 << 3) -+#define TCR_RFCPAUSE (1 << 4) -+ - /****************************************************************************/ - #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 18:58:52.000000000 +0200 -@@ -570,7 +570,7 @@ static int imxfb_resume(struct platform_ - #define imxfb_resume NULL - #endif - --static int __init imxfb_init_fbinfo(struct platform_device *pdev) -+static int __devinit imxfb_init_fbinfo(struct platform_device *pdev) - { - struct imx_fb_platform_data *pdata = pdev->dev.platform_data; - struct fb_info *info = dev_get_drvdata(&pdev->dev); -@@ -636,7 +636,7 @@ static int __init imxfb_init_fbinfo(stru - return 0; - } - --static int __init imxfb_probe(struct platform_device *pdev) -+static int __devinit imxfb_probe(struct platform_device *pdev) - { - struct imxfb_info *fbi; - struct fb_info *info; -@@ -754,7 +754,7 @@ failed_map: - failed_getclock: - iounmap(fbi->regs); - failed_ioremap: -- release_mem_region(res->start, res->end - res->start); -+ release_mem_region(res->start, resource_size(res)); - failed_req: - kfree(info->pseudo_palette); - failed_init: -@@ -763,7 +763,7 @@ failed_init: - return ret; - } - --static int __devexit imxfb_remove(struct platform_device *pdev) -+static int imxfb_remove(struct platform_device *pdev) - { - struct imx_fb_platform_data *pdata; - struct fb_info *info = platform_get_drvdata(pdev); -@@ -785,7 +785,7 @@ static int __devexit imxfb_remove(struct - framebuffer_release(info); - - iounmap(fbi->regs); -- release_mem_region(res->start, res->end - res->start + 1); -+ release_mem_region(res->start, resource_size(res)); - clk_disable(fbi->clk); - clk_put(fbi->clk); - -@@ -794,7 +794,7 @@ static int __devexit imxfb_remove(struct - return 0; - } - --void imxfb_shutdown(struct platform_device * dev) -+void imxfb_shutdown(struct platform_device *dev) - { - struct fb_info *info = platform_get_drvdata(dev); - struct imxfb_info *fbi = info->par; -@@ -804,7 +804,8 @@ void imxfb_shutdown(struct platform_dev - static struct platform_driver imxfb_driver = { - .suspend = imxfb_suspend, - .resume = imxfb_resume, -- .remove = __devexit_p(imxfb_remove), -+// .remove = __devexit_p(imxfb_remove), -+ .remove = imxfb_remove, - .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-03-16 12:49:03.000000000 +0100 -@@ -0,0 +1,26 @@ -+/* -+ * Copyright (C) 2007 Lothar Wassmann -+ * -+ * platform_data definitions for fec_enet device -+ * -+ * 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 -+ */ -+ -+struct fec_enet_platform_data { -+ /* callback for platform specific initialization */ -+ int (*arch_init)(struct platform_device *dev); -+ void (*arch_exit)(struct platform_device *dev); -+ 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 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"; - static int recursion_bug; --static int new_text_line = 1; -+ static int new_text_line = 1; - static char printk_buf[1024]; - -+#ifdef CONFIG_DEBUG_LL -+extern void asmlinkage printascii(const char *); -+#endif - asmlinkage int vprintk(const char *fmt, va_list args) - { - int printed_len = 0; -@@ -687,6 +690,9 @@ asmlinkage int vprintk(const char *fmt, - sizeof(printk_buf) - printed_len, fmt, args); - - -+#ifdef CONFIG_DEBUG_LL -+ printascii(printk_buf); -+#endif - /* - * Copy the output into log_buf. If the caller didn't provide - * appropriate log level tags, we insert them here diff --git a/recipes/linux/linux-2.6.29+2.6.30-rc4/tx25/defconfig b/recipes/linux/linux-2.6.29+2.6.30-rc4/tx25/defconfig new file mode 100644 index 0000000000..290f8df24c --- /dev/null +++ b/recipes/linux/linux-2.6.29+2.6.30-rc4/tx25/defconfig @@ -0,0 +1,1211 @@ +# +# Automatically generated make config: don't edit +# Linux kernel version: 2.6.30-rc4 +# Tue Jun 30 22:46:56 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 is not set +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=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 + +# +# 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_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 + +# +# 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=y +CONFIG_NETCONSOLE_DYNAMIC=y +CONFIG_NETPOLL=y +# CONFIG_NETPOLL_TRAP is not set +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 +# 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 is not set +# CONFIG_LOGO_LINUX_VGA16 is not set +CONFIG_LOGO_LINUX_CLUT224=y +# CONFIG_SOUND 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_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=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 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 --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 ++#ifdef __KERNEL__ + +-#endif ++#include ++#include ++#include ++#include ++ ++#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 ++#include + #include + ++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. ++ * ++ * 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 ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#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 */ ++ .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. +- * +- * 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 +-#include +-#include +-#include +-#include +-#include +-#include +- +-#include +-#include +-#include +- +-#include +-#include +-#include +-#include +- +-#include +-#include +- +-#include +-#include +-#include +- +-#include +-#include +-#include +- +-/* 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 */ +- .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 + #include + #include ++#include + #include + #include + #include +@@ -21,98 +23,50 @@ + #include + + #include ++#include + #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 = ""; ++ ++ /* name */ ++ 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 ++#include ++ ++#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 + #include + #include ++#include ++#include ++ ++#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 ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#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 ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++ ++/* 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 + #include + ++#include + #include + #include + #include +@@ -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 + #include + +-#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 ++ ++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 ++#include ++ ++#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 + #include +-#include ++ + #include + ++#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. ++ * 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 .h, ++ * and the chip/board init code should then explicitly include ++ * .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. + * ++ * 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 + +-#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 + + #include ++#include + #include + + #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. + * ++ * 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 ++#include + #include + + #include +- + #include + +-/* 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. ++ * ++ * 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 ++ ++#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 + #include + ++#include + #include + #include + #include + ++#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 + #include + #include ++#include ++#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 + #include + #include ++#include ++#include ++#include + + #include + #include +@@ -24,8 +27,11 @@ + #include + #include + #include ++#include ++#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 + #include + ++#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 , 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 +-#include +-#include +-#include +-#include +-#include +- +-#include +- +-/* +- * 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 +- * Copyright (C) 2006 Inky Lung +- * Copyright (C) 2006 Pavel Pisa, PiKRON +- * +- * 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 +-#include +-#include +-#include +-#include +-#include +-#include +- +-#include +- +-#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 +- * initial version heavily inspired by +- * linux/arch/arm/mach-pxa/dma.c +- * +- * 2005-04-17 Pavel Pisa +- * Changed to support scatter gather DMA +- * by taking Russell's code from RiscPC +- * +- * 2006-05-31 Pavel Pisa +- * Corrected error handling code. +- * +- */ +- +-#undef DEBUG +- +-#include +-#include +-#include +-#include +-#include +- +-#include +-#include +-#include +-#include +-#include +-#include +- +-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 +-#include +-#include +-#include +-#include +- +-#include +-#include +-#include +- +-#include +-#include +-#include +- +-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<> 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 +- * 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 +- +- .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 +-#include +-#include +- +-#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 /* 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 +-#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 +- +-#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 +- +-/* +- * 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 +- +-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 +- * +- * 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 +- * Copied from the motorola bsp package and added gpio demux +- * interrupt handler +- */ +- +-#include +-#include +-#include +-#include +- +-#include +-#include +- +-#include +- +-/* +- * +- * 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 +- * +- * +- * 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 +-#include +- +-#include +-#include +- +-#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 +- * +- * 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 +- * +- * 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 +-#include +-#include +-#include +-#include +-#include +-#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 +- * +- * 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 +-#include +-#include +-#include +-#include +-#include +-#include +-#include +- +-#include +-#include +- +-#include +-#include +-#include +-#include +-#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 +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +- +-#include +-#include +-#include +-#include +- +-/* 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 + ++#include + #include + + 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 ++#include ++#include + #include ++#include + #include + #include +-#include +-#include + + #include + #include + #include + +-#include +-#include + #include +-#include +-#include ++#include + #include ++#include + #include ++#include ++ + #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 ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#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 + #include + #include ++#include ++#include + #include + #include + #include +@@ -33,9 +35,117 @@ + #include + #include + #include ++#include ++#include ++#include ++#include + + #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 ++ * ++ * 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 ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#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 +-#include +-#include +-#include + #include + #include ++#include ++#include ++#include ++#include + +-#include + #include ++#include ++#include ++ ++#include + #include + #include +-#include +-#ifdef CONFIG_I2C_IMX + #include +-#endif +-#include ++#include + #include +-#include + #include + + #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 + #include + #include ++#include + + #include + +-#include + #include +-#include +-#include + #include ++#include ++#include ++#include + + #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 + #include + #include + #include + #include ++#include + #include + #include ++#include + #include ++#include + + #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 + #include + #include +-#include + #include + #include + #include +@@ -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 + #include + #include ++#include ++#include ++#include + + #include + #include +@@ -32,11 +35,58 @@ + #include + #include + #include ++#include ++#include ++#include ++#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 ++#include + #include +- +-#include ++#include ++#include + #include + #include +-#include ++#include ++#include + +-#include + #include + #include + #include + #include ++#include + #include ++#include + #include + #include +-#include ++#include ++#include + + #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 ++#include ++#include + #include +- ++#include + #include ++#include + +-#include + #include + #include + #include ++#include ++#include + + #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 ++#include ++#include + #include +- ++#include + #include ++#include + +-#include + #include ++#include + #include + #include ++#include + + #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 + #include + #include ++#include ++#include ++#include ++#include + + #include + #include +@@ -37,7 +41,9 @@ + #include + #include + #include ++#include + #include ++#include + #include + #include + #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 ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#if defined CONFIG_I2C_IMX || defined CONFIG_I2C_IMX_MODULE ++#include ++#endif ++#include ++#include ++#include ++ ++#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 + #include + +-#include + #include + #include + #include + #include +-#include + #include + #include + #include +@@ -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 + #include +-#include + #include + #include +-#include + #include + #include + #include +@@ -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 + #include + #include ++#include + + #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 + #include + #include +-#include + #include + + #include +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 + #include + #include +-#include + #include + + #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. + * Copyright (C) 2007 MontaVista Software, Inc. +@@ -36,8 +38,13 @@ + #include + #include + ++/* 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 + #include + #include ++#include + + #include + #include +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 + #endif ++#ifdef CONFIG_MACH_MX21ADS ++#include ++#endif + #ifdef CONFIG_MACH_PCM038 + #include + #endif +@@ -34,6 +37,12 @@ + #ifdef CONFIG_MACH_QONG + #include + #endif ++#ifdef CONFIG_MACH_PCM043 ++#include ++#endif ++#ifdef CONFIG_MACH_MX27_3DS ++#include ++#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 ++ * ++ * 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 ++ ++/* ++ * The naming convention for the pad modes is MX35_PAD___ ++ * If or refers to a GPIO, it is named ++ * GPIO__ 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, ++ * ++ * ++ * 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___ ++ * If or refers to a GPIO, it is named ++ * GPIO__ ++ * ++ */ ++ ++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 +-#include +- +-#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 ++ * Copyright (C) 2009 by Jan Weitzel Phytec Messtechnik 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., 51 Franklin Street, Fifth Floor, Boston, ++ * MA 02110-1301, USA. ++ */ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++ ++#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 + #include + +-#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 + #include + #include ++#include ++ ++ ++/* 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 "); +- +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 + #include + #include +-#include ++ ++/* 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 +- * +- * 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 +-#include +-#include +- +-#include +- +-/* 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 ++ ++#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 , 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, ®_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 , 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 , 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] \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 \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 \n"); +- fprintf(stderr, "\t-O \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 \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 \n"); +- fprintf(stderr, "\t\tMake space for reserve map entries (relevant for \n\t\tdtb and asm output only)\n"); +- fprintf(stderr, "\t-S \n"); +- fprintf(stderr, "\t\tMake the blob at least long (extra space)\n"); +- fprintf(stderr, "\t-p \n"); +- fprintf(stderr, "\t\tAdd padding to the blob of long (extra space)\n"); +- fprintf(stderr, "\t-b \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 , 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 +-#include +-#include +-#include +-#include +-#include +-#include +-#include +-#include +- +-#include +-#include +- +-#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 , 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("\n"); \ +- BEGIN(INITIAL); \ +- } else { \ +- DPRINT("\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); +- } +- +-<*><> { +- 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; +- } +- +-[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; +- } +- +-[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; +- } +- +-[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; +- } +- +-"&/"{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; +- } +- +-[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; +- } +- +-"]" { +- yylloc.file = srcpos_file; +- yylloc.first_line = yylineno; +- DPRINT("/BYTESTRING\n"); +- BEGIN_DEFAULT(); +- return ']'; +- } +- +-{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("\n"); +- BEGIN(BYTESTRING); +- } +- if ((yytext[0] == '{') +- || (yytext[0] == ';')) { +- DPRINT("\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 +-#include +-#include +-#include +- +-/* end standard C headers. */ +- +-/* flex integer type definitions */ +- +-#ifndef FLEXINT_H +-#define FLEXINT_H +- +-/* C99 systems have . 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 +-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 , 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("\n"); \ +- BEGIN(INITIAL); \ +- } else { \ +- DPRINT("\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 +-#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("\n"); +- BEGIN(BYTESTRING); +- } +- if ((yytext[0] == '{') +- || (yytext[0] == ';')) { +- DPRINT("\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 +- +-#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 /* 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 /* 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 /* INFRINGES ON USER NAME SPACE */ +-# elif defined _AIX +-# define YYSTACK_ALLOC __alloca +-# elif defined _MSC_VER +-# include /* 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 /* 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 /* 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 /* 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 : ""; +- 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 , 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 +- +-#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 DT_PROPNODENAME +-%token DT_LITERAL +-%token DT_LEGACYLITERAL +-%token DT_BASE +-%token DT_BYTE +-%token DT_STRING +-%token DT_LABEL +-%token DT_REF +-%token DT_INCBIN +- +-%type propdata +-%type propdataprefix +-%type memreserve +-%type memreserves +-%type v0_memreserve +-%type v0_memreserves +-%type addr +-%type celllist +-%type cellbase +-%type cellval +-%type bytestring +-%type propdef +-%type proplist +- +-%type devicetree +-%type nodedef +-%type subnode +-%type subnodes +-%type 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 : ""; +- 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 , 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 , 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 +-#include +- +-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 +-#include +-#include +- +-#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 , 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 +- +-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 , 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 +-#include +- +-#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 +-#include +- +-#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 +-#include +- +-#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 +-#include +- +-#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 ""; +- else if (errval == 0) +- return ""; +- else if (errval > -FDT_ERRTABSIZE) { +- const char *s = fdt_errtable[-errval].str; +- +- if (s) +- return s; +- } +- +- return ""; +-} +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 +-#include +- +-#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 +-#include +- +-#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 +-#include +- +-#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 +- +-#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 + + 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 '

Linux Kernel HTML Documentation

' >> $(main_idx) && \ + echo '

Kernel Version: $(KERNELVERSION)

' >> $(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 ++ ++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 ++ ++ ++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 ++ */ ++ ++/* ++ * 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 ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++/* 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 ++ * Copyright (C) 2007-2009 Arjan Opmeer + * + * 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 ++ * Copyright (C) 2007-2009 Arjan Opmeer + * + * 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 + * Copyright (c) 2001 Frederic Lepied + * Copyright (c) 2004 Panagiotis Issaris +- * Copyright (c) 2002-2008 Ping Cheng ++ * Copyright (c) 2002-2009 Ping Cheng + * + * 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 " + #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 */ + 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 handler: unexpected completion 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 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 " + #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 + #include + #include ++#include + + #include + #include +@@ -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 + #include + #include +-#include + #include + #include + #include ++#include ++#include ++#include ++#include ++#include + +-#include + #include + #include + #include +-#include + + #include + +@@ -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 ++#include + + #include + + 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 + + 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 , 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, ®_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 , 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 , 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] \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 \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 \n"); ++ fprintf(stderr, "\t-O \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 \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 \n"); ++ fprintf(stderr, "\t\tMake space for reserve map entries (relevant for \n\t\tdtb and asm output only)\n"); ++ fprintf(stderr, "\t-S \n"); ++ fprintf(stderr, "\t\tMake the blob at least long (extra space)\n"); ++ fprintf(stderr, "\t-p \n"); ++ fprintf(stderr, "\t\tAdd padding to the blob of long (extra space)\n"); ++ fprintf(stderr, "\t-b \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 , 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 ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++#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 , 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("\n"); \ ++ BEGIN(INITIAL); \ ++ } else { \ ++ DPRINT("\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); ++ } ++ ++<*><> { ++ 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; ++ } ++ ++[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; ++ } ++ ++[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; ++ } ++ ++[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; ++ } ++ ++"&/"{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; ++ } ++ ++[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; ++ } ++ ++"]" { ++ yylloc.file = srcpos_file; ++ yylloc.first_line = yylineno; ++ DPRINT("/BYTESTRING\n"); ++ BEGIN_DEFAULT(); ++ return ']'; ++ } ++ ++{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("\n"); ++ BEGIN(BYTESTRING); ++ } ++ if ((yytext[0] == '{') ++ || (yytext[0] == ';')) { ++ DPRINT("\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 ++#include ++#include ++#include ++ ++/* end standard C headers. */ ++ ++/* flex integer type definitions */ ++ ++#ifndef FLEXINT_H ++#define FLEXINT_H ++ ++/* C99 systems have . 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 ++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 , 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("\n"); \ ++ BEGIN(INITIAL); \ ++ } else { \ ++ DPRINT("\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 ++#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("\n"); ++ BEGIN(BYTESTRING); ++ } ++ if ((yytext[0] == '{') ++ || (yytext[0] == ';')) { ++ DPRINT("\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 ++ ++#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 /* 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 /* 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 /* INFRINGES ON USER NAME SPACE */ ++# elif defined _AIX ++# define YYSTACK_ALLOC __alloca ++# elif defined _MSC_VER ++# include /* 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 /* 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 /* 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 /* 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 : ""; ++ 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 , 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 ++ ++#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 DT_PROPNODENAME ++%token DT_LITERAL ++%token DT_LEGACYLITERAL ++%token DT_BASE ++%token DT_BYTE ++%token DT_STRING ++%token DT_LABEL ++%token DT_REF ++%token DT_INCBIN ++ ++%type propdata ++%type propdataprefix ++%type memreserve ++%type memreserves ++%type v0_memreserve ++%type v0_memreserves ++%type addr ++%type celllist ++%type cellbase ++%type cellval ++%type bytestring ++%type propdef ++%type proplist ++ ++%type devicetree ++%type nodedef ++%type subnode ++%type subnodes ++%type 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 : ""; ++ 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 , 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 , 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 ++#include ++ ++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 ++#include ++ ++#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 ++#include ++ ++#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 ++#include ++ ++#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 ++#include ++ ++#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 ""; ++ else if (errval == 0) ++ return ""; ++ else if (errval > -FDT_ERRTABSIZE) { ++ const char *s = fdt_errtable[-errval].str; ++ ++ if (s) ++ return s; ++ } ++ ++ return ""; ++} +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 ++#include ++ ++#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 ++#include ++ ++#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 ++#include ++#include ++ ++#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 ++#include ++ ++#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 ++ ++#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 , 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 ++ ++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 , 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 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 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.29+2.6.30-rc4/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-karo.diff new file mode 100644 index 0000000000..17765b46f6 --- /dev/null +++ b/recipes/linux/linux-2.6.29+2.6.30-rc4/tx25/linux-2.6.30-rc4-karo.diff @@ -0,0 +1,15337 @@ +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-08 13:11:18.000000000 +0200 +@@ -0,0 +1,1203 @@ ++# ++# Automatically generated make config: don't edit ++# Linux kernel version: 2.6.30-rc4 ++# Fri Jun 5 21:17: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_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 is not set ++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=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 ++ ++# ++# 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_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 ++ ++# ++# 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=y ++CONFIG_NETCONSOLE_DYNAMIC=y ++CONFIG_NETPOLL=y ++# CONFIG_NETPOLL_TRAP is not set ++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 ++# 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-08 13:11:18.000000000 +0200 +@@ -0,0 +1,1203 @@ ++# ++# Automatically generated make config: don't edit ++# Linux kernel version: 2.6.30-rc4 ++# Fri Jun 5 21:17: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_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 is not set ++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=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 ++ ++# ++# 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_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 ++ ++# ++# 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=y ++CONFIG_NETCONSOLE_DYNAMIC=y ++CONFIG_NETPOLL=y ++# CONFIG_NETPOLL_TRAP is not set ++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 ++# 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/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-08 12:45:22.000000000 +0200 +@@ -6,14 +6,26 @@ choice + + config MACH_MX21 + bool "i.MX21 support" ++ select ARCH_MXC_IOMUX_V2 ++ select ARCH_MXC_HAS_NFC_V1 + help + This enables support for Freescale's MX2 based i.MX21 processor. + + config MACH_MX27 + bool "i.MX27 support" ++ select ARCH_MXC_IOMUX_V2 ++ select ARCH_MXC_HAS_NFC_V1 + 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_V1_1 ++ select PHYLIB if FEC ++ help ++ This enables support for Freescale's MX2 based i.MX25 processor. ++ + endchoice + + comment "MX2 platforms:" +@@ -39,6 +51,26 @@ config MACH_PCM038 + Include support for phyCORE-i.MX27 (aka pcm038) platform. This + includes specific configurations for the module and its peripherals. + ++config MACH_TX25 ++ bool "Support Ka-Ro electronics TX25 module" ++ depends on MACH_MX25 ++ help ++ Include support for Ka-Ro TX25 processor module ++ ++config KARO_DEBUG ++ bool "Enable Ka-Ro specific debug messages" ++ depends on MACH_TX25 || MACH_TX27 ++ help ++ Compile the architecture specific files with -DDEBUG to enable ++ additional debug messages ++ ++config MACH_STK5_BASEBOARD ++ bool "Ka-Ro Starterkit-5 (STK5) development board" ++ depends on MACH_TX27 || MACH_TX25 ++ help ++ This adds board specific devices that can be found on Ka-Ro's ++ STK5 evaluation board. ++ + choice + prompt "Baseboard" + depends on MACH_PCM038 +@@ -60,3 +92,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:59:14.000000000 +0200 +@@ -2,17 +2,31 @@ + # Makefile for the linux kernel. + # + ++ifeq ($(CONFIG_KARO_DEBUG),y) ++ EXTRA_CFLAGS += -DDEBUG ++endif ++ + # Object file lists. + +-obj-y := generic.o devices.o serial.o ++obj-y := generic.o serial.o ++obj-$(CONFIG_MACH_MX25) += devices_mx25.o ++ifeq ($(CONFIG_MACH_MX25),) ++obj-y += devices.o ++endif ++ ++obj-$(CONFIG_MACH_MX21) += clock_imx21.o + +-obj-$(CONFIG_MACH_MX21) += clock_imx21.o ++obj-$(CONFIG_MACH_MX25) += clock_imx25.o ++obj-$(CONFIG_MACH_MX25) += cpu_imx25.o + +-obj-$(CONFIG_MACH_MX27) += cpu_imx27.o +-obj-$(CONFIG_MACH_MX27) += clock_imx27.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 ++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 ++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: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 + initrd_phys-$(CONFIG_MACH_MX27) := 0xA0800000 ++ ++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:59:15.000000000 +0200 +@@ -890,7 +890,7 @@ static struct clk clko_clk = { + .con_id = n, \ + .clk = &c, \ + }, +-static struct clk_lookup lookups[] __initdata = { ++static struct clk_lookup lookups[] = { + /* 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-08 12:46:51.000000000 +0200 +@@ -0,0 +1,1848 @@ ++/* ++ * Copyright 2008 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 ++ */ ++ ++/* based on mach-mx27/clock.c */ ++ ++#include ++#include ++#include ++//#include ++ ++#include ++//#include ++ ++#include ++#include ++#include ++ ++/* Register offsets */ ++#define MXC_CCM_MPCTL (IO_ADDRESS(CCM_BASE_ADDR) + 0x00) ++#define MXC_CCM_UPCTL (IO_ADDRESS(CCM_BASE_ADDR) + 0x04) ++#define MXC_CCM_CCTL (IO_ADDRESS(CCM_BASE_ADDR) + 0x08) ++#define MXC_CCM_CGCR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x0C) ++#define MXC_CCM_CGCR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x10) ++#define MXC_CCM_CGCR2 (IO_ADDRESS(CCM_BASE_ADDR) + 0x14) ++#define MXC_CCM_PCDR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x18) ++#define MXC_CCM_PCDR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x1C) ++#define MXC_CCM_PCDR2 (IO_ADDRESS(CCM_BASE_ADDR) + 0x20) ++#define MXC_CCM_PCDR3 (IO_ADDRESS(CCM_BASE_ADDR) + 0x24) ++#define MXC_CCM_RCSR (IO_ADDRESS(CCM_BASE_ADDR) + 0x28) ++#define MXC_CCM_CRDR (IO_ADDRESS(CCM_BASE_ADDR) + 0x2C) ++#define MXC_CCM_DCVR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x30) ++#define MXC_CCM_DCVR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x34) ++#define MXC_CCM_DCVR2 (IO_ADDRESS(CCM_BASE_ADDR) + 0x38) ++#define MXC_CCM_DCVR3 (IO_ADDRESS(CCM_BASE_ADDR) + 0x3C) ++#define MXC_CCM_LTR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x40) ++#define MXC_CCM_LTR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x44) ++#define MXC_CCM_LTR2 (IO_ADDRESS(CCM_BASE_ADDR) + 0x48) ++#define MXC_CCM_LTR3 (IO_ADDRESS(CCM_BASE_ADDR) + 0x4C) ++#define MXC_CCM_LTBR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x50) ++#define MXC_CCM_LTBR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x54) ++#define MXC_CCM_PMCR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x58) ++#define MXC_CCM_PMCR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x5C) ++#define MXC_CCM_PMCR2 (IO_ADDRESS(CCM_BASE_ADDR) + 0x60) ++#define MXC_CCM_MCR (IO_ADDRESS(CCM_BASE_ADDR) + 0x64) ++ ++#define MXC_CCM_MPCTL_BRMO (1 << 31) ++#define MXC_CCM_MPCTL_PD_OFFSET 26 ++#define MXC_CCM_MPCTL_PD_MASK (0xf << 26) ++#define MXC_CCM_MPCTL_MFD_OFFSET 16 ++#define MXC_CCM_MPCTL_MFD_MASK (0x3ff << 16) ++#define MXC_CCM_MPCTL_MFI_OFFSET 10 ++#define MXC_CCM_MPCTL_MFI_MASK (0xf << 10) ++#define MXC_CCM_MPCTL_MFN_OFFSET 0 ++#define MXC_CCM_MPCTL_MFN_MASK 0x3ff ++#define MXC_CCM_MPCTL_LF (1 << 15) ++ ++#define MXC_CCM_UPCTL_BRMO (1 << 31) ++#define MXC_CCM_UPCTL_PD_OFFSET 26 ++#define MXC_CCM_UPCTL_PD_MASK (0xf << 26) ++#define MXC_CCM_UPCTL_MFD_OFFSET 16 ++#define MXC_CCM_UPCTL_MFD_MASK (0x3ff << 16) ++#define MXC_CCM_UPCTL_MFI_OFFSET 10 ++#define MXC_CCM_UPCTL_MFI_MASK (0xf << 10) ++#define MXC_CCM_UPCTL_MFN_OFFSET 0 ++#define MXC_CCM_UPCTL_MFN_MASK 0x3ff ++#define MXC_CCM_UPCTL_LF (1 << 15) ++ ++#define MXC_CCM_CCTL_ARM_OFFSET 30 ++#define MXC_CCM_CCTL_ARM_MASK (0x3 << 30) ++#define MXC_CCM_CCTL_AHB_OFFSET 28 ++#define MXC_CCM_CCTL_AHB_MASK (0x3 << 28) ++#define MXC_CCM_CCTL_MPLL_RST (1 << 27) ++#define MXC_CCM_CCTL_UPLL_RST (1 << 26) ++#define MXC_CCM_CCTL_LP_CTL_OFFSET 24 ++#define MXC_CCM_CCTL_LP_CTL_MASK (0x3 << 24) ++#define MXC_CCM_CCTL_LP_MODE_RUN (0x0 << 24) ++#define MXC_CCM_CCTL_LP_MODE_WAIT (0x1 << 24) ++#define MXC_CCM_CCTL_LP_MODE_DOZE (0x2 << 24) ++#define MXC_CCM_CCTL_LP_MODE_STOP (0x3 << 24) ++#define MXC_CCM_CCTL_UPLL_DISABLE (1 << 23) ++#define MXC_CCM_CCTL_MPLL_BYPASS (1 << 22) ++#define MXC_CCM_CCTL_USB_DIV_OFFSET 16 ++#define MXC_CCM_CCTL_USB_DIV_MASK (0x3 << 16) ++#define MXC_CCM_CCTL_CG_CTRL (1 << 15) ++#define MXC_CCM_CCTL_ARM_SRC (1 << 14) ++ ++#define MXC_CCM_CGCR0_HCLK_ATA_OFFSET (16 + 0) ++#define MXC_CCM_CGCR0_HCLK_BROM_OFFSET (16 + 1) ++#define MXC_CCM_CGCR0_HCLK_CSI_OFFSET (16 + 2) ++#define MXC_CCM_CGCR0_HCLK_EMI_OFFSET (16 + 3) ++#define MXC_CCM_CGCR0_HCLK_ESAI_OFFSET (16 + 4) ++#define MXC_CCM_CGCR0_HCLK_ESDHC1_OFFSET (16 + 5) ++#define MXC_CCM_CGCR0_HCLK_ESDHC2_OFFSET (16 + 6) ++#define MXC_CCM_CGCR0_HCLK_FEC_OFFSET (16 + 7) ++#define MXC_CCM_CGCR0_HCLK_LCDC_OFFSET (16 + 8) ++#define MXC_CCM_CGCR0_HCLK_RTIC_OFFSET (16 + 9) ++#define MXC_CCM_CGCR0_HCLK_SDMA_OFFSET (16 + 10) ++#define MXC_CCM_CGCR0_HCLK_SLCDC_OFFSET (16 + 11) ++#define MXC_CCM_CGCR0_HCLK_USBOTG_OFFSET (16 + 12) ++ ++#define MXC_CCM_CGCR0_PER_CSI_OFFSET 0 ++#define MXC_CCM_CGCR0_PER_EPIT_OFFSET 1 ++#define MXC_CCM_CGCR0_PER_ESAI_OFFSET 2 ++#define MXC_CCM_CGCR0_PER_ESDHC1_OFFSET 3 ++#define MXC_CCM_CGCR0_PER_ESDHC2_OFFSET 4 ++#define MXC_CCM_CGCR0_PER_GPT_OFFSET 5 ++#define MXC_CCM_CGCR0_PER_I2C_OFFSET 6 ++#define MXC_CCM_CGCR0_PER_LCDC_OFFSET 7 ++#define MXC_CCM_CGCR0_PER_NFC_OFFSET 8 ++#define MXC_CCM_CGCR0_PER_OWIRE_OFFSET 9 ++#define MXC_CCM_CGCR0_PER_PWM_OFFSET 10 ++#define MXC_CCM_CGCR0_PER_SIM1_OFFSET 11 ++#define MXC_CCM_CGCR0_PER_SIM2_OFFSET 12 ++#define MXC_CCM_CGCR0_PER_SSI1_OFFSET 13 ++#define MXC_CCM_CGCR0_PER_SSI2_OFFSET 14 ++#define MXC_CCM_CGCR0_PER_UART_OFFSET 15 ++ ++#define MXC_CCM_CGCR1_AUDMUX_OFFSET 0 ++#define MXC_CCM_CGCR1_ATA_OFFSET 1 ++#define MXC_CCM_CGCR1_CAN1_OFFSET 2 ++#define MXC_CCM_CGCR1_CAN2_OFFSET 3 ++#define MXC_CCM_CGCR1_CSI_OFFSET 4 ++#define MXC_CCM_CGCR1_CSPI1_OFFSET 5 ++#define MXC_CCM_CGCR1_CSPI2_OFFSET 6 ++#define MXC_CCM_CGCR1_CSPI3_OFFSET 7 ++#define MXC_CCM_CGCR1_DRYICE_OFFSET 8 ++#define MXC_CCM_CGCR1_ECT_OFFSET 9 ++#define MXC_CCM_CGCR1_EPIT1_OFFSET 10 ++#define MXC_CCM_CGCR1_EPIT2_OFFSET 11 ++#define MXC_CCM_CGCR1_ESAI_OFFSET 12 ++#define MXC_CCM_CGCR1_ESDHC1_OFFSET 13 ++#define MXC_CCM_CGCR1_ESDHC2_OFFSET 14 ++#define MXC_CCM_CGCR1_FEC_OFFSET 15 ++#define MXC_CCM_CGCR1_GPIO1_OFFSET 16 ++#define MXC_CCM_CGCR1_GPIO2_OFFSET 17 ++#define MXC_CCM_CGCR1_GPIO3_OFFSET 18 ++#define MXC_CCM_CGCR1_GPT1_OFFSET 19 ++#define MXC_CCM_CGCR1_GPT2_OFFSET 20 ++#define MXC_CCM_CGCR1_GPT3_OFFSET 21 ++#define MXC_CCM_CGCR1_GPT4_OFFSET 22 ++#define MXC_CCM_CGCR1_I2C1_OFFSET 23 ++#define MXC_CCM_CGCR1_I2C2_OFFSET 24 ++#define MXC_CCM_CGCR1_I2C3_OFFSET 25 ++#define MXC_CCM_CGCR1_IIM_OFFSET 26 ++#define MXC_CCM_CGCR1_IOMUXC_OFFSET 27 ++#define MXC_CCM_CGCR1_KPP_OFFSET 28 ++#define MXC_CCM_CGCR1_LCDC_OFFSET 29 ++#define MXC_CCM_CGCR1_OWIRE_OFFSET 30 ++#define MXC_CCM_CGCR1_PWM1_OFFSET 31 ++ ++#define MXC_CCM_CGCR2_PWM2_OFFSET (32 - 32) ++#define MXC_CCM_CGCR2_PWM3_OFFSET (33 - 32) ++#define MXC_CCM_CGCR2_PWM4_OFFSET (34 - 32) ++#define MXC_CCM_CGCR2_RNGB_OFFSET (35 - 32) ++#define MXC_CCM_CGCR2_RTIC_OFFSET (36 - 32) ++#define MXC_CCM_CGCR2_SCC_OFFSET (37 - 32) ++#define MXC_CCM_CGCR2_SDMA_OFFSET (38 - 32) ++#define MXC_CCM_CGCR2_SIM1_OFFSET (39 - 32) ++#define MXC_CCM_CGCR2_SIM2_OFFSET (40 - 32) ++#define MXC_CCM_CGCR2_SLCDC_OFFSET (41 - 32) ++#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_UART1_OFFSET (46 - 32) ++#define MXC_CCM_CGCR2_UART2_OFFSET (47 - 32) ++#define MXC_CCM_CGCR2_UART3_OFFSET (48 - 32) ++#define MXC_CCM_CGCR2_UART4_OFFSET (49 - 32) ++#define MXC_CCM_CGCR2_UART5_OFFSET (50 - 32) ++#define MXC_CCM_CGCR2_WDOG_OFFSET (51 - 32) ++ ++#define MXC_CCM_PCDR1_PERDIV1_MASK 0x3f ++ ++#define MXC_CCM_MCR_USB_XTAL_MUX_OFFSET 31 ++#define MXC_CCM_MCR_CLKO_EN_OFFSET 30 ++#define MXC_CCM_MCR_CLKO_DIV_OFFSET 24 ++#define MXC_CCM_MCR_CLKO_DIV_MASK (0x3F << 24) ++#define MXC_CCM_MCR_CLKO_SEL_OFFSET 20 ++#define MXC_CCM_MCR_CLKO_SEL_MASK (0xF << 20) ++#define MXC_CCM_MCR_ESAI_CLK_MUX_OFFSET 19 ++#define MXC_CCM_MCR_SSI2_CLK_MUX_OFFSET 18 ++#define MXC_CCM_MCR_SSI1_CLK_MUX_OFFSET 17 ++#define MXC_CCM_MCR_USB_CLK_MUX_OFFSET 16 ++ ++#define MXC_CCM_MCR_PER_CLK_MUX_MASK (0xFFFF << 0) ++ ++#define OSC24M_CLK_FREQ 24000000 /* 24MHz reference clk */ ++#define OSC32K_CLK_FREQ 32768 /* 32.768kHz oscillator in */ ++ ++static struct clk mpll_clk; ++static struct clk upll_clk; ++static struct clk ahb_clk; ++static struct clk upll_24610k_clk; ++ ++static int _clk_enable(struct clk *clk) ++{ ++ unsigned long reg; ++ ++ if (!clk->enable_reg) ++ return 0; ++ ++ reg = __raw_readl(clk->enable_reg); ++ reg |= 1 << clk->enable_shift; ++ __raw_writel(reg, clk->enable_reg); ++ ++ return 0; ++} ++ ++static void _clk_disable(struct clk *clk) ++{ ++ unsigned long reg; ++ ++ if (!clk->enable_reg) ++ return; ++ ++ reg = __raw_readl(clk->enable_reg); ++ reg &= ~(1 << clk->enable_shift); ++ __raw_writel(reg, clk->enable_reg); ++} ++ ++static int _clk_upll_enable(struct clk *clk) ++{ ++ unsigned long reg; ++ ++ reg = __raw_readl(MXC_CCM_CCTL); ++ reg &= ~MXC_CCM_CCTL_UPLL_DISABLE; ++ __raw_writel(reg, MXC_CCM_CCTL); ++ ++ while (!(__raw_readl(MXC_CCM_UPCTL) & MXC_CCM_UPCTL_LF)) ++ cpu_relax(); ++ ++ return 0; ++} ++ ++static void _clk_upll_disable(struct clk *clk) ++{ ++ unsigned long reg; ++ ++ reg = __raw_readl(MXC_CCM_CCTL); ++ reg |= MXC_CCM_CCTL_UPLL_DISABLE; ++ __raw_writel(reg, MXC_CCM_CCTL); ++} ++ ++static int _perclk_enable(struct clk *clk) ++{ ++ unsigned long reg; ++ ++ reg = __raw_readl(MXC_CCM_CGCR0); ++ reg |= 1 << clk->id; ++ __raw_writel(reg, MXC_CCM_CGCR0); ++ ++ return 0; ++} ++ ++static void _perclk_disable(struct clk *clk) ++{ ++ unsigned long reg; ++ ++ reg = __raw_readl(MXC_CCM_CGCR0); ++ reg &= ~(1 << clk->id); ++ __raw_writel(reg, MXC_CCM_CGCR0); ++} ++ ++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) */ ++ signed long mfn; /* Multiplication Factor (Integer part) */ ++ signed long mfd; /* Multiplication Factor (Denominator Part) */ ++ signed long tmp; ++ unsigned long ref_freq = clk_get_rate(clk->parent); ++ ++ 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; ++ 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); ++ ++ mfn = (mfn + ((mfn < 0) ? 1024 : 0)) & 0x3ff; ++ pd--; ++ mfd--; ++ ++ /* Change the Pll value */ ++ reg = (mfi << MXC_CCM_MPCTL_MFI_OFFSET) | ++ (mfn << MXC_CCM_MPCTL_MFN_OFFSET) | ++ (mfd << MXC_CCM_MPCTL_MFD_OFFSET) | ++ (pd << MXC_CCM_MPCTL_PD_OFFSET); ++ ++ if (clk == &mpll_clk) { ++ printk(KERN_DEBUG "Changing MPCTL from %08x to %08lx\n", ++ __raw_readl(MXC_CCM_MPCTL), reg); ++ } else if (clk == &upll_clk) { ++ printk(KERN_DEBUG "Changing UPCTL from %08x to %08lx\n", ++ __raw_readl(MXC_CCM_UPCTL), reg); ++ } ++ if (clk == &mpll_clk) ++ __raw_writel(reg, MXC_CCM_MPCTL); ++ else if (clk == &upll_clk) ++ __raw_writel(reg, MXC_CCM_UPCTL); ++ return 0; ++} ++ ++static unsigned long _clk_pll_getrate(struct clk *clk) ++{ ++ unsigned long rate; ++ signed long mfi, mfn, mfd, pdf; ++ unsigned long ref_clk; ++ unsigned long reg; ++ ++ ref_clk = clk_get_rate(clk->parent); ++ ++ if (clk == &mpll_clk) { ++ reg = __raw_readl(MXC_CCM_MPCTL); ++ pdf = (reg & MXC_CCM_MPCTL_PD_MASK) >> MXC_CCM_MPCTL_PD_OFFSET; ++ mfd = (reg & MXC_CCM_MPCTL_MFD_MASK) >> MXC_CCM_MPCTL_MFD_OFFSET; ++ mfi = (reg & MXC_CCM_MPCTL_MFI_MASK) >> MXC_CCM_MPCTL_MFI_OFFSET; ++ mfn = (reg & MXC_CCM_MPCTL_MFN_MASK) >> MXC_CCM_MPCTL_MFN_OFFSET; ++ } else if (clk == &upll_clk) { ++ reg = __raw_readl(MXC_CCM_UPCTL); ++ pdf = (reg & MXC_CCM_UPCTL_PD_MASK) >> MXC_CCM_UPCTL_PD_OFFSET; ++ mfd = (reg & MXC_CCM_UPCTL_MFD_MASK) >> MXC_CCM_UPCTL_MFD_OFFSET; ++ mfi = (reg & MXC_CCM_UPCTL_MFI_MASK) >> MXC_CCM_UPCTL_MFI_OFFSET; ++ mfn = (reg & MXC_CCM_UPCTL_MFN_MASK) >> MXC_CCM_UPCTL_MFN_OFFSET; ++ } else { ++ BUG(); /* oops */ ++ } ++ ++ mfi = (mfi < 5) ? 5 : mfi; ++ rate = 2LL * ref_clk * mfn; ++ do_div(rate, mfd + 1); ++ rate = 2LL * ref_clk * mfi + rate; ++ do_div(rate, pdf + 1); ++ ++ return rate; ++} ++ ++static unsigned long _clk_cpu_round_rate(struct clk *clk, unsigned long rate) ++{ ++ int div = clk_get_rate(clk->parent) / rate; ++ ++ if (clk_get_rate(clk->parent) % rate) ++ div++; ++ ++ if (div > 4) ++ div = 4; ++ ++ return clk_get_rate(clk->parent) / div; ++} ++ ++static int _clk_cpu_set_rate(struct clk *clk, unsigned long rate) ++{ ++ int div, reg; ++ unsigned long cctl = __raw_readl(MXC_CCM_CCTL); ++ ++ div = clk_get_rate(clk->parent) / rate; ++ ++ if (div > 4 || div < 1 || ((clk_get_rate(clk->parent) / div) != rate)) ++ return -EINVAL; ++ div--; ++ ++ reg = (cctl & ~MXC_CCM_CCTL_ARM_MASK) | ++ (div << MXC_CCM_CCTL_ARM_OFFSET); ++ __raw_writel(reg, MXC_CCM_CCTL); ++ ++ return 0; ++} ++ ++static unsigned long _clk_cpu_getrate(struct clk *clk) ++{ ++ unsigned long div; ++ unsigned long cctl = __raw_readl(MXC_CCM_CCTL); ++ unsigned long rate; ++ ++ div = (cctl & MXC_CCM_CCTL_ARM_MASK) >> MXC_CCM_CCTL_ARM_OFFSET; ++ ++ rate = clk_get_rate(clk->parent) / (div + 1); ++ ++ if (cctl & MXC_CCM_CCTL_ARM_SRC) { ++ rate *= 3; ++ rate /= 4; ++ } ++ return rate; ++} ++ ++static unsigned long _clk_ahb_getrate(struct clk *clk) ++{ ++ unsigned long div; ++ unsigned long cctl = __raw_readl(MXC_CCM_CCTL); ++ ++ div = (cctl & MXC_CCM_CCTL_AHB_MASK) >> MXC_CCM_CCTL_AHB_OFFSET; ++ ++ return clk_get_rate(clk->parent) / (div + 1); ++} ++ ++static void __iomem *pcdr_a[4] = { ++ MXC_CCM_PCDR0, MXC_CCM_PCDR1, MXC_CCM_PCDR2, MXC_CCM_PCDR3 ++}; ++ ++static unsigned long _clk_perclkx_getrate(struct clk *clk) ++{ ++ unsigned long perclk_pdf; ++ unsigned long pcdr; ++ ++ if (clk->id < 0 || clk->id > 15) ++ return 0; ++ ++ pcdr = __raw_readl(pcdr_a[clk->id >> 2]); ++ ++ perclk_pdf = ++ (pcdr >> ((clk->id & 3) << 3)) & MXC_CCM_PCDR1_PERDIV1_MASK; ++ ++ return clk_get_rate(clk->parent) / (perclk_pdf + 1); ++} ++ ++static unsigned long _clk_perclkx_round_rate(struct clk *clk, ++ unsigned long rate) ++{ ++ unsigned long div; ++ ++ div = clk_get_rate(clk->parent) / rate; ++ if (clk_get_rate(clk->parent) % rate) ++ div++; ++ ++ if (div > 64) ++ div = 64; ++ ++ return clk_get_rate(clk->parent) / div; ++} ++ ++static int _clk_perclkx_set_rate(struct clk *clk, unsigned long rate) ++{ ++ unsigned long reg; ++ unsigned long div; ++ ++ if (clk->id < 0 || clk->id > 15) ++ 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--; ++ ++ reg = ++ __raw_readl(pcdr_a[clk->id >> 2]) & ~(MXC_CCM_PCDR1_PERDIV1_MASK << ++ ((clk->id & 3) << 3)); ++ reg |= div << ((clk->id & 3) << 3); ++ __raw_writel(reg, pcdr_a[clk->id >> 2]); ++ ++ return 0; ++} ++ ++static int _clk_perclkx_set_parent(struct clk *clk, struct clk *parent) ++{ ++ unsigned long mcr; ++ ++ if (clk->parent == parent) ++ return 0; ++ if (parent != &upll_clk && parent != &ahb_clk) ++ return -EINVAL; ++ ++ clk->parent = parent; ++ mcr = __raw_readl(MXC_CCM_MCR); ++ if (parent == &upll_clk) ++ mcr |= (1 << clk->id); ++ else ++ mcr &= ~(1 << clk->id); ++ ++ __raw_writel(mcr, MXC_CCM_MCR); ++ ++ return 0; ++} ++ ++static int _clk_perclkx_set_parent3(struct clk *clk, struct clk *parent) ++{ ++ unsigned long mcr = __raw_readl(MXC_CCM_MCR); ++ int bit; ++ ++ if (clk->parent == parent) ++ return 0; ++ if (parent != &upll_clk && parent != &ahb_clk && ++ parent != &upll_24610k_clk) ++ return -EINVAL; ++ ++ switch (clk->id) { ++ case 2: ++ bit = MXC_CCM_MCR_ESAI_CLK_MUX_OFFSET; ++ break; ++ case 13: ++ bit = MXC_CCM_MCR_SSI1_CLK_MUX_OFFSET; ++ break; ++ case 14: ++ bit = MXC_CCM_MCR_SSI2_CLK_MUX_OFFSET; ++ break; ++ default: ++ return -EINVAL; ++ } ++ ++ if (parent == &upll_24610k_clk) { ++ mcr |= bit; ++ __raw_writel(mcr, MXC_CCM_MCR); ++ clk->parent = parent; ++ } else { ++ mcr &= ~bit; ++ __raw_writel(mcr, MXC_CCM_MCR); ++ return _clk_perclkx_set_parent(clk, parent); ++ } ++ ++ return 0; ++} ++ ++static unsigned long _clk_ipg_getrate(struct clk *clk) ++{ ++ return clk_get_rate(clk->parent) / 2; /* Always AHB / 2 */ ++} ++ ++/* Top-level clocks */ ++static unsigned long ckih_rate = OSC24M_CLK_FREQ; ++ ++static unsigned long clk_ckih_get_rate(struct clk *clk) ++{ ++ return ckih_rate; ++} ++ ++static unsigned long clk_ckil_get_rate(struct clk *clk) ++{ ++ return OSC32K_CLK_FREQ; ++} ++ ++static struct clk osc24m_clk = { ++ .get_rate = clk_ckih_get_rate, ++}; ++ ++static struct clk osc32k_clk = { ++ .get_rate = clk_ckil_get_rate, ++}; ++ ++static struct clk mpll_clk = { ++ .parent = &osc24m_clk, ++ .get_rate = _clk_pll_getrate, ++ .set_rate = _clk_pll_set_rate, ++}; ++ ++static struct clk upll_clk = { ++ .parent = &osc24m_clk, ++ .get_rate = _clk_pll_getrate, ++ .set_rate = _clk_pll_set_rate, ++ .enable = _clk_upll_enable, ++ .disable = _clk_upll_disable, ++}; ++ ++static unsigned long _clk_24610k_getrate(struct clk *clk) ++{ ++ long long rate = clk_get_rate(clk->parent) * 2461LL; ++ ++ do_div(rate, 24000); ++ ++ return rate; /* Always (UPLL * 24.61 / 240) */ ++} ++ ++static struct clk upll_24610k_clk = { ++ .parent = &upll_clk, ++ .get_rate = _clk_24610k_getrate, ++}; ++ ++/* Mid-level clocks */ ++ ++static struct clk cpu_clk = { /* ARM clock */ ++ .parent = &mpll_clk, ++ .set_rate = _clk_cpu_set_rate, ++ .get_rate = _clk_cpu_getrate, ++ .round_rate = _clk_cpu_round_rate, ++}; ++ ++static struct clk ahb_clk = { /* a.k.a. HCLK */ ++ .parent = &cpu_clk, ++ .get_rate = _clk_ahb_getrate, ++}; ++ ++static struct clk ipg_clk = { ++ .parent = &ahb_clk, ++ .get_rate = _clk_ipg_getrate, ++}; ++ ++/* Bottom-level clocks */ ++ ++struct clk usbotg_clk = { ++ .id = 0, ++ .parent = &ahb_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR0, ++ .enable_shift = MXC_CCM_CGCR0_HCLK_USBOTG_OFFSET, ++ .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, ++}; ++ ++struct clk emi_clk = { ++ .id = 0, ++ .parent = &ahb_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR0, ++ .enable_shift = MXC_CCM_CGCR0_HCLK_EMI_OFFSET, ++ .disable = _clk_disable, ++}; ++ ++struct clk brom_clk = { ++ .id = 0, ++ .parent = &ahb_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR0, ++ .enable_shift = MXC_CCM_CGCR0_HCLK_BROM_OFFSET, ++ .disable = _clk_disable, ++}; ++ ++static struct clk per_clk[] = { ++ { ++ .id = 0, ++ .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, ++ .get_rate = _clk_perclkx_getrate, ++ .enable = _perclk_enable, ++ .disable = _perclk_disable, ++ }, ++ { ++ .id = 1, ++ .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, ++ .get_rate = _clk_perclkx_getrate, ++ .enable = _perclk_enable, ++ .disable = _perclk_disable, ++ }, ++ { ++ .id = 2, ++ .parent = &ahb_clk, /* can be AHB or UPLL or 24.61MHz */ ++ .round_rate = _clk_perclkx_round_rate, ++ .set_rate = _clk_perclkx_set_rate, ++ .set_parent = _clk_perclkx_set_parent3, ++ .get_rate = _clk_perclkx_getrate, ++ .enable = _perclk_enable, ++ .disable = _perclk_disable, ++ }, ++ { ++ .id = 3, ++ .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, ++ .get_rate = _clk_perclkx_getrate, ++ .enable = _perclk_enable, ++ }, ++ { ++ .id = 4, ++ .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, ++ .get_rate = _clk_perclkx_getrate, ++ .enable = _perclk_enable, ++ .disable = _perclk_disable, ++ }, ++ { ++ .id = 5, ++ .parent = &upll_clk, /* can be AHB or UPLL */ ++ .round_rate = _clk_perclkx_round_rate, ++ .set_rate = _clk_perclkx_set_rate, ++ .set_parent = _clk_perclkx_set_parent, ++ .get_rate = _clk_perclkx_getrate, ++ .enable = _perclk_enable, ++ .disable = _perclk_disable, ++ }, ++ { ++ .id = 6, ++ .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, ++ .get_rate = _clk_perclkx_getrate, ++ .enable = _perclk_enable, ++ .disable = _perclk_disable, ++ }, ++ { ++ .id = 7, ++ .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, ++ .get_rate = _clk_perclkx_getrate, ++ .enable = _perclk_enable, ++ .disable = _perclk_disable, ++ }, ++ { ++ .id = 8, ++ .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, ++ .get_rate = _clk_perclkx_getrate, ++ .enable = _perclk_enable, ++ .disable = _perclk_disable, ++ }, ++ { ++ .id = 9, ++ .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, ++ .get_rate = _clk_perclkx_getrate, ++ .enable = _perclk_enable, ++ .disable = _perclk_disable, ++ }, ++ { ++ .id = 10, ++ .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, ++ .get_rate = _clk_perclkx_getrate, ++ .enable = _perclk_enable, ++ .disable = _perclk_disable, ++ }, ++ { ++ .id = 11, ++ .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, ++ .get_rate = _clk_perclkx_getrate, ++ .enable = _perclk_enable, ++ .disable = _perclk_disable, ++ }, ++ { ++ .id = 12, ++ .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, ++ .get_rate = _clk_perclkx_getrate, ++ .enable = _perclk_enable, ++ .disable = _perclk_disable, ++ }, ++ { ++ .id = 13, ++ .parent = &ahb_clk, /* can be AHB or UPLL or 24.61MHz */ ++ .round_rate = _clk_perclkx_round_rate, ++ .set_rate = _clk_perclkx_set_rate, ++ .set_parent = _clk_perclkx_set_parent3, ++ .get_rate = _clk_perclkx_getrate, ++ .enable = _perclk_enable, ++ .disable = _perclk_disable, ++ }, ++ { ++ .id = 14, ++ .parent = &ahb_clk, /* can be AHB or UPLL or 24.61MHz */ ++ .round_rate = _clk_perclkx_round_rate, ++ .set_rate = _clk_perclkx_set_rate, ++ .set_parent = _clk_perclkx_set_parent3, ++ .get_rate = _clk_perclkx_getrate, ++ .enable = _perclk_enable, ++ .disable = _perclk_disable, ++ }, ++ { ++ .id = 15, ++ .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, ++ .get_rate = _clk_perclkx_getrate, ++ .enable = _perclk_enable, ++ .disable = _perclk_disable, ++ }, ++}; ++ ++struct clk nfc_clk = { ++ .id = 0, ++ .parent = &per_clk[8], ++}; ++ ++struct clk audmux_clk = { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_AUDMUX_OFFSET, ++ .disable = _clk_disable, ++}; ++ ++struct clk ata_clk[] = { ++ { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_ATA_OFFSET, ++ .disable = _clk_disable, ++ .secondary = &ata_clk[1], ++ }, ++ { ++ .id = 0, ++ .parent = &ahb_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR0, ++ .enable_shift = MXC_CCM_CGCR0_HCLK_ATA_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk can_clk[] = { ++ { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_CAN1_OFFSET, ++ .disable = _clk_disable, ++ }, ++ { ++ .id = 1, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_CAN2_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk csi_clk[] = { ++ { ++ .id = 0, ++ .parent = &per_clk[0], ++ .secondary = &csi_clk[1], ++ }, ++ { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_CSI_OFFSET, ++ .disable = _clk_disable, ++ .secondary = &csi_clk[2], ++ }, ++ { ++ .id = 0, ++ .parent = &ahb_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR0, ++ .enable_shift = MXC_CCM_CGCR0_HCLK_CSI_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk cspi_clk[] = { ++ { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_CSPI1_OFFSET, ++ .disable = _clk_disable, ++ }, ++ { ++ .id = 1, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_CSPI2_OFFSET, ++ .disable = _clk_disable, ++ }, ++ { ++ .id = 2, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_CSPI3_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk dryice_clk = { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_DRYICE_OFFSET, ++ .disable = _clk_disable, ++}; ++ ++struct clk ect_clk = { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_ECT_OFFSET, ++ .disable = _clk_disable, ++}; ++ ++struct clk epit1_clk[] = { ++ { ++ .id = 0, ++ .parent = &per_clk[1], ++ .secondary = &epit1_clk[1], ++ }, ++ { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_EPIT1_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk epit2_clk[] = { ++ { ++ .id = 1, ++ .parent = &per_clk[1], ++ .secondary = &epit2_clk[1], ++ }, ++ { ++ .id = 1, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_EPIT2_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk esai_clk[] = { ++ { ++ .id = 0, ++ .parent = &per_clk[2], ++ .secondary = &esai_clk[1], ++ }, ++ { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_ESAI_OFFSET, ++ .disable = _clk_disable, ++ .secondary = &esai_clk[2], ++ }, ++ { ++ .id = 0, ++ .parent = &ahb_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR0, ++ .enable_shift = MXC_CCM_CGCR0_HCLK_ESAI_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk esdhc1_clk[] = { ++ { ++ .id = 0, ++ .parent = &per_clk[3], ++ .secondary = &esdhc1_clk[1], ++ }, ++ { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_ESDHC1_OFFSET, ++ .disable = _clk_disable, ++ .secondary = &esdhc1_clk[2], ++ }, ++ { ++ .id = 0, ++ .parent = &ahb_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR0, ++ .enable_shift = MXC_CCM_CGCR0_HCLK_ESDHC1_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk esdhc2_clk[] = { ++ { ++ .id = 1, ++ .parent = &per_clk[4], ++ .secondary = &esdhc2_clk[1], ++ }, ++ { ++ .id = 1, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_ESDHC2_OFFSET, ++ .disable = _clk_disable, ++ .secondary = &esdhc2_clk[2], ++ }, ++ { ++ .id = 1, ++ .parent = &ahb_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR0, ++ .enable_shift = MXC_CCM_CGCR0_HCLK_ESDHC2_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk fec_clk[] = { ++ { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_FEC_OFFSET, ++ .disable = _clk_disable, ++ .secondary = &fec_clk[1], ++ }, ++ { ++ .id = 0, ++ .parent = &ahb_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR0, ++ .enable_shift = MXC_CCM_CGCR0_HCLK_FEC_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk gpio_clk[] = { ++ { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_GPIO1_OFFSET, ++ .disable = _clk_disable, ++ }, ++ { ++ .id = 1, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_GPIO2_OFFSET, ++ .disable = _clk_disable, ++ }, ++ { ++ .id = 2, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_GPIO3_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++static struct clk gpt1_clk[] = { ++ { ++ .id = 0, ++ .parent = &per_clk[5], ++ .secondary = &gpt1_clk[1], ++ }, ++ { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_GPT1_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++static struct clk gpt2_clk[] = { ++ { ++ .id = 1, ++ .parent = &per_clk[5], ++ .secondary = &gpt1_clk[1], ++ }, ++ { ++ .id = 1, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_GPT2_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++static struct clk gpt3_clk[] = { ++ { ++ .id = 2, ++ .parent = &per_clk[5], ++ .secondary = &gpt1_clk[1], ++ }, ++ { ++ .id = 2, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_GPT3_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++static struct clk gpt4_clk[] = { ++ { ++ .id = 3, ++ .parent = &per_clk[5], ++ .secondary = &gpt1_clk[1], ++ }, ++ { ++ .id = 3, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_GPT4_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk i2c_clk[] = { ++ { ++ .id = 0, ++ .parent = &per_clk[6], ++ }, ++ { ++ .id = 1, ++ .parent = &per_clk[6], ++ }, ++ { ++ .id = 2, ++ .parent = &per_clk[6], ++ }, ++}; ++ ++struct clk iim_clk = { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_IIM_OFFSET, ++ .disable = _clk_disable, ++}; ++ ++struct clk iomuxc_clk = { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_IOMUXC_OFFSET, ++ .disable = _clk_disable, ++}; ++ ++struct clk kpp_clk = { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_KPP_OFFSET, ++ .disable = _clk_disable, ++}; ++ ++struct clk lcdc_clk[] = { ++ { ++ .id = 0, ++ .parent = &per_clk[7], ++ .secondary = &lcdc_clk[1], ++ }, ++ { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_LCDC_OFFSET, ++ .disable = _clk_disable, ++ .secondary = &lcdc_clk[2], ++ }, ++ { ++ .id = 0, ++ .parent = &ahb_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR0, ++ .enable_shift = MXC_CCM_CGCR0_HCLK_LCDC_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk owire_clk[] = { ++ { ++ .id = 0, ++ .parent = &per_clk[9], ++ .secondary = &owire_clk[1], ++ }, ++ { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_OWIRE_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk pwm1_clk[] = { ++ { ++ .id = 0, ++ .parent = &per_clk[10], ++ .secondary = &pwm1_clk[1], ++ }, ++ { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR1, ++ .enable_shift = MXC_CCM_CGCR1_PWM1_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk pwm2_clk[] = { ++ { ++ .id = 1, ++ .parent = &per_clk[10], ++ .secondary = &pwm2_clk[1], ++ }, ++ { ++ .id = 1, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR2, ++ .enable_shift = MXC_CCM_CGCR2_PWM2_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk pwm3_clk[] = { ++ { ++ .id = 2, ++ .parent = &per_clk[10], ++ .secondary = &pwm3_clk[1], ++ }, ++ { ++ .id = 2, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR2, ++ .enable_shift = MXC_CCM_CGCR2_PWM3_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk pwm4_clk[] = { ++ { ++ .id = 3, ++ .parent = &per_clk[10], ++ .secondary = &pwm4_clk[1], ++ }, ++ { ++ .id = 3, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR2, ++ .enable_shift = MXC_CCM_CGCR2_PWM3_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk rngb_clk = { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR2, ++ .enable_shift = MXC_CCM_CGCR2_RNGB_OFFSET, ++ .disable = _clk_disable, ++}; ++ ++struct clk scc_clk = { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR2, ++ .enable_shift = MXC_CCM_CGCR2_SCC_OFFSET, ++ .disable = _clk_disable, ++}; ++ ++struct clk sdma_clk[] = { ++ { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR2, ++ .enable_shift = MXC_CCM_CGCR2_SDMA_OFFSET, ++ .disable = _clk_disable, ++ .secondary = &sdma_clk[1], ++ }, ++ { ++ .id = 0, ++ .parent = &ahb_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR0, ++ .enable_shift = MXC_CCM_CGCR0_HCLK_SDMA_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk sim1_clk[] = { ++ { ++ .id = 0, ++ .parent = &per_clk[11], ++ .secondary = &sim1_clk[1], ++ }, ++ { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR2, ++ .enable_shift = MXC_CCM_CGCR2_SIM1_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk sim2_clk[] = { ++ { ++ .id = 1, ++ .parent = &per_clk[12], ++ .secondary = &sim2_clk[1], ++ }, ++ { ++ .id = 1, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR2, ++ .enable_shift = MXC_CCM_CGCR2_SIM2_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk slcdc_clk[] = { ++ { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR2, ++ .enable_shift = MXC_CCM_CGCR2_SLCDC_OFFSET, ++ .disable = _clk_disable, ++ .secondary = &slcdc_clk[1], ++ }, ++ { ++ .id = 0, ++ .parent = &ahb_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR0, ++ .enable_shift = MXC_CCM_CGCR0_HCLK_SLCDC_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk spba_clk = { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR2, ++ .enable_shift = MXC_CCM_CGCR2_SPBA_OFFSET, ++ .disable = _clk_disable, ++}; ++ ++struct clk ssi1_clk[] = { ++ { ++ .id = 0, ++ .parent = &per_clk[13], ++ .secondary = &ssi1_clk[1], ++ }, ++ { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR2, ++ .enable_shift = MXC_CCM_CGCR2_SSI1_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk ssi2_clk[] = { ++ { ++ .id = 1, ++ .parent = &per_clk[14], ++ .secondary = &ssi2_clk[1], ++ }, ++ { ++ .id = 1, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR2, ++ .enable_shift = MXC_CCM_CGCR2_SSI2_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk tchscrn_clk = { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR2, ++ .enable_shift = MXC_CCM_CGCR2_TCHSCRN_OFFSET, ++ .disable = _clk_disable, ++}; ++ ++struct clk uart1_clk[] = { ++ { ++ .id = 0, ++ .parent = &per_clk[15], ++ .secondary = &uart1_clk[1], ++ }, ++ { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR2, ++ .enable_shift = MXC_CCM_CGCR2_UART1_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk uart2_clk[] = { ++ { ++ .id = 1, ++ .parent = &per_clk[15], ++ .secondary = &uart2_clk[1], ++ }, ++ { ++ .id = 1, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR2, ++ .enable_shift = MXC_CCM_CGCR2_UART2_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk uart3_clk[] = { ++ { ++ .id = 2, ++ .parent = &per_clk[15], ++ .secondary = &uart3_clk[1], ++ }, ++ { ++ .id = 2, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR2, ++ .enable_shift = MXC_CCM_CGCR2_UART3_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk uart4_clk[] = { ++ { ++ .id = 3, ++ .parent = &per_clk[15], ++ .secondary = &uart4_clk[1], ++ }, ++ { ++ .id = 3, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR2, ++ .enable_shift = MXC_CCM_CGCR2_UART4_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk uart5_clk[] = { ++ { ++ .id = 4, ++ .parent = &per_clk[15], ++ .secondary = &uart5_clk[1], ++ }, ++ { ++ .id = 4, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR2, ++ .enable_shift = MXC_CCM_CGCR2_UART5_OFFSET, ++ .disable = _clk_disable, ++ }, ++}; ++ ++struct clk wdog_clk = { ++ .id = 0, ++ .parent = &ipg_clk, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_CGCR2, ++ .enable_shift = MXC_CCM_CGCR2_WDOG_OFFSET, ++ .disable = _clk_disable, ++}; ++ ++static unsigned long _clk_usb_round_rate(struct clk *clk, unsigned long rate) ++{ ++ unsigned long div; ++ ++ div = clk_get_rate(clk->parent) / rate; ++ if (clk_get_rate(clk->parent) % rate) ++ div++; ++ ++ if (div > 64) ++ return -EINVAL; ++ ++ return clk_get_rate(clk->parent) / div; ++} ++ ++static int _clk_usb_set_rate(struct clk *clk, unsigned long rate) ++{ ++ unsigned long reg; ++ unsigned long div; ++ ++ div = clk_get_rate(clk->parent) / rate; ++ ++ if (clk_get_rate(clk->parent) / div != rate) ++ return -EINVAL; ++ if (div > 64) ++ return -EINVAL; ++ ++ reg = __raw_readl(MXC_CCM_CCTL) & ~MXC_CCM_CCTL_USB_DIV_MASK; ++ reg |= (div - 1) << MXC_CCM_CCTL_USB_DIV_OFFSET; ++ __raw_writel(reg, MXC_CCM_MCR); ++ ++ return 0; ++} ++ ++static unsigned long _clk_usb_getrate(struct clk *clk) ++{ ++ unsigned long 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); ++} ++ ++static int _clk_usb_set_parent(struct clk *clk, struct clk *parent) ++{ ++ unsigned long mcr; ++ ++ if (clk->parent == parent) ++ return 0; ++ if (parent != &upll_clk && parent != &ahb_clk) ++ return -EINVAL; ++ ++ clk->parent = parent; ++ mcr = __raw_readl(MXC_CCM_MCR); ++ if (parent == &ahb_clk) ++ mcr |= (1 << MXC_CCM_MCR_USB_CLK_MUX_OFFSET); ++ else ++ mcr &= ~(1 << MXC_CCM_MCR_USB_CLK_MUX_OFFSET); ++ ++ __raw_writel(mcr, MXC_CCM_MCR); ++ ++ return 0; ++} ++ ++static struct clk usb_clk = { ++ .parent = &upll_clk, ++ .get_rate = _clk_usb_getrate, ++ .set_rate = _clk_usb_set_rate, ++ .round_rate = _clk_usb_round_rate, ++ .set_parent = _clk_usb_set_parent, ++}; ++ ++/* CLKO */ ++ ++static unsigned long _clk_clko_round_rate(struct clk *clk, unsigned long rate) ++{ ++ unsigned long div; ++ ++ div = clk_get_rate(clk->parent) / rate; ++ if (clk_get_rate(clk->parent) % rate) ++ div++; ++ ++ if (div > 64) ++ return -EINVAL; ++ ++ return clk_get_rate(clk->parent) / div; ++} ++ ++static int _clk_clko_set_rate(struct clk *clk, unsigned long rate) ++{ ++ unsigned long reg; ++ unsigned long div; ++ ++ div = clk_get_rate(clk->parent) / rate; ++ ++ if ((clk_get_rate(clk->parent) / div) != rate) ++ return -EINVAL; ++ if (div > 64) ++ return -EINVAL; ++ ++ reg = __raw_readl(MXC_CCM_MCR) & ~MXC_CCM_MCR_CLKO_DIV_MASK; ++ reg |= (div - 1) << MXC_CCM_MCR_CLKO_DIV_OFFSET; ++ __raw_writel(reg, MXC_CCM_MCR); ++ ++ return 0; ++} ++ ++static unsigned long _clk_clko_getrate(struct clk *clk) ++{ ++ unsigned long div = __raw_readl(MXC_CCM_MCR); ++ ++ div &= MXC_CCM_MCR_CLKO_DIV_MASK; ++ div >>= MXC_CCM_MCR_CLKO_DIV_OFFSET; ++ ++ return clk_get_rate(clk->parent) / (div + 1); ++} ++ ++static struct clk *clko_sources[] = { ++ &osc32k_clk, /* 0x0 */ ++ &osc24m_clk, /* 0x1 */ ++ &cpu_clk, /* 0x2 */ ++ &ahb_clk, /* 0x3 */ ++ &ipg_clk, /* 0x4 */ ++ NULL, /* 0x5 */ ++ NULL, /* 0x6 */ ++ NULL, /* 0x7 */ ++ NULL, /* 0x8 */ ++ NULL, /* 0x9 */ ++ &per_clk[0], /* 0xA */ ++ &per_clk[2], /* 0xB */ ++ &per_clk[13], /* 0xC */ ++ &per_clk[14], /* 0xD */ ++ &usb_clk, /* 0xE */ ++ NULL, /* 0xF */ ++}; ++ ++#define NR_CLKO_SOURCES (sizeof(clko_sources) / sizeof(struct clk *)) ++ ++static int _clk_clko_set_parent(struct clk *clk, struct clk *parent) ++{ ++ unsigned long reg; ++ struct clk **src; ++ int i; ++ ++ if (clk->parent == parent) ++ return 0; ++ for (i = 0, src = clko_sources; i < NR_CLKO_SOURCES; i++, src++) ++ if (*src == parent) ++ break; ++ ++ if (i == NR_CLKO_SOURCES) ++ return -EINVAL; ++ ++ clk->parent = parent; ++ ++ reg = __raw_readl(MXC_CCM_MCR) & ~MXC_CCM_MCR_CLKO_SEL_MASK; ++ reg |= i << MXC_CCM_MCR_CLKO_SEL_OFFSET; ++ __raw_writel(reg, MXC_CCM_MCR); ++ ++ return 0; ++} ++ ++static struct clk clko_clk = { ++ .set_rate = _clk_clko_set_rate, ++ .round_rate = _clk_clko_round_rate, ++ .set_parent = _clk_clko_set_parent, ++ .get_rate = _clk_clko_getrate, ++ .enable = _clk_enable, ++ .enable_reg = MXC_CCM_MCR, ++ .enable_shift = MXC_CCM_MCR_CLKO_EN_OFFSET, ++ .disable = _clk_disable, ++}; ++ ++#define _REGISTER_CLOCK(d, n, c) \ ++ { \ ++ .dev_id = d, \ ++ .con_id = n, \ ++ .clk = &c, \ ++ }, ++ ++static struct clk_lookup lookups[] = { ++ _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(NULL, "csi", csi_clk[0]) ++ _REGISTER_CLOCK(NULL, "cspi.0", cspi_clk[0]) ++ _REGISTER_CLOCK(NULL, "cspi.1", cspi_clk[1]) ++ _REGISTER_CLOCK(NULL, "cspi.2", cspi_clk[2]) ++ _REGISTER_CLOCK(NULL, "dryice", dryice_clk) ++ _REGISTER_CLOCK(NULL, "ect", ect_clk) ++ _REGISTER_CLOCK(NULL, "epit1", epit1_clk[0]) ++ _REGISTER_CLOCK(NULL, "epit2", epit2_clk[0]) ++ _REGISTER_CLOCK(NULL, "esai", esai_clk[0]) ++ _REGISTER_CLOCK("mxc-mmc.0", NULL, esdhc1_clk[0]) ++ _REGISTER_CLOCK("mxc-mmc.1", NULL, esdhc2_clk[0]) ++ _REGISTER_CLOCK("fec.0", NULL, fec_clk[0]) ++ _REGISTER_CLOCK(NULL, "gpio0", gpio_clk[0]) ++ _REGISTER_CLOCK(NULL, "gpio1", gpio_clk[1]) ++ _REGISTER_CLOCK(NULL, "gpio2", gpio_clk[2]) ++ _REGISTER_CLOCK(NULL, "gpt1", gpt1_clk[0]) ++ _REGISTER_CLOCK(NULL, "gpt2", gpt2_clk[0]) ++ _REGISTER_CLOCK(NULL, "gpt3", gpt3_clk[0]) ++ _REGISTER_CLOCK(NULL, "gpt4", gpt4_clk[0]) ++ _REGISTER_CLOCK("imx-i2c.0", NULL, i2c_clk[0]) ++ _REGISTER_CLOCK("imx-i2c.1", NULL, i2c_clk[1]) ++ _REGISTER_CLOCK("imx-i2c.2", NULL, i2c_clk[2]) ++ _REGISTER_CLOCK(NULL, "iim", iim_clk) ++ _REGISTER_CLOCK(NULL, "iomuxc", iomuxc_clk) ++ _REGISTER_CLOCK(NULL, "kpp", kpp_clk) ++ _REGISTER_CLOCK("imx-fb.0", NULL, lcdc_clk[0]) ++ _REGISTER_CLOCK(NULL, "owire", owire_clk[0]) ++ _REGISTER_CLOCK("mxc_pwm.0", NULL, pwm1_clk[0]) ++ _REGISTER_CLOCK("mxc_pwm.1", NULL, pwm2_clk[0]) ++ _REGISTER_CLOCK("mxc_pwm.2", NULL, pwm3_clk[0]) ++ _REGISTER_CLOCK("mxc_pwm.3", NULL, pwm4_clk[0]) ++ _REGISTER_CLOCK(NULL, "rngb", rngb_clk) ++ _REGISTER_CLOCK(NULL, "scc", scc_clk) ++ _REGISTER_CLOCK(NULL, "sdma", sdma_clk[0]) ++ _REGISTER_CLOCK(NULL, "sim1", sim1_clk[0]) ++ _REGISTER_CLOCK(NULL, "sim2", sim2_clk[0]) ++ _REGISTER_CLOCK(NULL, "slcdc", slcdc_clk[0]) ++ _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("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("imx-wdt.0", NULL, wdog_clk) ++ _REGISTER_CLOCK(NULL, "usb", usb_clk) ++ _REGISTER_CLOCK(NULL, "clko", clko_clk) ++ _REGISTER_CLOCK(NULL, "brom", brom_clk) ++}; ++ ++int __init mx25_clocks_init(unsigned long fref) ++{ ++ int i; ++ ++ 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 : ""); ++ clkdev_add(&lookups[i]); ++ } ++ ++ ckih_rate = fref; ++#ifndef CONFIG_DEBUG_LL ++ /* Turn off all possible clocks */ ++ __raw_writel((1 << MXC_CCM_CGCR0_HCLK_EMI_OFFSET), MXC_CCM_CGCR0); ++ ++ __raw_writel((1 << MXC_CCM_CGCR1_GPT1_OFFSET) | ++ (1 << MXC_CCM_CGCR1_IIM_OFFSET), MXC_CCM_CGCR1); ++ __raw_writel(1 << MXC_CCM_CGCR2_SCC_OFFSET, MXC_CCM_CGCR2); ++#endif ++#if 1 ++ /* Set all perclk sources to upll */ ++ for (i = 0; i < ARRAY_SIZE(per_clk); i++) { ++ int ret; ++ unsigned long rate = per_clk[i].get_rate(&per_clk[i]); ++ ++#ifdef CONFIG_DEBUG_LL ++ if (i == 15) { ++ printk(KERN_DEBUG "skipping per_clk[%d] rate=%lu\n", i, rate); ++ continue; ++ } ++#endif ++ { ++ unsigned long new_rate; ++ ++ 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); ++ clk_set_rate(&per_clk[8], clk_get_rate(&ahb_clk) / 6); ++ ++ /* This will propagate to all children and init all the clock rates */ ++#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)); ++ ++ pr_info("CPU: %lu.%03luMHz\n", ++ clk_get_rate(&cpu_clk) / 1000000, clk_get_rate(&cpu_clk) / 1000 % 1000); ++ pr_info("AHB: %lu.%03luMHz\n", ++ clk_get_rate(&ahb_clk) / 1000000, clk_get_rate(&ahb_clk) / 1000 % 1000); ++ pr_info("MPLL: %lu.%03luMHz\n", ++ clk_get_rate(&mpll_clk) / 1000000, clk_get_rate(&mpll_clk) / 1000 % 1000); ++ pr_info("UPLL: %lu.%03luMHz\n", ++ clk_get_rate(&upll_clk) / 1000000, clk_get_rate(&upll_clk) / 1000 % 1000); ++ 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]); ++ 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:59:15.000000000 +0200 +@@ -621,7 +621,7 @@ DEFINE_CLOCK1(csi_clk, 0, 0, 0, + .clk = &c, \ + }, + +-static struct clk_lookup lookups[] __initdata = { ++static struct clk_lookup lookups[] = { + _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:59:17.000000000 +0200 +@@ -0,0 +1,65 @@ ++/* ++ * arch/arm/mach-mx2/cpu_mx25.c ++ * ++ * Copyright 2009 Lothar Wassmann ++ * derived from: cpu_mx27.c ++ * Copyright 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., 51 Franklin Street, Fifth Floor, Boston, ++ * MA 02110-1301, USA. ++ */ ++ ++/* ++ * i.MX25 specific CPU detection code ++ */ ++ ++#include ++#include ++ ++#include ++ ++static int cpu_silicon_rev = -1; ++static int cpu_partnumber; ++ ++#define IIM_PREV_REG IO_ADDRESS(IIM_BASE_ADDR + 0x20) ++#define IIM_SREV_REG IO_ADDRESS(IIM_BASE_ADDR + 0x24) ++ ++static void query_silicon_parameter(void) ++{ ++ cpu_partnumber = __raw_readl(IIM_PREV_REG) >> 3; ++ cpu_silicon_rev = __raw_readl(IIM_SREV_REG); ++ ++ printk(KERN_DEBUG "CPU rev: 0x%02x chip_rev: 0x%02x\n", ++ cpu_partnumber, cpu_silicon_rev); ++ if (WARN_ON(cpu_partnumber != 0x1f)) { ++ printk(KERN_WARNING "Unsupported CPU rev: 0x%02x\n", cpu_partnumber); ++ } ++} ++ ++/* ++ * Returns: ++ * the silicon revision of the cpu ++ * -EINVAL - not a mx25 ++ */ ++int mx25_revision(void) ++{ ++ if (cpu_silicon_rev == -1) ++ query_silicon_parameter(); ++ ++ if (cpu_partnumber != 0x1f) ++ return -EINVAL; ++ ++ 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:59:17.000000000 +0200 +@@ -0,0 +1,190 @@ ++/* ++ * Copyright 2008 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 __ARCH_ARM_MACH_MX25_CRM_REGS_H__ ++#define __ARCH_ARM_MACH_MX25_CRM_REGS_H__ ++ ++#include ++ ++/* Register offsets */ ++#define MXC_CCM_MPCTL (IO_ADDRESS(CCM_BASE_ADDR) + 0x00) ++#define MXC_CCM_UPCTL (IO_ADDRESS(CCM_BASE_ADDR) + 0x04) ++#define MXC_CCM_CCTL (IO_ADDRESS(CCM_BASE_ADDR) + 0x08) ++#define MXC_CCM_CGCR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x0C) ++#define MXC_CCM_CGCR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x10) ++#define MXC_CCM_CGCR2 (IO_ADDRESS(CCM_BASE_ADDR) + 0x14) ++#define MXC_CCM_PCDR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x18) ++#define MXC_CCM_PCDR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x1C) ++#define MXC_CCM_PCDR2 (IO_ADDRESS(CCM_BASE_ADDR) + 0x20) ++#define MXC_CCM_PCDR3 (IO_ADDRESS(CCM_BASE_ADDR) + 0x24) ++#define MXC_CCM_RCSR (IO_ADDRESS(CCM_BASE_ADDR) + 0x28) ++#define MXC_CCM_CRDR (IO_ADDRESS(CCM_BASE_ADDR) + 0x2C) ++#define MXC_CCM_DCVR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x30) ++#define MXC_CCM_DCVR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x34) ++#define MXC_CCM_DCVR2 (IO_ADDRESS(CCM_BASE_ADDR) + 0x38) ++#define MXC_CCM_DCVR3 (IO_ADDRESS(CCM_BASE_ADDR) + 0x3C) ++#define MXC_CCM_LTR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x40) ++#define MXC_CCM_LTR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x44) ++#define MXC_CCM_LTR2 (IO_ADDRESS(CCM_BASE_ADDR) + 0x48) ++#define MXC_CCM_LTR3 (IO_ADDRESS(CCM_BASE_ADDR) + 0x4C) ++#define MXC_CCM_LTBR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x50) ++#define MXC_CCM_LTBR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x54) ++#define MXC_CCM_PMCR0 (IO_ADDRESS(CCM_BASE_ADDR) + 0x58) ++#define MXC_CCM_PMCR1 (IO_ADDRESS(CCM_BASE_ADDR) + 0x5C) ++#define MXC_CCM_PMCR2 (IO_ADDRESS(CCM_BASE_ADDR) + 0x60) ++#define MXC_CCM_MCR (IO_ADDRESS(CCM_BASE_ADDR) + 0x64) ++ ++#define MXC_CCM_MPCTL_BRMO (1 << 31) ++#define MXC_CCM_MPCTL_PD_OFFSET 26 ++#define MXC_CCM_MPCTL_PD_MASK (0xf << 26) ++#define MXC_CCM_MPCTL_MFD_OFFSET 16 ++#define MXC_CCM_MPCTL_MFD_MASK (0x3ff << 16) ++#define MXC_CCM_MPCTL_MFI_OFFSET 10 ++#define MXC_CCM_MPCTL_MFI_MASK (0xf << 10) ++#define MXC_CCM_MPCTL_MFN_OFFSET 0 ++#define MXC_CCM_MPCTL_MFN_MASK 0x3ff ++#define MXC_CCM_MPCTL_LF (1 << 15) ++ ++#define MXC_CCM_UPCTL_BRMO (1 << 31) ++#define MXC_CCM_UPCTL_PD_OFFSET 26 ++#define MXC_CCM_UPCTL_PD_MASK (0xf << 26) ++#define MXC_CCM_UPCTL_MFD_OFFSET 16 ++#define MXC_CCM_UPCTL_MFD_MASK (0x3ff << 16) ++#define MXC_CCM_UPCTL_MFI_OFFSET 10 ++#define MXC_CCM_UPCTL_MFI_MASK (0xf << 10) ++#define MXC_CCM_UPCTL_MFN_OFFSET 0 ++#define MXC_CCM_UPCTL_MFN_MASK 0x3ff ++#define MXC_CCM_UPCTL_LF (1 << 15) ++ ++#define MXC_CCM_CCTL_ARM_OFFSET 30 ++#define MXC_CCM_CCTL_ARM_MASK (0x3 << 30) ++#define MXC_CCM_CCTL_AHB_OFFSET 28 ++#define MXC_CCM_CCTL_AHB_MASK (0x3 << 28) ++#define MXC_CCM_CCTL_MPLL_RST (1 << 27) ++#define MXC_CCM_CCTL_UPLL_RST (1 << 26) ++#define MXC_CCM_CCTL_LP_CTL_OFFSET 24 ++#define MXC_CCM_CCTL_LP_CTL_MASK (0x3 << 24) ++#define MXC_CCM_CCTL_LP_MODE_RUN (0x0 << 24) ++#define MXC_CCM_CCTL_LP_MODE_WAIT (0x1 << 24) ++#define MXC_CCM_CCTL_LP_MODE_DOZE (0x2 << 24) ++#define MXC_CCM_CCTL_LP_MODE_STOP (0x3 << 24) ++#define MXC_CCM_CCTL_UPLL_DISABLE (1 << 23) ++#define MXC_CCM_CCTL_MPLL_BYPASS (1 << 22) ++#define MXC_CCM_CCTL_USB_DIV_OFFSET 16 ++#define MXC_CCM_CCTL_USB_DIV_MASK (0x3 << 16) ++#define MXC_CCM_CCTL_CG_CTRL (1 << 15) ++#define MXC_CCM_CCTL_ARM_SRC (1 << 14) ++ ++#define MXC_CCM_CGCR0_HCLK_ATA_OFFSET 16 ++#define MXC_CCM_CGCR0_HCLK_BROM_OFFSET 17 ++#define MXC_CCM_CGCR0_HCLK_CSI_OFFSET 18 ++#define MXC_CCM_CGCR0_HCLK_EMI_OFFSET 19 ++#define MXC_CCM_CGCR0_HCLK_ESAI_OFFSET 20 ++#define MXC_CCM_CGCR0_HCLK_ESDHC1_OFFSET 21 ++#define MXC_CCM_CGCR0_HCLK_ESDHC2_OFFSET 22 ++#define MXC_CCM_CGCR0_HCLK_FEC_OFFSET 23 ++#define MXC_CCM_CGCR0_HCLK_LCDC_OFFSET 24 ++#define MXC_CCM_CGCR0_HCLK_RTIC_OFFSET 25 ++#define MXC_CCM_CGCR0_HCLK_SDMA_OFFSET 26 ++#define MXC_CCM_CGCR0_HCLK_SLCDC_OFFSET 27 ++#define MXC_CCM_CGCR0_HCLK_USBOTG_OFFSET 28 ++ ++#define MXC_CCM_CGCR0_PER_CSI_OFFSET 0 ++#define MXC_CCM_CGCR0_PER_EPIT_OFFSET 1 ++#define MXC_CCM_CGCR0_PER_ESAI_OFFSET 2 ++#define MXC_CCM_CGCR0_PER_ESDHC1_OFFSET 3 ++#define MXC_CCM_CGCR0_PER_ESDHC2_OFFSET 4 ++#define MXC_CCM_CGCR0_PER_GPT_OFFSET 5 ++#define MXC_CCM_CGCR0_PER_I2C_OFFSET 6 ++#define MXC_CCM_CGCR0_PER_LCDC_OFFSET 7 ++#define MXC_CCM_CGCR0_PER_NFC_OFFSET 8 ++#define MXC_CCM_CGCR0_PER_OWIRE_OFFSET 9 ++#define MXC_CCM_CGCR0_PER_PWM_OFFSET 10 ++#define MXC_CCM_CGCR0_PER_SIM1_OFFSET 11 ++#define MXC_CCM_CGCR0_PER_SIM2_OFFSET 12 ++#define MXC_CCM_CGCR0_PER_SSI1_OFFSET 13 ++#define MXC_CCM_CGCR0_PER_SSI2_OFFSET 14 ++#define MXC_CCM_CGCR0_PER_UART_OFFSET 15 ++ ++#define MXC_CCM_CGCR1_AUDMUX_OFFSET 0 ++#define MXC_CCM_CGCR1_ATA_OFFSET 1 ++#define MXC_CCM_CGCR1_CAN1_OFFSET 2 ++#define MXC_CCM_CGCR1_CAN2_OFFSET 3 ++#define MXC_CCM_CGCR1_CSI_OFFSET 4 ++#define MXC_CCM_CGCR1_CSPI1_OFFSET 5 ++#define MXC_CCM_CGCR1_CSPI2_OFFSET 6 ++#define MXC_CCM_CGCR1_CSPI3_OFFSET 7 ++#define MXC_CCM_CGCR1_DRYICE_OFFSET 8 ++#define MXC_CCM_CGCR1_ECT_OFFSET 9 ++#define MXC_CCM_CGCR1_EPIT1_OFFSET 10 ++#define MXC_CCM_CGCR1_EPIT2_OFFSET 11 ++#define MXC_CCM_CGCR1_ESAI_OFFSET 12 ++#define MXC_CCM_CGCR1_ESDHC1_OFFSET 13 ++#define MXC_CCM_CGCR1_ESDHC2_OFFSET 14 ++#define MXC_CCM_CGCR1_FEC_OFFSET 15 ++#define MXC_CCM_CGCR1_GPIO1_OFFSET 16 ++#define MXC_CCM_CGCR1_GPIO2_OFFSET 17 ++#define MXC_CCM_CGCR1_GPIO3_OFFSET 18 ++#define MXC_CCM_CGCR1_GPT1_OFFSET 19 ++#define MXC_CCM_CGCR1_GPT2_OFFSET 20 ++#define MXC_CCM_CGCR1_GPT3_OFFSET 21 ++#define MXC_CCM_CGCR1_GPT4_OFFSET 22 ++#define MXC_CCM_CGCR1_I2C1_OFFSET 23 ++#define MXC_CCM_CGCR1_I2C2_OFFSET 24 ++#define MXC_CCM_CGCR1_I2C3_OFFSET 25 ++#define MXC_CCM_CGCR1_IIM_OFFSET 26 ++#define MXC_CCM_CGCR1_IOMUXC_OFFSET 27 ++#define MXC_CCM_CGCR1_KPP_OFFSET 28 ++#define MXC_CCM_CGCR1_LCDC_OFFSET 29 ++#define MXC_CCM_CGCR1_OWIRE_OFFSET 30 ++#define MXC_CCM_CGCR1_PWM1_OFFSET 31 ++ ++#define MXC_CCM_CGCR2_PWM2_OFFSET (32-32) ++#define MXC_CCM_CGCR2_PWM3_OFFSET (33-32) ++#define MXC_CCM_CGCR2_PWM4_OFFSET (34-32) ++#define MXC_CCM_CGCR2_RNGB_OFFSET (35-32) ++#define MXC_CCM_CGCR2_RTIC_OFFSET (36-32) ++#define MXC_CCM_CGCR2_SCC_OFFSET (37-32) ++#define MXC_CCM_CGCR2_SDMA_OFFSET (38-32) ++#define MXC_CCM_CGCR2_SIM1_OFFSET (39-32) ++#define MXC_CCM_CGCR2_SIM2_OFFSET (40-32) ++#define MXC_CCM_CGCR2_SLCDC_OFFSET (41-32) ++#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_UART1_OFFSET (46-32) ++#define MXC_CCM_CGCR2_UART2_OFFSET (47-32) ++#define MXC_CCM_CGCR2_UART3_OFFSET (48-32) ++#define MXC_CCM_CGCR2_UART4_OFFSET (49-32) ++#define MXC_CCM_CGCR2_UART5_OFFSET (50-32) ++#define MXC_CCM_CGCR2_WDOG_OFFSET (51-32) ++ ++#define MXC_CCM_PCDR1_PERDIV1_MASK 0x3f ++ ++#define MXC_CCM_RCSR_NF16B (1 << 14) ++ ++#define MXC_CCM_MCR_USB_XTAL_MUX_OFFSET 31 ++#define MXC_CCM_MCR_CLKO_EN_OFFSET 30 ++#define MXC_CCM_MCR_CLKO_DIV_OFFSET 24 ++#define MXC_CCM_MCR_CLKO_DIV_MASK (0x3F << 24) ++#define MXC_CCM_MCR_CLKO_SEL_OFFSET 20 ++#define MXC_CCM_MCR_CLKO_SEL_MASK (0xF << 20) ++#define MXC_CCM_MCR_ESAI_CLK_MUX_OFFSET 19 ++#define MXC_CCM_MCR_SSI2_CLK_MUX_OFFSET 18 ++#define MXC_CCM_MCR_SSI1_CLK_MUX_OFFSET 17 ++#define MXC_CCM_MCR_USB_CLK_MUX_OFFSET 16 ++ ++#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:59:16.000000000 +0200 +@@ -20,3 +20,9 @@ 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; ++#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:59:17.000000000 +0200 +@@ -0,0 +1,402 @@ ++/* ++ * Copyright 2008 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 ++ */ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++ ++#include "sdma_script_code.h" ++ ++#include "karo.h" ++ ++void mx25_sdma_get_script_info(sdma_script_start_addrs * sdma_script_addr) ++{ ++ sdma_script_addr->mxc_sdma_ap_2_ap_addr = ap_2_ap_ADDR; ++ sdma_script_addr->mxc_sdma_ap_2_bp_addr = -1; ++ sdma_script_addr->mxc_sdma_bp_2_ap_addr = -1; ++ sdma_script_addr->mxc_sdma_loopback_on_dsp_side_addr = -1; ++ sdma_script_addr->mxc_sdma_mcu_interrupt_only_addr = -1; ++ ++ sdma_script_addr->mxc_sdma_firi_2_per_addr = -1; ++ sdma_script_addr->mxc_sdma_firi_2_mcu_addr = -1; ++ sdma_script_addr->mxc_sdma_per_2_firi_addr = -1; ++ sdma_script_addr->mxc_sdma_mcu_2_firi_addr = -1; ++ ++ sdma_script_addr->mxc_sdma_uart_2_per_addr = uart_2_per_ADDR; ++ sdma_script_addr->mxc_sdma_uart_2_mcu_addr = uart_2_mcu_ADDR; ++ sdma_script_addr->mxc_sdma_per_2_app_addr = per_2_app_ADDR; ++ sdma_script_addr->mxc_sdma_mcu_2_app_addr = mcu_2_app_ADDR; ++ ++ sdma_script_addr->mxc_sdma_per_2_per_addr = -1; ++ ++ sdma_script_addr->mxc_sdma_uartsh_2_per_addr = uartsh_2_per_ADDR; ++ sdma_script_addr->mxc_sdma_uartsh_2_mcu_addr = uartsh_2_mcu_ADDR; ++ sdma_script_addr->mxc_sdma_per_2_shp_addr = per_2_shp_ADDR; ++ sdma_script_addr->mxc_sdma_mcu_2_shp_addr = mcu_2_shp_ADDR; ++ ++ sdma_script_addr->mxc_sdma_ata_2_mcu_addr = ata_2_mcu_ADDR; ++ sdma_script_addr->mxc_sdma_mcu_2_ata_addr = mcu_2_ata_ADDR; ++ ++ sdma_script_addr->mxc_sdma_app_2_per_addr = app_2_per_ADDR; ++ sdma_script_addr->mxc_sdma_app_2_mcu_addr = app_2_mcu_ADDR; ++ sdma_script_addr->mxc_sdma_shp_2_per_addr = shp_2_per_ADDR; ++ sdma_script_addr->mxc_sdma_shp_2_mcu_addr = shp_2_mcu_ADDR; ++ ++ sdma_script_addr->mxc_sdma_mshc_2_mcu_addr = -1; ++ sdma_script_addr->mxc_sdma_mcu_2_mshc_addr = -1; ++ ++ sdma_script_addr->mxc_sdma_spdif_2_mcu_addr = -1; ++ sdma_script_addr->mxc_sdma_mcu_2_spdif_addr = -1; ++ ++ sdma_script_addr->mxc_sdma_asrc_2_mcu_addr = -1; ++ ++ sdma_script_addr->mxc_sdma_dptc_dvfs_addr = -1; ++ sdma_script_addr->mxc_sdma_ext_mem_2_ipu_addr = ext_mem__ipu_ram_ADDR; ++ sdma_script_addr->mxc_sdma_descrambler_addr = -1; ++ ++ sdma_script_addr->mxc_sdma_start_addr = (unsigned short *)sdma_code; ++ sdma_script_addr->mxc_sdma_ram_code_size = RAM_CODE_SIZE; ++ sdma_script_addr->mxc_sdma_ram_code_start_addr = RAM_CODE_START_ADDR; ++} ++ ++#if defined(CONFIG_MXC_WATCHDOG) || defined(CONFIG_MXC_WATCHDOG_MODULE) ++static struct resource wdt_resources[] = { ++ { ++ .start = WDOG_BASE_ADDR, ++ .end = WDOG_BASE_ADDR + 0x2f, ++ .flags = IORESOURCE_MEM, ++ }, ++}; ++ ++static struct platform_device mx25_wdt_device = { ++ .name = "mxc_wdt", ++ .id = 0, ++ .num_resources = ARRAY_SIZE(wdt_resources), ++ .resource = wdt_resources, ++}; ++ ++static void mx25_init_wdt(void) ++{ ++ (void)platform_device_register(&mx25_wdt_device); ++} ++#else ++static inline void mx25_init_wdt(void) ++{ ++} ++#endif ++ ++/* ++ * lcdc: ++ * - i.MX1: the basic controller ++ * - i.MX21: to be checked ++ * - i.MX27: like i.MX1, with slightly variations ++ */ ++static struct resource mxc_fb[] = { ++ { ++ .start = LCDC_BASE_ADDR, ++ .end = LCDC_BASE_ADDR + 0xFFF, ++ .flags = IORESOURCE_MEM, ++ }, ++ { ++ .start = MXC_INT_LCDC, ++ .end = MXC_INT_LCDC, ++ .flags = IORESOURCE_IRQ, ++ } ++}; ++ ++/* mxc lcd driver */ ++struct platform_device mxc_fb_device = { ++ .name = "imx-fb", ++ .id = 0, ++ .num_resources = ARRAY_SIZE(mxc_fb), ++ .resource = mxc_fb, ++ .dev = { ++ .coherent_dma_mask = 0xFFFFFFFF, ++ }, ++}; ++ ++/* SPI controller and device data */ ++#if defined(CONFIG_SPI_MXC) || defined(CONFIG_SPI_MXC_MODULE) ++ ++#ifdef CONFIG_SPI_MXC_SELECT1 ++/*! ++ * 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, ++ }, ++}; ++ ++/*! Platform Data for MXC CSPI1 */ ++static struct mxc_spi_master mx25_spi1_data = { ++ .maxchipselect = 4, ++ .spi_version = 7, ++}; ++ ++/*! Device Definition for MXC CSPI1 */ ++static struct platform_device mx25_spi1_device = { ++ .name = "mxc_spi", ++ .id = 0, ++ .dev = { ++ .platform_data = &mx25_spi1_data, ++ }, ++ .num_resources = ARRAY_SIZE(mx25_spi1_resources), ++ .resource = mx25_spi1_resources, ++}; ++ ++#endif /* CONFIG_SPI_MXC_SELECT1 */ ++ ++#ifdef CONFIG_SPI_MXC_SELECT2 ++/*! ++ * 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, ++ }, ++}; ++ ++/*! Platform Data for MXC CSPI2 */ ++static struct mxc_spi_master mx25_spi2_data = { ++ .maxchipselect = 4, ++ .spi_version = 7, ++}; ++ ++/*! Device Definition for MXC CSPI2 */ ++static struct platform_device mx25_spi2_device = { ++ .name = "mxc_spi", ++ .id = 1, ++ .dev = { ++ .platform_data = &mx25_spi2_data, ++ }, ++ .num_resources = ARRAY_SIZE(mx25_spi2_resources), ++ .resource = mx25_spi2_resources, ++}; ++#endif /* CONFIG_SPI_MXC_SELECT2 */ ++ ++#ifdef CONFIG_SPI_MXC_SELECT3 ++/*! ++ * 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, ++ }, ++}; ++ ++/*! Platform Data for MXC CSPI3 */ ++static struct mxc_spi_master mx25_spi3_data = { ++ .maxchipselect = 4, ++ .spi_version = 7, ++}; ++ ++/*! Device Definition for MXC CSPI3 */ ++static struct platform_device mx25_spi3_device = { ++ .name = "mxc_spi", ++ .id = 2, ++ .dev = { ++ .platform_data = &mx25_spi3_data, ++ }, ++ .num_resources = ARRAY_SIZE(mx25_spi3_resources), ++ .resource = mx25_spi3_resources, ++}; ++#endif /* CONFIG_SPI_MXC_SELECT3 */ ++ ++static inline void mx25_init_spi(void) ++{ ++ spba_take_ownership(SPBA_CSPI2, SPBA_MASTER_A); ++ spba_take_ownership(SPBA_CSPI3, SPBA_MASTER_A); ++ ++#ifdef CONFIG_SPI_MXC_SELECT1 ++ if (platform_device_register(&mx25_spi1_device) < 0) ++ printk(KERN_ERR "Error: Registering the SPI Controller_1\n"); ++#endif /* CONFIG_SPI_MXC_SELECT1 */ ++#ifdef CONFIG_SPI_MXC_SELECT2 ++ if (platform_device_register(&mx25_spi2_device) < 0) ++ printk(KERN_ERR "Error: Registering the SPI Controller_2\n"); ++#endif /* CONFIG_SPI_MXC_SELECT2 */ ++#ifdef CONFIG_SPI_MXC_SELECT3 ++ if (platform_device_register(&mx25_spi3_device) < 0) ++ printk(KERN_ERR "Error: Registering the SPI Controller_3\n"); ++#endif /* CONFIG_SPI_MXC_SELECT3 */ ++} ++#else ++static inline void mx25_init_spi(void) ++{ ++} ++#endif ++ ++/* I2C controller and device data */ ++#if defined(CONFIG_I2C_IMX) || defined(CONFIG_I2C_IMX_MODULE) ++ ++/*! ++ * 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, ++ }, ++}; ++ ++/*! ++ * 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, ++ }, ++}; ++ ++/*! ++ * 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, ++ }, ++}; ++ ++/*! Device Definition for MXC I2C1 */ ++struct platform_device mx25_i2c_device0 = { ++ .name = "imx-i2c", ++ .id = 0, ++ .num_resources = ARRAY_SIZE(mx25_i2c1_resources), ++ .resource = mx25_i2c1_resources, ++}; ++ ++struct platform_device mx25_i2c_device1 = { ++ .name = "imx-i2c", ++ .id = 1, ++ .num_resources = ARRAY_SIZE(mx25_i2c2_resources), ++ .resource = mx25_i2c2_resources, ++}; ++ ++struct platform_device mx25_i2c_device2 = { ++ .name = "imx-i2c", ++ .id = 2, ++ .num_resources = ARRAY_SIZE(mx25_i2c3_resources), ++ .resource = mx25_i2c3_resources, ++}; ++#endif ++ ++static struct mxc_gpio_port mx25_gpio_ports[] = { ++ { ++ .chip.label = "gpio-1", ++ .base = IO_ADDRESS(GPIO1_BASE_ADDR), ++ .irq = MXC_INT_GPIO1, ++ .virtual_irq_start = MXC_GPIO_IRQ_START, ++ }, ++ { ++ .chip.label = "gpio-2", ++ .base = IO_ADDRESS(GPIO2_BASE_ADDR), ++ .irq = MXC_INT_GPIO2, ++ .virtual_irq_start = MXC_GPIO_IRQ_START + 1 * 32, ++ }, ++ { ++ .chip.label = "gpio-3", ++ .base = IO_ADDRESS(GPIO3_BASE_ADDR), ++ .irq = MXC_INT_GPIO3, ++ .virtual_irq_start = MXC_GPIO_IRQ_START + 2 * 32, ++ }, ++ { ++ .chip.label = "gpio-4", ++ .base = IO_ADDRESS(GPIO4_BASE_ADDR), ++ .irq = MXC_INT_GPIO4, ++ .virtual_irq_start = MXC_GPIO_IRQ_START + 3 * 32, ++ }, ++}; ++ ++static inline void mx25_init_ssi(void) ++{ ++ /* SPBA configuration for SSI - SDMA and MCU are set */ ++ spba_take_ownership(SPBA_SSI1, SPBA_MASTER_A | SPBA_MASTER_C); ++ spba_take_ownership(SPBA_SSI2, SPBA_MASTER_A | SPBA_MASTER_C); ++} ++ ++static struct platform_device mx25_dma_device = { ++ .name = "mxc_dma", ++ .id = 0, ++}; ++ ++static inline void mx25_init_dma(void) ++{ ++ (void)platform_device_register(&mx25_dma_device); ++} ++ ++static int __init mx25_init_devices(void) ++{ ++ mx25_init_wdt(); ++ mx25_init_spi(); ++ mx25_init_dma(); ++ mx25_init_ssi(); ++ ++ return 0; ++} ++arch_initcall(mx25_init_devices); ++ ++int __init mxc_register_gpios(void) ++{ ++ 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:59:16.000000000 +0200 +@@ -26,6 +26,7 @@ + #include + + /* MX27 memory map definition */ ++#if defined(CONFIG_MACH_MX27) || defined(CONFIG_MACH_MX21) + static struct map_desc mxc_io_desc[] __initdata = { + /* + * this fixed mapping covers: +@@ -61,7 +62,7 @@ static struct map_desc mxc_io_desc[] __i + .pfn = __phys_to_pfn(X_MEMC_BASE_ADDR), + .length = X_MEMC_SIZE, + .type = MT_DEVICE +- } ++ }, + }; + + /* +@@ -82,4 +83,46 @@ void __init mx27_map_io(void) + + iotable_init(mxc_io_desc, ARRAY_SIZE(mxc_io_desc)); + } ++#endif ++ ++#ifdef CONFIG_MACH_MX25 ++static struct map_desc mx25_io_desc[] __initdata = { ++ { ++ .virtual = (unsigned long)X_MEMC_BASE_ADDR_VIRT, ++ .pfn = __phys_to_pfn(X_MEMC_BASE_ADDR), ++ .length = X_MEMC_SIZE, ++ .type = MT_DEVICE ++ }, ++ { ++ .virtual = (unsigned long)ASIC_BASE_ADDR_VIRT, ++ .pfn = __phys_to_pfn(ASIC_BASE_ADDR), ++ .length = ASIC_SIZE, ++ .type = MT_DEVICE_NONSHARED ++ }, ++ { ++ .virtual = (unsigned long)AIPS1_BASE_ADDR_VIRT, ++ .pfn = __phys_to_pfn(AIPS1_BASE_ADDR), ++ .length = AIPS1_SIZE, ++ .type = MT_DEVICE_NONSHARED ++ }, ++ { ++ .virtual = (unsigned long)AIPS2_BASE_ADDR_VIRT, ++ .pfn = __phys_to_pfn(AIPS2_BASE_ADDR), ++ .length = AIPS2_SIZE, ++ .type = MT_DEVICE_NONSHARED ++ }, ++ { ++ .virtual = (unsigned long)SPBA0_BASE_ADDR_VIRT, ++ .pfn = __phys_to_pfn(SPBA0_BASE_ADDR), ++ .length = SPBA0_SIZE, ++ .type = MT_DEVICE_NONSHARED ++ }, ++}; ++ ++void __init mx25_map_io(void) ++{ ++ mxc_set_cpu_type(MXC_CPU_MX25); + ++ 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-08 12:47:51.000000000 +0200 +@@ -0,0 +1,1122 @@ ++/* ++ * arch/arm/mach-mx2/karo-tx25.c ++ * ++ * Copyright (C) 2008 Lothar Wassmann ++ * ++ * based on: arch/arm/mach-mx27ads.c (C) 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 ++ * 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 ++ * ++ * This file adds support for the Ka-Ro electronics TX25 processor modules ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++//#include ++//#include ++#include ++#include ++#include ++#if defined(CONFIG_MTD) || defined(CONFIG_MTD_MODULE) ++#include ++#include ++#include ++#include ++#endif ++ ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++//#include ++//#include ++#include ++#include ++#include ++//#include ++//#include ++//#include ++ ++#include "crm_regs.h" ++#include "devices.h" ++#include "karo.h" ++ ++#ifdef DEBUG ++int tx25_debug = 1; ++module_param(tx25_debug, int, S_IRUGO | S_IWUSR); ++#else ++static int tx25_debug; ++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) ++{ ++ 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); ++ } ++ } ++ 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; ++} ++device_initcall(tx25_usbh2_register); ++#endif // CONFIG_USB_EHCI_MXC ++ ++//#define FEC_MII_IRQ IRQ_GPIOD(8) ++ ++#if defined(CONFIG_FEC) || defined(CONFIG_FEC_MODULE) ++static struct resource fec_resources[] = { ++ { ++ .start = FEC_BASE_ADDR, ++ .end = FEC_BASE_ADDR + 0x18f, ++ .flags = IORESOURCE_MEM, ++ }, { ++ .start = FEC_BASE_ADDR + 0x200, ++ .end = FEC_BASE_ADDR + 0x30b, ++ .flags = IORESOURCE_MEM, ++ }, { ++ .start = MXC_INT_FEC, ++ .end = MXC_INT_FEC, ++ .flags = IORESOURCE_IRQ, ++#ifdef FEC_MII_IRQ ++ }, { ++ .start = FEC_MII_IRQ, ++ .end = FEC_MII_IRQ, ++ .flags = IORESOURCE_IRQ | IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, ++#endif ++ }, ++}; ++ ++/* ++ * Setup GPIO for FEC device to be active ++ * ++ */ ++static struct pad_desc karo_tx25_fec_gpios_off[] = { ++ MX25_PAD_FEC_MDC__GPIO_3_5, ++ MX25_PAD_FEC_MDIO__GPIO_3_6, ++ MX25_PAD_FEC_TDATA0__GPIO_3_7, ++ MX25_PAD_FEC_TDATA1__GPIO_3_8, ++ MX25_PAD_FEC_TX_EN__GPIO_3_9, ++ MX25_PAD_FEC_RDATA0__GPIO_3_10, ++ MX25_PAD_FEC_RDATA1__GPIO_3_11, ++ MX25_PAD_FEC_RX_DV__GPIO_3_12, ++ MX25_PAD_FEC_TX_CLK__GPIO_3_13, ++ MX25_PAD_D12__GPIO_4_8, ++ MX25_PAD_D10__GPIO_4_10, ++}; ++ ++static struct pad_desc karo_tx25_fec_pwr_gpios[] = { ++ MX25_PAD_D11__GPIO_4_9, /* FEC PHY power on pin */ ++ MX25_PAD_D13__GPIO_4_7, /* FEC reset */ ++}; ++ ++static struct pad_desc karo_tx25_fec_gpios_on[] = { ++ MX25_PAD_FEC_MDC__FEC_MDC, ++ MX25_PAD_FEC_MDIO__FEC_MDIO, ++ MX25_PAD_FEC_TDATA0__FEC_TDATA0, ++ MX25_PAD_FEC_TDATA1__FEC_TDATA1, ++ MX25_PAD_FEC_TX_EN__FEC_TX_EN, ++ MX25_PAD_FEC_RDATA0__FEC_RDATA0, ++ MX25_PAD_FEC_RDATA1__FEC_RDATA1, ++ MX25_PAD_FEC_RX_DV__FEC_RX_DV, ++ MX25_PAD_FEC_TX_CLK__FEC_TX_CLK, ++ MX25_PAD_D12__GPIO_4_8, ++ MX25_PAD_D10__GPIO_4_10, ++}; ++ ++static struct gpio_desc { ++ unsigned int gpio:7; ++ unsigned int dir:1; ++ unsigned int level:1; ++} karo_tx25_fec_strap_gpios[] = { ++ /* configure the PHY strap pins to the correct values */ ++ { GPIO_PORTC | 5, 1, 0, }, ++ { GPIO_PORTC | 6, 1, 0, }, ++ { GPIO_PORTC | 7, 1, 0, }, ++ { GPIO_PORTC | 8, 1, 0, }, ++ { GPIO_PORTC | 9, 1, 0, }, ++ { GPIO_PORTC | 10, 1, 1, }, ++ { GPIO_PORTC | 11, 1, 1, }, ++ { GPIO_PORTC | 12, 0, 1, }, ++ { GPIO_PORTC | 13, 1, 0, }, ++ ++ { GPIO_PORTD | 8, 0, 0, }, ++ { GPIO_PORTD | 10, 0, 0, }, ++ { GPIO_PORTD | 9, 1, 1, }, ++ { GPIO_PORTD | 7, 1, 0, }, ++}; ++ ++#define TX25_FEC_PWR_GPIO (GPIO_PORTD | 9) ++#define TX25_FEC_RST_GPIO (GPIO_PORTD | 7) ++ ++static int gpio_fec_active(void) ++{ ++ int ret; ++ int i; ++ ++#ifdef FEC_MII_IRQ ++ DBG(0, "%s: Using IRQ %d (GPIO %d) for MII\n", __FUNCTION__, ++ FEC_MII_IRQ, irq_to_gpio(FEC_MII_IRQ)); ++ ++ set_irq_type(FEC_MII_IRQ, IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING); ++#endif ++ ret = mxc_iomux_v3_setup_multiple_pads(karo_tx25_fec_pwr_gpios, ++ ARRAY_SIZE(karo_tx25_fec_pwr_gpios)); ++ if (ret) { ++ return ret; ++ } ++ /* ++ * If the PHY is already powered on, assume it has been ++ * correctly configured (by the boot loader) ++ */ ++ if (0 && gpio_get_value(TX25_FEC_PWR_GPIO) && ++ gpio_get_value(TX25_FEC_RST_GPIO)) { ++ ret = mxc_iomux_v3_setup_multiple_pads(karo_tx25_fec_gpios_on, ++ ARRAY_SIZE(karo_tx25_fec_gpios_on)); ++ if (ret) { ++ mxc_iomux_v3_release_multiple_pads(karo_tx25_fec_pwr_gpios, ++ ARRAY_SIZE(karo_tx25_fec_pwr_gpios)); ++ return ret; ++ } ++ } else { ++ /* switch PHY strap pins into required state */ ++ ret = mxc_iomux_v3_setup_multiple_pads(karo_tx25_fec_gpios_off, ++ ARRAY_SIZE(karo_tx25_fec_gpios_off)); ++ if (ret) { ++ mxc_iomux_v3_release_multiple_pads(karo_tx25_fec_pwr_gpios, ++ ARRAY_SIZE(karo_tx25_fec_pwr_gpios)); ++ 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]; ++ ++ ret = gpio_request(pd->gpio, "FEC"); ++ if (ret < 0) { ++ DBG(0, "%s: Failed to request GPIO%d_%d: %d\n", ++ __FUNCTION__, pd->gpio / 32 + 1, pd->gpio % 32, ret); ++ goto rel_mux; ++ } ++ if (pd->dir) { ++ gpio_direction_output(pd->gpio, ++ pd->level); ++ } else { ++ gpio_direction_input(pd->gpio); ++ } ++ } ++#ifdef DEBUG ++ for (i = 0; i < ARRAY_SIZE(karo_tx25_fec_strap_gpios); i++) { ++ struct gpio_desc *pd = &karo_tx25_fec_strap_gpios[i]; ++ int grp = pd->gpio / 32 + 1; ++ int ofs = pd->gpio % 32; ++ ++ if (pd->dir && pd->level != gpio_get_value(pd->gpio)) { ++ DBG(0, "%s: GPIO%d_%d is %d instead of %d\n", __FUNCTION__, ++ grp, ofs, gpio_get_value(pd->gpio), ++ pd->level); ++ } ++ } ++#endif ++ DBG(0, "%s: Delaying for 22ms\n", __FUNCTION__); ++ mdelay(22); ++ DBG(0, "%s: Deasserting FEC PHY reset\n", __FUNCTION__); ++ gpio_set_value(TX25_FEC_RST_GPIO, 1); ++#ifdef DEBUG ++ for (i = 0; i < ARRAY_SIZE(karo_tx25_fec_strap_gpios); i++) { ++ struct gpio_desc *pd = &karo_tx25_fec_strap_gpios[i]; ++ int grp = pd->gpio / 32 + 1; ++ int ofs = pd->gpio % 32; ++ ++ DBG(0, "%s: GPIO%d_%d is %d\n", __FUNCTION__, ++ grp, ofs, gpio_get_value(pd->gpio)); ++ } ++#endif ++ mxc_iomux_v3_release_multiple_pads(karo_tx25_fec_gpios_off, ++ ARRAY_SIZE(karo_tx25_fec_gpios_off)); ++ ret = mxc_iomux_v3_setup_multiple_pads(karo_tx25_fec_gpios_on, ++ ARRAY_SIZE(karo_tx25_fec_gpios_on)); ++ if (ret) { ++ goto rel_gpio; ++ } ++#ifdef DEBUG ++ for (i = 0; i < ARRAY_SIZE(karo_tx25_fec_strap_gpios); i++) { ++ struct gpio_desc *pd = &karo_tx25_fec_strap_gpios[i]; ++ int grp = pd->gpio / 32 + 1; ++ int ofs = pd->gpio % 32; ++ ++ DBG(0, "%s: GPIO%d_%d is %d\n", __FUNCTION__, ++ grp, ofs, gpio_get_value(pd->gpio)); ++ } ++#endif ++ } ++ return ret; ++ ++ rel_mux: ++ mxc_iomux_v3_release_multiple_pads(karo_tx25_fec_gpios_off, ++ ARRAY_SIZE(karo_tx25_fec_gpios_off)); ++ 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, ++ ARRAY_SIZE(karo_tx25_fec_pwr_gpios)); ++ return ret; ++} ++ ++/* ++ * Setup GPIO for FEC device to be inactive ++ * ++ */ ++static void gpio_fec_inactive(void) ++{ ++ int i; ++ ++ mxc_iomux_v3_release_multiple_pads(karo_tx25_fec_gpios_on, ++ ARRAY_SIZE(karo_tx25_fec_gpios_on)); ++ mxc_iomux_v3_setup_multiple_pads(karo_tx25_fec_gpios_off, ++ ARRAY_SIZE(karo_tx25_fec_gpios_off)); ++ DBG(0, "%s: Asserting FEC PHY reset\n", __FUNCTION__); ++ gpio_set_value(TX25_FEC_RST_GPIO, 0); ++ DBG(0, "%s: Switching FEC PHY power off\n", __FUNCTION__); ++ gpio_set_value(TX25_FEC_PWR_GPIO, 0); ++ ++ mxc_iomux_v3_release_multiple_pads(karo_tx25_fec_gpios_off, ++ ARRAY_SIZE(karo_tx25_fec_gpios_off)); ++ mxc_iomux_v3_release_multiple_pads(karo_tx25_fec_pwr_gpios, ++ 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); ++ } ++} ++ ++static struct clk *tx25_fec_clk; ++ ++static int tx25_fec_suspend(struct platform_device *pdev) ++{ ++ BUG_ON(tx25_fec_clk == NULL); ++ DBG(1, "%s: Switching FEC PHY off\n", __FUNCTION__); ++ gpio_fec_inactive(); ++ clk_disable(tx25_fec_clk); ++ return 0; ++} ++ ++static int tx25_fec_resume(struct platform_device *pdev) ++{ ++ BUG_ON(tx25_fec_clk == NULL); ++ DBG(1, "%s: Switching FEC PHY on\n", __FUNCTION__); ++ clk_enable(tx25_fec_clk); ++ gpio_fec_active(); ++ 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; ++ ++ DBG(0, "%s: Activating FEC GPIOs\n", __FUNCTION__); ++ dump_regs(); ++ ++ ret = gpio_fec_active(); ++ if (ret) { ++ printk(KERN_ERR "%s: could not enable FEC gpios: %d\n", __FUNCTION__, ret); ++ return ret; ++ } ++ ++ BUG_ON(tx25_fec_clk != NULL); ++ tx25_fec_clk = clk_get(&pdev->dev, NULL); ++ if (unlikely(IS_ERR(tx25_fec_clk))) { ++ printk(KERN_ERR "Failed to get fec_clk\n"); ++ return PTR_ERR(tx25_fec_clk); ++ } ++ DBG(0, "%s: Enabling FEC clock\n", __FUNCTION__); ++ clk_enable(tx25_fec_clk); ++ dump_regs(); ++ return 0; ++} ++ ++static void fec_arch_exit(struct platform_device *pdev) ++{ ++ BUG_ON(tx25_fec_clk == NULL); ++ if (unlikely(IS_ERR(tx25_fec_clk))) { ++ printk(KERN_ERR "Failed to get fec_clk\n"); ++ return; ++ } ++ DBG(0, "%s: Disabling FEC clock\n", __FUNCTION__); ++ clk_disable(tx25_fec_clk); ++ clk_put(tx25_fec_clk); ++ tx25_fec_clk = NULL; ++ DBG(0, "%s: Deactivating FEC GPIOs\n", __FUNCTION__); ++ gpio_fec_inactive(); ++} ++ ++static struct fec_enet_platform_data fec_data = { ++ .arch_init = fec_arch_init, ++ .arch_exit = fec_arch_exit, ++ .suspend = tx25_fec_suspend, ++ .resume = tx25_fec_resume, ++}; ++ ++static struct platform_device fec_device = { ++ .name = "fec", ++ .id = 0, ++ .num_resources = ARRAY_SIZE(fec_resources), ++ .resource = fec_resources, ++ .dev = { ++ .platform_data = &fec_data, ++ .coherent_dma_mask = 0xFFFFFFFF, ++ }, ++}; ++#endif ++ ++/* MTD NAND flash */ ++#if defined(CONFIG_MTD_NAND_MXC) || defined(CONFIG_MTD_NAND_MXC_MODULE) ++static struct pad_desc karo_tx25_nand_pads[] = { ++ MX25_PAD_NF_CE0__NF_CE0, ++ MX25_PAD_NFWE_B__NFWE_B, ++ MX25_PAD_NFRE_B__NFRE_B, ++ MX25_PAD_NFALE__NFALE, ++ MX25_PAD_NFCLE__NFCLE, ++ MX25_PAD_NFWP_B__NFWP_B, ++ MX25_PAD_NFRB__NFRB, ++ MX25_PAD_D7__D7, ++ MX25_PAD_D6__D6, ++ MX25_PAD_D5__D5, ++ MX25_PAD_D4__D4, ++ MX25_PAD_D3__D3, ++ MX25_PAD_D2__D2, ++ MX25_PAD_D1__D1, ++ MX25_PAD_D0__D0, ++}; ++ ++#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 int tx25_nand_init(void) ++{ ++ int ret; ++ ++ DBG(0, "%s: Configuring NAND pins\n", __FUNCTION__); ++ ret = mxc_iomux_v3_setup_multiple_pads(karo_tx25_nand_pads, ++ ARRAY_SIZE(karo_tx25_nand_pads)); ++ if (ret) { ++ return ret; ++ } ++ 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, ++}; ++ ++static int tx25_nand_init(void) ++{ ++ int ret; ++ ++ DBG(0, "%s: Configuring NAND pins\n", __FUNCTION__); ++ ret = mxc_iomux_v3_setup_multiple_pads(karo_tx25_nand_pads, ++ ARRAY_SIZE(karo_tx25_nand_pads)); ++ if (ret) { ++ return ret; ++ } ++ return 0; ++} ++arch_initcall(tx25_nand_init); ++#endif ++ ++static struct resource tx25_nand_resources[] = { ++ { ++ .start = NFC_BASE_ADDR + 0x1e00, ++ .end = NFC_BASE_ADDR + 0x1e2f, ++ .flags = IORESOURCE_MEM, ++ }, { ++ .start = NFC_BASE_ADDR, ++ .end = NFC_BASE_ADDR + 0x11ff, ++ .flags = IORESOURCE_MEM, ++ }, { ++ .start = MXC_INT_NANDFC, ++ .end = MXC_INT_NANDFC, ++ .flags = IORESOURCE_IRQ, ++ }, ++}; ++ ++static struct platform_device tx25_nand_mtd_device = { ++ .name = "mxc_nand", ++ .id = 0, ++ .num_resources = ARRAY_SIZE(tx25_nand_resources), ++ .resource = tx25_nand_resources, ++ .dev = { ++ .platform_data = &tx25_nand_data, ++ }, ++}; ++#endif ++ ++#if defined(CONFIG_VIDEO_MXC_EMMA_OUTPUT) || defined(CONFIG_VIDEO_MXC_EMMA_OUTPUT_MODULE) ++static u64 mxc_emma_dmamask = 0xffffffffUL; ++ ++static struct platform_device tx25_v4l2out_device = { ++ .name = "MXC Video Output", ++ .id = 0, ++ .dev = { ++ .dma_mask = &mxc_emma_dmamask, ++ .coherent_dma_mask = ~0UL, ++ }, ++}; ++#endif ++ ++#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, ++}; ++ ++static int karo_tx25_i2c_0_init(struct device *dev) ++{ ++ DBG(-1, "%s: \n", __FUNCTION__); ++ return mxc_iomux_v3_setup_multiple_pads(mxc_i2c0_pins, ++ ARRAY_SIZE(mxc_i2c0_pins)); ++} ++ ++static void karo_tx25_i2c_0_exit(struct device *dev) ++{ ++ DBG(-1, "%s: \n", __FUNCTION__); ++ mxc_iomux_v3_release_multiple_pads(mxc_i2c0_pins, ++ ARRAY_SIZE(mxc_i2c0_pins)); ++} ++ ++static struct imxi2c_platform_data karo_tx25_i2c_0_data = { ++ .bitrate = 100000, ++ .init = karo_tx25_i2c_0_init, ++ .exit = karo_tx25_i2c_0_exit, ++}; ++ ++static struct at24_platform_data karo_tx25_eeprom = { ++ .byte_len = 2048, ++ .page_size = 32, ++ .flags = AT24_FLAG_ADDR16 | AT24_FLAG_TAKE8ADDR, ++}; ++ ++static struct i2c_board_info karo_i2c_0_boardinfo[] __initdata = { ++ { ++ I2C_BOARD_INFO("24c16", 0x50), ++ .platform_data = &karo_tx25_eeprom, ++ .type = "24c16", ++ }, ++}; ++ ++int __init karo_i2c_init(void) ++{ ++ int ret; ++ ++ DBG(0, "%s: Registering I2C bus 0\n", __FUNCTION__); ++ ret = mxc_register_device(&mx25_i2c_device0, &karo_tx25_i2c_0_data); ++ if (ret != 0) { ++ printk(KERN_ERR "Failed to register I2C device: %d\n", ret); ++ return ret; ++ } ++ ret = i2c_register_board_info(0, karo_i2c_0_boardinfo, ++ ARRAY_SIZE(karo_i2c_0_boardinfo)); ++ if (ret != 0) { ++ printk(KERN_ERR "Failed to register I2C board info: %d\n", ret); ++ } ++ return ret; ++} ++device_initcall(karo_i2c_init); ++#endif ++#endif ++ ++struct platform_dev_list { ++ struct platform_device *pdev; ++ int flag; ++} tx25_devices[] __initdata = { ++#if defined(CONFIG_RTC_MXC) || defined(CONFIG_RTC_MXC_MODULE) ++ { .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, }, ++#endif ++#if defined(CONFIG_FEC) || defined(CONFIG_FEC_MODULE) ++ { .pdev = &fec_device, .flag = 1, }, ++#endif ++#if defined(CONFIG_SPI_MXC) || defined(CONFIG_SPI_MXC_MODULE) ++ { .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, }, ++#endif ++#if defined(CONFIG_MXC_VPU) || defined(CONFIG_MXC_VPU_MODULE) ++ { .pdev = &mxc_vpu_device, .flag = 1, }, ++#endif ++}; ++#define TX25_NUM_DEVICES ARRAY_SIZE(tx25_devices) ++ ++static __init void karo_tx25_board_init(void) ++{ ++ int i; ++ ++ DBG(0, "%s: \n", __FUNCTION__); ++ ++ dump_regs(); ++ ++ for (i = 0; i < TX25_NUM_DEVICES; i++) { ++ int ret; ++ ++ if (tx25_devices[i].pdev == NULL) continue; ++ if (!tx25_devices[i].flag) { ++ DBG(0, "%s: Skipping platform device[%d] @ %p dev %p: %s\n", ++ __FUNCTION__, i, tx25_devices[i].pdev, &tx25_devices[i].pdev->dev, ++ tx25_devices[i].pdev->name); ++ continue; ++ } ++ DBG(0, "%s: Registering platform device[%d] @ %p dev %p: %s\n", ++ __FUNCTION__, i, tx25_devices[i].pdev, &tx25_devices[i].pdev->dev, ++ tx25_devices[i].pdev->name); ++ ret = platform_device_register(tx25_devices[i].pdev); ++ if (ret) { ++ printk(KERN_WARNING "%s: Failed to register platform_device[%d]: %s: %d\n", ++ __FUNCTION__, i, tx25_devices[i].pdev->name, ret); ++ } ++ } ++ DBG(0, "%s: Done\n", __FUNCTION__); ++} ++ ++static struct pad_desc karo_tx25_gpios[] __initdata = { ++ MX25_PAD_GPIO_A__GPIO_A, ++ MX25_PAD_GPIO_B__GPIO_B, ++ MX25_PAD_GPIO_C__GPIO_C, ++ MX25_PAD_GPIO_D__GPIO_D, ++ MX25_PAD_GPIO_E__GPIO_E, ++ MX25_PAD_GPIO_F__GPIO_F, ++ MX25_PAD_CSI_D7__GPIO_1_6, ++ MX25_PAD_CSI_D8__GPIO_1_7, ++ MX25_PAD_CSI_MCLK__GPIO_1_8, ++ MX25_PAD_CSI_VSYNC__GPIO_1_9, ++ MX25_PAD_CSI_HSYNC__GPIO_1_10, ++ MX25_PAD_CSI_PIXCLK__GPIO_1_11, ++ MX25_PAD_I2C1_CLK__GPIO_1_12, ++ MX25_PAD_I2C1_DAT__GPIO_1_13, ++ MX25_PAD_CSPI1_MOSI__GPIO_1_14, ++ MX25_PAD_CSPI1_MISO__GPIO_1_15, ++ MX25_PAD_CSPI1_SS0__GPIO_1_16, ++ MX25_PAD_CSPI1_SS1__GPIO_1_17, ++ MX25_PAD_CSPI1_SCLK__GPIO_1_18, ++ MX25_PAD_LD5__GPIO_1_19, ++ MX25_PAD_LD6__GPIO_1_20, ++ MX25_PAD_LD7__GPIO_1_21, ++ MX25_PAD_HSYNC__GPIO_1_22, ++ MX25_PAD_VSYNC__GPIO_1_23, ++ MX25_PAD_LSCLK__GPIO_1_24, ++ MX25_PAD_OE_ACD__GPIO_1_25, ++ MX25_PAD_PWM__GPIO_1_26, ++ MX25_PAD_CSI_D2__GPIO_1_27, ++ MX25_PAD_CSI_D3__GPIO_1_28, ++ MX25_PAD_CSI_D4__GPIO_1_29, ++ MX25_PAD_CSI_D5__GPIO_1_30, ++ MX25_PAD_CSI_D6__GPIO_1_31, ++ ++ MX25_PAD_A14__GPIO_2_0, ++ MX25_PAD_A15__GPIO_2_1, ++ MX25_PAD_A16__GPIO_2_2, ++ MX25_PAD_A17__GPIO_2_3, ++ MX25_PAD_A18__GPIO_2_4, ++ MX25_PAD_A19__GPIO_2_5, ++ MX25_PAD_A20__GPIO_2_6, ++ MX25_PAD_A21__GPIO_2_7, ++ MX25_PAD_A22__GPIO_2_8, ++ MX25_PAD_A23__GPIO_2_9, ++ MX25_PAD_A24__GPIO_2_10, ++ MX25_PAD_A25__GPIO_2_11, ++ MX25_PAD_EB0__GPIO_2_12, ++ MX25_PAD_EB1__GPIO_2_13, ++ MX25_PAD_OE__GPIO_2_14, ++ MX25_PAD_LD0__GPIO_2_15, ++ MX25_PAD_LD1__GPIO_2_16, ++ MX25_PAD_LD2__GPIO_2_17, ++ MX25_PAD_LD3__GPIO_2_18, ++ MX25_PAD_LD4__GPIO_2_19, ++ MX25_PAD_DE_B__GPIO_2_20, ++ MX25_PAD_CLKO__GPIO_2_21, ++ MX25_PAD_CSPI1_RDY__GPIO_2_22, ++ MX25_PAD_SD1_CMD__GPIO_2_23, ++ MX25_PAD_SD1_CLK__GPIO_2_24, ++ MX25_PAD_SD1_DATA0__GPIO_2_25, ++ MX25_PAD_SD1_DATA1__GPIO_2_26, ++ MX25_PAD_SD1_DATA2__GPIO_2_27, ++ MX25_PAD_SD1_DATA3__GPIO_2_28, ++ MX25_PAD_KPP_ROW0__GPIO_2_29, ++ MX25_PAD_KPP_ROW1__GPIO_2_30, ++ MX25_PAD_KPP_ROW2__GPIO_2_31, ++ ++ MX25_PAD_KPP_ROW3__GPIO_3_0, ++ MX25_PAD_KPP_COL0__GPIO_3_1, ++ MX25_PAD_KPP_COL1__GPIO_3_2, ++ MX25_PAD_KPP_COL2__GPIO_3_3, ++ MX25_PAD_KPP_COL3__GPIO_3_4, ++ MX25_PAD_FEC_MDC__GPIO_3_5, ++ MX25_PAD_FEC_MDIO__GPIO_3_6, ++ MX25_PAD_FEC_TDATA0__GPIO_3_7, ++ MX25_PAD_FEC_TDATA1__GPIO_3_8, ++ MX25_PAD_FEC_TX_EN__GPIO_3_9, ++ MX25_PAD_FEC_RDATA0__GPIO_3_10, ++ MX25_PAD_FEC_RDATA1__GPIO_3_11, ++ MX25_PAD_FEC_RX_DV__GPIO_3_12, ++ MX25_PAD_FEC_TX_CLK__GPIO_3_13, ++ MX25_PAD_RTCK__GPIO_3_14, ++ MX25_PAD_EXT_ARMCLK__GPIO_3_15, ++ MX25_PAD_UPLL_BYPCLK__GPIO_3_16, ++ MX25_PAD_VSTBY_REQ__GPIO_3_17, ++ MX25_PAD_VSTBY_ACK__GPIO_3_18, ++ MX25_PAD_POWER_FAIL__GPIO_3_19, ++ MX25_PAD_CS4__GPIO_3_20, ++ MX25_PAD_CS5__GPIO_3_21, ++ MX25_PAD_NF_CE0__GPIO_3_22, ++ MX25_PAD_ECB__GPIO_3_23, ++ MX25_PAD_LBA__GPIO_3_24, ++ MX25_PAD_RW__GPIO_3_25, ++ MX25_PAD_NFWE_B__GPIO_3_26, ++ MX25_PAD_NFRE_B__GPIO_3_27, ++ MX25_PAD_NFALE__GPIO_3_28, ++ MX25_PAD_NFCLE__GPIO_3_29, ++ MX25_PAD_NFWP_B__GPIO_3_30, ++ MX25_PAD_NFRB__GPIO_3_31, ++ ++ MX25_PAD_A10__GPIO_4_0, ++ MX25_PAD_A13__GPIO_4_1, ++ MX25_PAD_CS0__GPIO_4_2, ++ MX25_PAD_CS1__GPIO_4_3, ++ MX25_PAD_BCLK__GPIO_4_4, ++ MX25_PAD_D15__GPIO_4_5, ++ MX25_PAD_D14__GPIO_4_6, ++ MX25_PAD_D13__GPIO_4_7, ++ MX25_PAD_D12__GPIO_4_8, ++ MX25_PAD_D11__GPIO_4_9, ++ MX25_PAD_D10__GPIO_4_10, ++ MX25_PAD_D9__GPIO_4_11, ++ MX25_PAD_D8__GPIO_4_12, ++ MX25_PAD_D7__GPIO_4_13, ++ MX25_PAD_D6__GPIO_4_14, ++ MX25_PAD_D5__GPIO_4_15, ++ MX25_PAD_D4__GPIO_4_16, ++ MX25_PAD_D3__GPIO_4_17, ++ MX25_PAD_D2__GPIO_4_18, ++ MX25_PAD_D1__GPIO_4_19, ++ MX25_PAD_D0__GPIO_4_20, ++ MX25_PAD_CSI_D9__GPIO_4_21, ++ MX25_PAD_UART1_RXD__GPIO_4_22, ++ MX25_PAD_UART1_TXD__GPIO_4_23, ++ MX25_PAD_UART1_RTS__GPIO_4_24, ++ MX25_PAD_UART1_CTS__GPIO_4_25, ++ MX25_PAD_UART2_RXD__GPIO_4_26, ++ MX25_PAD_UART2_TXD__GPIO_4_27, ++ MX25_PAD_UART2_RTS__GPIO_4_28, ++ MX25_PAD_UART2_CTS__GPIO_4_29, ++ MX25_PAD_BOOT_MODE0__GPIO_4_30, ++ MX25_PAD_BOOT_MODE1__GPIO_4_31, ++}; ++ ++static int __init karo_tx25_setup_gpios(void) ++{ ++ 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 ++ DBG(0, "%s: PAD[%d] %s set up as GPIO\n", __FUNCTION__, i, pd->name); ++#else ++ DBG(0, "%s: PAD[%d] set up as GPIO\n", __FUNCTION__, i); ++#endif ++ count++; ++ mxc_iomux_v3_release_pad(pd); ++ } else { ++#ifdef IOMUX_DEBUG ++ DBG(0, "%s: PAD[%d] %s skipped\n", __FUNCTION__, i, pd->name); ++#else ++ DBG(0, "%s: PAD[%d] skipped\n", __FUNCTION__, i); ++#endif ++ } ++ } ++ 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; ++} ++late_initcall(karo_tx25_setup_gpios); ++ ++static void __init karo_tx25_map_io(void) ++{ ++ mx25_map_io(); ++} ++ ++static void __init karo_tx25_fixup(struct machine_desc *desc, struct tag *tags, ++ char **cmdline, struct meminfo *mi) ++{ ++} ++ ++static void __init karo_tx25_timer_init(void) ++{ ++ DBG(0, "%s: \n", __FUNCTION__); ++ mx25_clocks_init(24000000); ++ DBG(0, "%s: Done\n", __FUNCTION__); ++} ++ ++struct sys_timer karo_tx25_timer = { ++ .init = karo_tx25_timer_init, ++}; ++ ++static int __init karo_mod_type_setup(char *line) ++{ ++ get_option(&line, &karo_mod_type); ++ DBG(0, "%s: Module type set to 0x%02x by kernel cmd line\n", __FUNCTION__, karo_mod_type); ++ ++ return 1; ++} ++__setup("module_type=", karo_mod_type_setup); ++ ++static int __init karo_board_type_setup(char *line) ++{ ++ get_option(&line, &karo_board_type); ++ DBG(0, "%s: Board type set to 0x%02x by kernel cmd line\n", __FUNCTION__, karo_board_type); ++ ++ return 1; ++} ++__setup("board_type=", karo_board_type_setup); ++ ++MACHINE_START(TX25, "Ka-Ro electronics TX25 module (Freescale i.MX25)") ++ /* Maintainer: */ ++ .phys_io = AIPS1_BASE_ADDR, ++ .io_pg_offst = ((unsigned long)AIPS1_BASE_ADDR_VIRT >> 18) & 0xfffc, ++ .fixup = karo_tx25_fixup, ++ .map_io = karo_tx25_map_io, ++ .init_irq = mxc_init_irq, ++ .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:59:18.000000000 +0200 +@@ -0,0 +1,99 @@ ++/* ++ * arch/arm/mach-mx2/karo.h ++ * ++ * Copyright (C) 2009 Lothar Wassmann ++ * ++ * 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 ++ * ++ * This file provides platform specific definitions for the ++ * Ka-Ro electronics TX25 processor modules ++ */ ++ ++#include ++#include "crm_regs_mx25.h" ++ ++enum { ++ BOARD_KARO_STK5, ++}; ++ ++extern int karo_board_type; ++extern int karo_mod_type; ++ ++#ifdef DEBUG ++extern int tx25_debug; ++#define dbg_lvl(n) ((n) < tx25_debug) ++#define DBG(lvl, fmt...) do { if (dbg_lvl(lvl)) printk(KERN_DEBUG fmt); } while (0) ++#else ++#define dbg_lvl(n) 0 ++#define DBG(lvl, fmt...) do { } while (0) ++#endif ++ ++static inline int karo_get_board_type(void) ++{ ++ return karo_board_type; ++} ++ ++static inline int karo_get_module_type(void) ++{ ++ return karo_mod_type; ++} ++ ++#define SHOW_REG(reg) DBG(0, "%s[%08lx]=%08x\n", #reg, MXC_PHYS_ADDRESS(reg), __raw_readl(reg)) ++ ++#define SHOW_GPIO_REG(port, reg) \ ++ DBG(0, "GPIO%d_%s[%08lx]=%08x\n", port, #reg, \ ++ GPIO_BASE_ADDR(port) + GPIO_##reg, \ ++ __raw_readl(IO_ADDRESS(GPIO_BASE_ADDR(port) + GPIO_##reg))) ++ ++static inline void dump_regs(void) ++{ ++ int i; ++ ++ SHOW_REG(MXC_CCM_MPCTL); ++ SHOW_REG(MXC_CCM_UPCTL); ++ SHOW_REG(MXC_CCM_CCTL); ++ SHOW_REG(MXC_CCM_RCSR); ++ SHOW_REG(MXC_CCM_CRDR); ++ SHOW_REG(MXC_CCM_PCDR0); ++ SHOW_REG(MXC_CCM_PCDR1); ++ SHOW_REG(MXC_CCM_PCDR2); ++ SHOW_REG(MXC_CCM_PCDR3); ++ SHOW_REG(MXC_CCM_CGCR0); ++ SHOW_REG(MXC_CCM_CGCR1); ++ SHOW_REG(MXC_CCM_CGCR2); ++ SHOW_REG(MXC_CCM_MCR); ++ SHOW_REG(MXC_CCM_PMCR0); ++ SHOW_REG(MXC_CCM_PMCR1); ++ SHOW_REG(MXC_CCM_PMCR2); ++ SHOW_REG(MXC_CCM_LTBR0); ++ SHOW_REG(MXC_CCM_LTBR1); ++ SHOW_REG(MXC_CCM_LTR0); ++ SHOW_REG(MXC_CCM_LTR1); ++ SHOW_REG(MXC_CCM_LTR2); ++ SHOW_REG(MXC_CCM_LTR3); ++ SHOW_REG(MXC_CCM_DCVR0); ++ SHOW_REG(MXC_CCM_DCVR1); ++ SHOW_REG(MXC_CCM_DCVR2); ++ SHOW_REG(MXC_CCM_DCVR3); ++ ++ for (i = 1; i <= 4; i++) { ++ SHOW_GPIO_REG(i, DR); ++ SHOW_GPIO_REG(i, GDIR); ++ SHOW_GPIO_REG(i, PSR); ++ SHOW_GPIO_REG(i, ICR1); ++ SHOW_GPIO_REG(i, ICR2); ++ SHOW_GPIO_REG(i, IMR); ++ 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:59:18.000000000 +0200 +@@ -0,0 +1,159 @@ ++ ++/* ++ * Copyright 2008 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 ++ */ ++ ++/*! ++ * @file sdma_script_code.h ++ * @brief This file contains functions of SDMA scripts code initialization ++ * ++ * The file was generated automatically. Based on sdma scripts library. ++ * ++ * @ingroup SDMA ++ */ ++/************************************************************************ ++ ++ SDMA RELEASE LABEL: "SS15_SENNA" ++ ++************************************************************************/ ++ ++#ifndef SDMA_SCRIPT_CODE_H ++#define SDMA_SCRIPT_CODE_H ++ ++/*! ++ * SDMA ROM scripts start addresses and sizes ++ */ ++#define start_ADDR 0 ++#define start_SIZE 22 ++ ++#define core_ADDR 80 ++#define core_SIZE 233 ++ ++#define common_ADDR 313 ++#define common_SIZE 416 ++ ++#define ap_2_ap_ADDR 729 ++#define ap_2_ap_SIZE 41 ++ ++#define app_2_mcu_ADDR 770 ++#define app_2_mcu_SIZE 64 ++ ++#define mcu_2_app_ADDR 834 ++#define mcu_2_app_SIZE 70 ++ ++#define uart_2_mcu_ADDR 904 ++#define uart_2_mcu_SIZE 75 ++ ++#define shp_2_mcu_ADDR 979 ++#define shp_2_mcu_SIZE 69 ++ ++#define mcu_2_shp_ADDR 1048 ++#define mcu_2_shp_SIZE 72 ++ ++#define uartsh_2_mcu_ADDR 1120 ++#define uartsh_2_mcu_SIZE 69 ++ ++#define app_2_per_ADDR 1189 ++#define app_2_per_SIZE 66 ++ ++#define per_2_app_ADDR 1255 ++#define per_2_app_SIZE 74 ++ ++#define per_2_shp_ADDR 1329 ++#define per_2_shp_SIZE 78 ++ ++#define shp_2_per_ADDR 1407 ++#define shp_2_per_SIZE 72 ++ ++#define mcu_2_ata_ADDR 1479 ++#define mcu_2_ata_SIZE 81 ++ ++#define ata_2_mcu_ADDR 1560 ++#define ata_2_mcu_SIZE 96 ++ ++#define loop_DMAs_routines_ADDR 1656 ++#define loop_DMAs_routines_SIZE 227 ++ ++#define test_ADDR 1883 ++#define test_SIZE 63 ++ ++#define signature_ADDR 1022 ++#define signature_SIZE 1 ++ ++/*! ++ * SDMA RAM scripts start addresses and sizes ++ */ ++#define ext_mem__ipu_ram_ADDR 6144 ++#define ext_mem__ipu_ram_SIZE 123 ++ ++#define uart_2_per_ADDR 6267 ++#define uart_2_per_SIZE 73 ++ ++#define uartsh_2_per_ADDR 6340 ++#define uartsh_2_per_SIZE 67 ++ ++/*! ++ * SDMA RAM image start address and size ++ */ ++#define RAM_CODE_START_ADDR 6144 ++#define RAM_CODE_SIZE 263 ++ ++/*! ++ * Buffer that holds the SDMA RAM image ++ */ ++__attribute__ ((__aligned__(4))) ++#ifndef CONFIG_XIP_KERNEL ++const ++#endif ++static const short sdma_code[] = { ++ 0x0e70, 0x0611, 0x5616, 0xc18a, 0x7d2a, 0x5ade, 0x008e, 0xc19c, ++ 0x7c26, 0x5be0, 0x5ef0, 0x5ce8, 0x0688, 0x08ff, 0x0011, 0x28ff, ++ 0x00bc, 0x53f6, 0x05df, 0x7d0b, 0x6dc5, 0x03df, 0x7d03, 0x6bd5, ++ 0xd84f, 0x982b, 0x6b05, 0xc6d8, 0x7e27, 0x7f29, 0x982b, 0x6d01, ++ 0x03df, 0x7d05, 0x6bd5, 0xc702, 0x7e18, 0x7f1a, 0x982b, 0x6b05, ++ 0xc678, 0x7e07, 0x7f06, 0x52de, 0x53e6, 0xc1a8, 0x7dd7, 0x0200, ++ 0x9803, 0x0007, 0x6004, 0x680c, 0x53f6, 0x028e, 0x00a3, 0xc2ad, ++ 0x048b, 0x0498, 0x0454, 0x068a, 0x982b, 0x0207, 0x680c, 0x6ddf, ++ 0x0107, 0x68ff, 0x60d0, 0x9834, 0x0207, 0x68ff, 0x6d28, 0x0107, ++ 0x6004, 0x680c, 0x9834, 0x0007, 0x68ff, 0x60d0, 0x9834, 0x0288, ++ 0x03a5, 0x3b03, 0x3d03, 0x4d00, 0x7d0a, 0x0804, 0x00a5, 0x00da, ++ 0x7d1a, 0x02a0, 0x7b01, 0x65d8, 0x7eee, 0x65ff, 0x7eec, 0x0804, ++ 0x02d0, 0x7d11, 0x4b00, 0x7c0f, 0x008a, 0x3003, 0x6dcf, 0x6bdf, ++ 0x0015, 0x0015, 0x7b02, 0x65d8, 0x0000, 0x7edd, 0x63ff, 0x7edb, ++ 0x3a03, 0x6dcd, 0x6bdd, 0x008a, 0x7b02, 0x65d8, 0x0000, 0x7ed3, ++ 0x65ff, 0x7ed1, 0x0006, 0xc23a, 0x57db, 0x52f3, 0x6ad5, 0x56fb, ++ 0x028e, 0x1a94, 0x6ac3, 0x62c8, 0x0269, 0x7d1e, 0x1e94, 0x6ee3, ++ 0x62d0, 0x5aeb, 0x62c8, 0x0248, 0x6ed3, 0x6ac8, 0x2694, 0x52eb, ++ 0x6ad5, 0x6ee3, 0x62c8, 0x026e, 0x7d27, 0x6ac8, 0x7f23, 0x2501, ++ 0x4d00, 0x7d26, 0x028e, 0x1a98, 0x6ac3, 0x62c8, 0x6ec3, 0x0260, ++ 0x7df1, 0x62d0, 0xc2d1, 0x98c0, 0x6ee3, 0x008f, 0x2001, 0x00d5, ++ 0x7d01, 0x008d, 0x05a0, 0x62c8, 0x026e, 0x7d0e, 0x6ac8, 0x7f0a, ++ 0x2001, 0x7cf9, 0x6add, 0x7f06, 0x0000, 0x4d00, 0x7d09, 0xc251, ++ 0x57db, 0x987f, 0x0007, 0x6aff, 0x62d0, 0xc2d1, 0x0458, 0x0454, ++ 0x6add, 0x7ff8, 0xc261, 0x987c, 0xc230, 0xc23a, 0x57db, 0x52f3, ++ 0x6ad5, 0x56fb, 0x028e, 0x1a94, 0x5202, 0x0269, 0x7d17, 0x1e94, ++ 0x5206, 0x0248, 0x5a06, 0x2694, 0x5206, 0x026e, 0x7d26, 0x6ac8, ++ 0x7f22, 0x2501, 0x4d00, 0x7d27, 0x028e, 0x1a98, 0x5202, 0x0260, ++ 0x7df3, 0x6add, 0x7f18, 0x62d0, 0xc2d1, 0x9903, 0x008f, 0x2001, ++ 0x00d5, 0x7d01, 0x008d, 0x05a0, 0x5206, 0x026e, 0x7d0e, 0x6ac8, ++ 0x7f0a, 0x2001, 0x7cf9, 0x6add, 0x7f06, 0x0000, 0x4d00, 0x7d0b, ++ 0xc251, 0x57db, 0x98c9, 0x0007, 0x6aff, 0x6add, 0x7ffc, 0x62d0, ++ 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:59:18.000000000 +0200 +@@ -0,0 +1,1003 @@ ++/* ++ * arch/arm/mach-mx2/stk5-baseboard.c ++ * ++ * Copyright (C) 2009 Lothar Wassmann ++ * ++ * ++ * 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 ++ * ++ * This file adds support for devices found on Ka-Ro electronics ++ * Starterkit-5 (STK5) baseboard ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++//#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++//#include ++#include ++#include ++#include ++//#include ++//#include ++#include ++ ++#include "crm_regs.h" ++#include "devices.h" ++#include "karo.h" ++ ++#if defined(CONFIG_SERIAL_IMX) || defined(CONFIG_SERIAL_IMX_MODULE) ++static struct pad_desc stk5_uart_pads[][4] = { ++ { ++ MX25_PAD_UART1_TXD__UART1_TXD, ++ MX25_PAD_UART1_RXD__UART1_RXD, ++ MX25_PAD_UART1_CTS__UART1_CTS, ++ MX25_PAD_UART1_RTS__UART1_RTS, ++ }, { ++ MX25_PAD_UART2_TXD__UART2_TXD, ++ MX25_PAD_UART2_RXD__UART2_RXD, ++ MX25_PAD_UART2_CTS__UART2_CTS, ++ MX25_PAD_UART2_RTS__UART2_RTS, ++ }, { ++ MX25_PAD_ECB__UART5_TXD_MUX, ++ MX25_PAD_LBA__UART5_RXD_MUX, ++ MX25_PAD_CS4__UART5_CTS, ++ MX25_PAD_CS5__UART5_RTS, ++#if 0 ++ }, { ++ MX25_PAD_UART4_TXD__UART4_TXD, ++ MX25_PAD_UART4_RXD__UART4_RXD, ++ MX25_PAD_UART4_CTS__UART4_CTS, ++ MX25_PAD_UART4_RTS__UART4_RTS, ++ }, { ++ MX25_PAD_UART5_TXD__UART5_TXD, ++ MX25_PAD_UART5_RXD__UART5_RXD, ++ MX25_PAD_UART5_CTS__UART5_CTS, ++ MX25_PAD_UART5_RTS__UART5_RTS, ++#endif ++ }, ++}; ++ ++static int stk5_uart_init(struct platform_device *pdev) ++{ ++ DBG(0, "%s: \n", __FUNCTION__); ++ return mxc_iomux_v3_setup_multiple_pads(stk5_uart_pads[pdev->id], ++ ARRAY_SIZE(stk5_uart_pads[pdev->id])); ++} ++ ++static void stk5_uart_exit(struct platform_device *pdev) ++{ ++ DBG(0, "%s: \n", __FUNCTION__); ++ mxc_iomux_v3_release_multiple_pads(stk5_uart_pads[pdev->id], ++ ARRAY_SIZE(stk5_uart_pads[pdev->id])); ++} ++ ++static struct imxuart_platform_data stk5_uart_ports[] = { ++ { ++ .init = stk5_uart_init, ++ .exit = stk5_uart_exit, ++ .flags = IMXUART_HAVE_RTSCTS, ++ }, { ++ .init = stk5_uart_init, ++ .exit = stk5_uart_exit, ++ .flags = IMXUART_HAVE_RTSCTS, ++ }, { ++ .init = stk5_uart_init, ++ .exit = stk5_uart_exit, ++ .flags = IMXUART_HAVE_RTSCTS, ++ }, { ++ .init = stk5_uart_init, ++ .exit = stk5_uart_exit, ++ .flags = IMXUART_HAVE_RTSCTS, ++ }, { ++ .init = stk5_uart_init, ++ .exit = stk5_uart_exit, ++ .flags = IMXUART_HAVE_RTSCTS, ++ }, { ++ .init = stk5_uart_init, ++ .exit = stk5_uart_exit, ++ .flags = IMXUART_HAVE_RTSCTS, ++ }, ++}; ++ ++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 void __init karo_stk5_serial_init(void) ++{ ++} ++#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) ++{ ++ if ((unsigned long)view & 0x400) { ++ return "USBH2"; ++ } else { ++ return "USBOTG"; ++ } ++} ++ ++static int usb3317_init(void __iomem *view) ++{ ++ int vid, pid, ret; ++ ++ 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) { ++ 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; ++ } ++ return 0; ++} ++ ++static int usb3317_set_vbus_power(void __iomem *view, int on) ++{ ++ 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); ++ } ++ } ++ 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 stk5_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 stk5_usbh2_exit(struct platform_device *pdev) ++{ ++ gpio_usbh2_inactive(); ++ return 0; ++} ++ ++static struct mxc_usbh_platform_data stk5_usbh2_data = { ++ .init = stk5_usbh2_init, ++ .exit = stk5_usbh2_exit, ++}; ++ ++static int __init karo_stk5_usbh2_register(void) ++{ ++ int ret; ++ ++ ret = mxc_register_device(&mxc_ehci2, &stk5_usbh2_data); ++ return ret; ++} ++#else ++static inline int karo_stk5_usbh2_register(void) ++{ ++ return 0; ++} ++#endif // CONFIG_USB_EHCI_MXC ++ ++#if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE) ++static struct gpio_led stk5_leds[] = { ++ { ++ .name = "GPIO-LED", ++ .default_trigger = "heartbeat", ++ .gpio = GPIO_PORTB | 7, ++ }, ++}; ++ ++static struct gpio_led_platform_data stk5_led_data = { ++ .leds = stk5_leds, ++ .num_leds = ARRAY_SIZE(stk5_leds), ++}; ++ ++static struct platform_device stk5_led_device = { ++ .name = "leds-gpio", ++ .id = -1, ++ .dev = { ++ .platform_data = &stk5_led_data, ++ }, ++}; ++#endif ++ ++#if defined(CONFIG_KEYBOARD_MXC) || defined(CONFIG_KEYBOARD_MXC_MODULE) ++/*! ++ * This array is used for mapping mx25 ADS keypad scancodes to input keyboard ++ * keycodes. ++ */ ++static u16 stk5_kpd_keycodes[] = { ++ KEY_POWER, ++}; ++ ++static struct keypad_data stk5_keypad = { ++ .rowmax = 1, ++ .colmax = 1, ++ .irq = MXC_INT_KPP, ++ .learning = 0, ++ //.delay = 2, /* unused in the driver! */ ++ .matrix = stk5_kpd_keycodes, ++}; ++ ++static struct resource stk5_kpp_resources[] = { ++ { ++ .start = MXC_INT_KPP, ++ .end = MXC_INT_KPP, ++ .flags = IORESOURCE_IRQ, ++ }, ++}; ++ ++/* stk5 keypad driver */ ++static struct platform_device stk5_keypad_device = { ++ .name = "mxc_keypad", ++ .id = 0, ++ .num_resources = ARRAY_SIZE(stk5_kpp_resources), ++ .resource = stk5_kpp_resources, ++ .dev = { ++ .platform_data = &stk5_keypad, ++ }, ++}; ++#endif ++ ++#if defined(CONFIG_FB_IMX) || defined(CONFIG_FB_IMX_MODULE) ++/* ++ * Setup GPIO for LCDC device to be active ++ * ++ */ ++static struct pad_desc mx25_lcdc_gpios[] = { ++#if 0 ++ MXC_PIN(A, 30, GPIO, GPIO_OUT | GPIO_DFLT_LOW), /* PA30 */ ++ MXC_PIN(A, 25, GPIO, GPIO_OUT | GPIO_DFLT_LOW), /* PA25 */ ++ MXC_PIN(A, 26, GPIO, GPIO_OUT | GPIO_DFLT_LOW), /* PA26 */ ++ MXC_PIN(A, 24, GPIO, GPIO_OUT | GPIO_DFLT_LOW), /* PA24 */ ++ MXC_PIN(A, 27, GPIO, GPIO_OUT | GPIO_DFLT_LOW), /* PA27 */ ++#endif ++ MX25_PAD_LSCLK__LSCLK, ++ MX25_PAD_LD0__LD0, ++ MX25_PAD_LD1__LD1, ++ MX25_PAD_LD2__LD2, ++ MX25_PAD_LD3__LD3, ++ MX25_PAD_LD4__LD4, ++ MX25_PAD_LD5__LD5, ++ MX25_PAD_LD6__LD6, ++ MX25_PAD_LD7__LD7, ++ MX25_PAD_LD8__LD8, ++ MX25_PAD_LD9__LD9, ++ MX25_PAD_LD10__LD10, ++ MX25_PAD_LD11__LD11, ++ MX25_PAD_LD12__LD12, ++ MX25_PAD_LD13__LD13, ++ MX25_PAD_LD14__LD14, ++ MX25_PAD_LD15__LD15, ++ MX25_PAD_D15__LD16, ++ MX25_PAD_D14__LD17, ++ MX25_PAD_HSYNC__HSYNC, ++ MX25_PAD_VSYNC__VSYNC, ++ MX25_PAD_OE_ACD__OE_ACD, ++}; ++ ++static int stk5_gpio_lcdc_active(struct platform_device *dev) ++{ ++ int ret; ++ ++ DBG(0, "%s: Setting up GPIO pins for LCD\n", __FUNCTION__); ++ ret = mxc_iomux_v3_setup_multiple_pads(mx25_lcdc_gpios, ++ ARRAY_SIZE(mx25_lcdc_gpios)); ++ if (ret) { ++ DBG(0, "%s: Failed to setup GPIO pins for LCD: %d\n", ++ __FUNCTION__, ret); ++ return ret; ++ } ++ return 0; ++} ++ ++/* ++ * Setup GPIO for LCDC device to be inactive ++ * ++ */ ++static void stk5_gpio_lcdc_inactive(struct platform_device *dev) ++{ ++ mxc_iomux_v3_release_multiple_pads(mx25_lcdc_gpios, ++ ARRAY_SIZE(mx25_lcdc_gpios)); ++} ++ ++static struct imx_fb_platform_data stk5_fb_data[] __initdata = { ++ { ++ //.fb_mode = "Xenarc_700_Y-18", ++ .init = stk5_gpio_lcdc_active, ++ .exit = stk5_gpio_lcdc_inactive, ++ .lcd_power = NULL, ++ .backlight_power = NULL, ++ ++ .pixclock = 34576, ++ .xres = 640, ++ .yres = 480, ++ ++ .bpp = 32, ++ ++ .hsync_len = 64, ++ .right_margin = 60 + 1, ++ .left_margin = 80 + 3, ++ ++ .vsync_len = 2, ++ .upper_margin = 54, ++ .lower_margin = 54, ++#if 0 ++ /* currently not used by driver! */ ++ .sync = ((0*FB_SYNC_HOR_HIGH_ACT) | ++ (0*FB_SYNC_VERT_HIGH_ACT) | ++ (1*FB_SYNC_OE_ACT_HIGH)), ++#else ++ .pcr = PCR_TFT | PCR_COLOR | PCR_PBSIZ_8 | ++ PCR_BPIX_18 | PCR_END_SEL | PCR_FLMPOL | PCR_LPPOL | PCR_SCLK_SEL, ++ .dmacr = 0x800a0078, ++#endif ++ .cmap_greyscale = 0, ++ .cmap_inverse = 0, ++ .cmap_static = 0, ++ ++ .fixed_screen_cpu = NULL, ++ }, { ++ //.fb_mode = "Xenarc_700_Y-16", ++ .init = stk5_gpio_lcdc_active, ++ .exit = stk5_gpio_lcdc_inactive, ++ .lcd_power = NULL, ++ .backlight_power = NULL, ++ ++ .pixclock = 34576, ++ .xres = 640, ++ .yres = 480, ++ ++ .bpp = 16, ++ ++ .hsync_len = 64, ++ .right_margin = 138 + 1, ++ .left_margin = 118 + 3, ++ ++ .vsync_len = 7, ++ .upper_margin = 44, ++ .lower_margin = 44, ++#if 0 ++ /* currently not used by driver! */ ++ .sync = ((0*FB_SYNC_HOR_HIGH_ACT) | ++ (0*FB_SYNC_VERT_HIGH_ACT) | ++ (1*FB_SYNC_OE_ACT_HIGH)), ++#else ++ .pcr = PCR_TFT | PCR_COLOR | PCR_PBSIZ_8 | ++ PCR_BPIX_16 | PCR_FLMPOL | PCR_LPPOL | PCR_SCLK_SEL, ++ .dmacr = 0x80040060, ++#endif ++ .cmap_greyscale = 0, ++ .cmap_inverse = 0, ++ .cmap_static = 0, ++ ++ .fixed_screen_cpu = NULL, ++ }, { ++ //.fb_mode = "SHARP LQ10D42-16", ++ .init = stk5_gpio_lcdc_active, ++ .exit = stk5_gpio_lcdc_inactive, ++ .lcd_power = NULL, ++ .backlight_power = NULL, ++ ++ .pixclock = 34576, ++ .xres = 640, ++ .yres = 480, ++ ++#ifdef USE_18BPP ++ .bpp = 32, ++#else ++ .bpp = 16, ++#endif ++ .hsync_len = 64, ++ .right_margin = 138 + 1, ++ .left_margin = 118 + 3, ++ ++ .vsync_len = 7, ++ .upper_margin = 28, ++ .lower_margin = 60, ++#if 0 ++ /* currently not used by driver! */ ++ .sync = ((0*FB_SYNC_HOR_HIGH_ACT) | ++ (0*FB_SYNC_VERT_HIGH_ACT) | ++ (1*FB_SYNC_OE_ACT_HIGH)), ++#else ++ .pcr = PCR_TFT | PCR_COLOR | PCR_PBSIZ_8 | ++#ifdef USE_18BPP ++ PCR_BPIX_18 | PCR_END_SEL | PCR_FLMPOL | PCR_LPPOL | PCR_SCLK_SEL, ++#else ++ PCR_BPIX_16 | PCR_FLMPOL | PCR_LPPOL | PCR_SCLK_SEL, ++#endif ++ .dmacr = 0x80040060, ++#endif ++ .cmap_greyscale = 0, ++ .cmap_inverse = 0, ++ .cmap_static = 0, ++ ++ .fixed_screen_cpu = NULL, ++ }, { ++ //.fb_mode = "SHARP LQ104V1DG61-16", ++ .init = stk5_gpio_lcdc_active, ++ .exit = stk5_gpio_lcdc_inactive, ++ .lcd_power = NULL, ++ .backlight_power = NULL, ++ ++ .pixclock = 40000, ++ .xres = 640, ++ .yres = 480, ++ ++#ifdef USE_18BPP ++ .bpp = 32, ++#else ++ .bpp = 16, ++#endif ++ .hsync_len = 32, ++ .right_margin = 32 + 1, ++ .left_margin = 0 + 3, ++ ++ .vsync_len = 35, ++ .upper_margin = 0, ++ .lower_margin = 0, ++#if 0 ++ /* currently not used by driver! */ ++ .sync = ((0*FB_SYNC_HOR_HIGH_ACT) | ++ (0*FB_SYNC_VERT_HIGH_ACT) | ++ (1*FB_SYNC_OE_ACT_HIGH)), ++#else ++ .pcr = PCR_TFT | PCR_COLOR | PCR_PBSIZ_8 | ++#ifdef USE_18BPP ++ PCR_BPIX_18 | PCR_END_SEL | PCR_FLMPOL | PCR_LPPOL | PCR_SCLK_SEL, ++#else ++ PCR_BPIX_16 | PCR_FLMPOL | PCR_LPPOL | PCR_CLKPOL | PCR_SCLK_SEL, ++#endif ++ .dmacr = 0x80040060, ++#endif ++ .cmap_greyscale = 0, ++ .cmap_inverse = 0, ++ .cmap_static = 0, ++ ++ .fixed_screen_cpu = NULL, ++ }, ++}; ++ ++static int __init karo_stk5_fb_register(void) ++{ ++ int ret; ++ ++ ret = mxc_register_device(&mxc_fb_device, &stk5_fb_data[0]); ++ if (ret != 0) { ++ DBG(0, "%s: Failed to register FB device: %d\n", __FUNCTION__, ret); ++ } ++ return ret; ++} ++#else ++static inline int karo_stk5_fb_register(void) ++{ ++ return 0; ++} ++#endif ++ ++#if defined(CONFIG_MMC_MXC) || defined(CONFIG_MMC_MXC_MODULE) ++/*! ++ * Resource definition for the SDHC1 ++ */ ++static struct resource stk5_sdhc1_resources[] = { ++ { ++ .start = MMC_SDHC1_BASE_ADDR, ++ .end = MMC_SDHC1_BASE_ADDR + SZ_4K - 1, ++ .flags = IORESOURCE_MEM, ++ }, { ++ .start = MXC_INT_SDHC1, ++ .end = MXC_INT_SDHC1, ++ .flags = IORESOURCE_IRQ, ++ }, { ++ .start = gpio_to_irq(4 * 32 + 4), ++ .end = gpio_to_irq(4 * 32 + 4), ++ .flags = IORESOURCE_IRQ, ++#if 0 ++ }, { ++ .name = "sdhc1", ++ .start = DMA_REQ_SDHC1, ++ .end = DMA_REQ_SDHC1, ++ .flags = IORESOURCE_DMA ++#endif ++ }, ++}; ++ ++static inline int stk5_mmc_get_irq(int id) ++{ ++ int irq; ++ ++ switch (id) { ++ case 0: ++ irq = stk5_sdhc1_resources[2].start; ++ break; ++ default: ++ BUG(); ++ } ++ return irq; ++} ++ ++static const char *stk5_mmc_irqdesc[] = { ++ "MMC card 0 detect", ++}; ++ ++static struct pad_desc stk5_sdhc_pads[] = { ++}; ++ ++static int stk5_mmc_init(struct device *dev, irqreturn_t (*mmc_detect_irq)(int, void *), ++ void *data) ++{ ++ int err; ++ int id = to_platform_device(dev)->id; ++ struct mmc_host *host = data; ++ int irq = stk5_mmc_get_irq(id); ++ ++ err = mxc_iomux_v3_setup_multiple_pads(stk5_sdhc_pads, ++ ARRAY_SIZE(stk5_sdhc_pads)); ++ if (err) { ++ return err; ++ } ++ ++ host->caps |= MMC_CAP_4_BIT_DATA; ++ ++ err = request_irq(irq, mmc_detect_irq, ++ IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING, ++ stk5_mmc_irqdesc[id], data); ++ if (err) { ++ printk(KERN_ERR "%s: MMC/SD: can't request MMC card detect IRQ %d\n", ++ __FUNCTION__, irq); ++ return err; ++ } ++ device_set_wakeup_capable(dev, 1); ++ ++ return 0; ++} ++ ++static void stk5_mmc_exit(struct device *dev, void *data) ++{ ++ int id = to_platform_device(dev)->id; ++ int irq = stk5_mmc_get_irq(id); ++ ++ free_irq(irq, data); ++ mxc_iomux_v3_release_multiple_pads(stk5_sdhc_pads, ++ ARRAY_SIZE(stk5_sdhc_pads)); ++} ++ ++#if 0 ++static int stk5_mmc_suspend(struct device *dev, pm_message_t state) ++{ ++ int id = to_platform_device(dev)->id; ++ int irq = stk5_mmc_get_irq(id); ++ ++ if (device_may_wakeup(dev)) { ++ DBG(0, "%s: Enabling IRQ %d wakeup\n", __FUNCTION__, irq); ++ return enable_irq_wake(irq); ++ } ++ return 0; ++} ++ ++static int stk5_mmc_resume(struct device *dev) ++{ ++ int id = to_platform_device(dev)->id; ++ int irq = stk5_mmc_get_irq(id); ++ ++ if (device_may_wakeup(dev)) { ++ DBG(0, "%s: Disabling IRQ %d wakeup\n", __FUNCTION__, irq); ++ return disable_irq_wake(irq); ++ } ++ return 0; ++} ++#endif ++ ++static struct imxmmc_platform_data stk5_sdhc1_data = { ++ //.ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34, ++ //.min_clk = 150000, ++ //.max_clk = 25000000, ++ //.detect_delay = 20, ++ .init = stk5_mmc_init, ++ .exit = stk5_mmc_exit, ++// .suspend = stk5_mmc_suspend, ++// .resume = stk5_mmc_resume, ++}; ++ ++static struct platform_device stk5_sdhc1_device = { ++ .name = "imx-mmc", ++ .id = 0, ++ .dev = { ++ .platform_data = &stk5_sdhc1_data, ++ }, ++ .num_resources = ARRAY_SIZE(stk5_sdhc1_resources), ++ .resource = stk5_sdhc1_resources, ++}; ++#endif ++ ++#if defined(CONFIG_SPI_MXC) || defined(CONFIG_SPI_MXC_MODULE) ++static struct resource mxcspi1_resources[] = { ++ { ++ .start = CSPI1_BASE_ADDR, ++ .end = CSPI1_BASE_ADDR + SZ_4K - 1, ++ .flags = IORESOURCE_MEM, ++ }, { ++ .start = MXC_INT_CSPI1, ++ .end = MXC_INT_CSPI1, ++ .flags = IORESOURCE_IRQ, ++ }, ++}; ++ ++static struct mxc_spi_master mxcspi1_data = { ++ .maxchipselect = 2, ++ .spi_version = 0, ++}; ++ ++static struct platform_device mxcspi1_device = { ++ .name = "mxc_spi", ++ .id = 0, ++ .dev = { ++ .platform_data = &mxcspi1_data, ++ }, ++ .num_resources = ARRAY_SIZE(mxcspi1_resources), ++ .resource = mxcspi1_resources, ++}; ++#endif // defined(CONFIG_SPI_MXC) || defined(CONFIG_SPI_MXC_MODULE) ++ ++#if defined(CONFIG_AC97_BUS) || defined(CONFIG_AC97_BUS_MODULE) ++static u64 stk5_dma_mask = ~0UL; ++ ++static struct pad_desc stk5_ac97_pads_on[] = { ++ MX25_PAD_VSTBY_ACK__GPIO_3_18, /* UCB1400 Reset */ ++ MX25_PAD_RW__AUD4_TXFS, ++ MX25_PAD_EB0__AUD4_TXD, ++ MX25_PAD_EB1__AUD4_RXD, ++ MX25_PAD_OE__AUD4_TXC, ++}; ++ ++static struct pad_desc stk5_ac97_pads_off[] = { ++ MX25_PAD_VSTBY_ACK__GPIO_3_18, /* UCB1400 Reset */ ++ MX25_PAD_RW__GPIO_3_25, ++ MX25_PAD_EB0__GPIO_2_12, ++ MX25_PAD_EB1__AUD4_RXD, ++ MX25_PAD_OE__AUD4_TXC, ++}; ++ ++static struct gpio_desc { ++ unsigned int gpio:7; ++ unsigned int dir:1; ++ unsigned int level:1; ++} stk5_ac97_gpios[] = { ++ /* configure the PHY strap pins to the correct values */ ++ { GPIO_PORTC | 18, 1, 0, }, ++ { GPIO_PORTC | 25, 1, 0, }, ++ { GPIO_PORTB | 12, 1, 0, }, ++}; ++ ++static int stk5_ac97_init(struct platform_device *dev) ++{ ++ int ret; ++ int i; ++ ++ DBG(0, "%s: \n", __FUNCTION__); ++ ++ ret = mxc_iomux_v3_setup_multiple_pads(stk5_ac97_pads_off, ++ ARRAY_SIZE(stk5_ac97_pads_off)); ++ if (ret == 0) { ++ for (i = 0; i < ARRAY_SIZE(stk5_ac97_gpios); i++) { ++ struct gpio_desc *pd = &stk5_ac97_gpios[i]; ++ ++ ret = gpio_request(pd->gpio, "AC97"); ++ if (ret < 0) { ++ DBG(0, "%s: Failed to request GPIO%d_%d: %d\n", ++ __FUNCTION__, pd->gpio / 32 + 1, pd->gpio % 32, ret); ++ goto rel_mux; ++ } ++ if (pd->dir) { ++ gpio_direction_output(pd->gpio, ++ pd->level); ++ } else { ++ gpio_direction_input(pd->gpio); ++ } ++ } ++ ++ ret = mxc_iomux_v3_setup_multiple_pads(stk5_ac97_pads_on, ++ ARRAY_SIZE(stk5_ac97_pads_on)); ++ if (ret != 0) { ++ goto rel_gpio; ++ } ++ udelay(1); ++ gpio_set_value(stk5_ac97_gpios[0].gpio, !stk5_ac97_gpios[0].level); ++ } ++ return ret; ++ ++ rel_mux: ++ mxc_iomux_v3_release_multiple_pads(stk5_ac97_gpios_off, ++ ARRAY_SIZE(stk5_ac97_gpios_off)); ++ rel_gpio: ++ while (--i >= 0) { ++ struct gpio_desc *pd = &stk5_ac97_gpios[i]; ++ int grp = pd->gpio / 32 + 1; ++ int ofs = pd->gpio % 32; ++ ++ DBG(0, "%s: Freeing GPIO%d_%d\n", __FUNCTION__, ++ grp, ofs); ++ gpio_free(pd->gpio); ++ } ++ return ret; ++} ++ ++static void stk5_ac97_exit(struct platform_device *dev) ++{ ++ int i; ++ ++ DBG(0, "%s: Releasing AC97 GPIO pins\n", __FUNCTION__); ++ ++ mxc_iomux_v3_release_multiple_pads(stk5_ac97_pads_on, ++ ARRAY_SIZE(stk5_ac97_pads_on)); ++ for (i = 0; i < ARRAY_SIZE(stk5_ac97_gpios); i++) { ++ struct gpio_desc *pd = &stk5_ac97_gpios[i]; ++ int grp = pd->gpio / 32 + 1; ++ int ofs = pd->gpio % 32; ++ ++ DBG(0, "%s: Freeing GPIO%d_%d\n", __FUNCTION__, ++ grp, ofs); ++ gpio_free(pd->gpio); ++ } ++} ++ ++static struct mxc_ac97_audio_ops stk5_ac97_ops = { ++ .init = stk5_ac97_init, ++ .exit = stk5_ac97_exit, ++ .startup = NULL, ++ .shutdown = NULL, ++ .suspend = NULL, ++ .resume = NULL, ++ .priv = NULL, ++}; ++ ++static struct platform_device ac97_device = { ++ .name = "mx25-ac97", ++ .id = -1, ++ .dev = { ++ .dma_mask = &stk5_dma_mask, ++ .coherent_dma_mask = ~0UL, ++ .platform_data = &stk5_ac97_ops, ++ }, ++}; ++#endif ++ ++static struct platform_dev_list { ++ struct platform_device *pdev; ++ int flag; ++} stk5_devices[] __initdata = { ++#if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE) ++ { .pdev = &stk5_led_device, .flag = -1, }, ++#endif ++#if defined(CONFIG_KEYBOARD_MXC) || defined(CONFIG_KEYBOARD_MXC_MODULE) ++ { .pdev = &stk5_keypad_device, .flag = 1, }, ++#endif ++#if defined(CONFIG_SPI_MXC) || defined(CONFIG_SPI_MXC_MODULE) ++ { .pdev = &mxcspi1_device, .flag = 1, }, ++#endif ++#if defined(CONFIG_AC97_BUS) || defined(CONFIG_AC97_BUS_MODULE) ++ { .pdev = &ac97_device, .flag = 1, }, ++#endif ++#if defined(CONFIG_MMC_MXC) || defined(CONFIG_MMC_MXC_MODULE) ++ { .pdev = &stk5_sdhc1_device, .flag = 1, }, ++#endif ++}; ++#define STK5_NUM_DEVICES ARRAY_SIZE(stk5_devices) ++ ++static __init int karo_stk5_board_init(void) ++{ ++ int ret; ++ int i; ++ ++ if (karo_get_board_type() != BOARD_KARO_STK5) { ++ return -ENODEV; ++ } ++ DBG(0, "%s: \n", __FUNCTION__); ++ ++ karo_stk5_serial_init(); ++ ++ dump_regs(); ++ ++ /* enable SSI1_INT (GPIO_3_15) for IRQ probing */ ++ set_irq_flags(gpio_to_irq(GPIO_PORTC | 15), IRQF_VALID | IRQF_PROBE); ++ ++ ret = karo_stk5_fb_register(); ++ if (ret) { ++ 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; ++ if (!stk5_devices[i].flag) { ++ DBG(0, "%s: Skipping platform device[%d] @ %p dev %p: %s\n", ++ __FUNCTION__, i, stk5_devices[i].pdev, &stk5_devices[i].pdev->dev, ++ stk5_devices[i].pdev->name); ++ continue; ++ } ++ DBG(0, "%s: Registering platform device[%d] @ %p dev %p: %s\n", ++ __FUNCTION__, i, stk5_devices[i].pdev, &stk5_devices[i].pdev->dev, ++ stk5_devices[i].pdev->name); ++ ret = platform_device_register(stk5_devices[i].pdev); ++ if (ret) { ++ printk(KERN_WARNING "%s: Failed to register platform_device[%d]: %s: %d\n", ++ __FUNCTION__, i, stk5_devices[i].pdev->name, ret); ++ } ++ } ++ DBG(0, "%s: Done\n", __FUNCTION__); ++ 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:59:19.000000000 +0200 +@@ -381,7 +381,7 @@ DEFINE_CLOCK(gpu2d_clk, 0, CCM_CGR3, 4 + .clk = &c, \ + }, + +-static struct clk_lookup lookups[] __initdata = { ++static struct clk_lookup lookups[] = { + _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:59:19.000000000 +0200 +@@ -516,7 +516,7 @@ DEFINE_CLOCK(ipg_clk, 0, NULL, + .clk = &c, \ + }, + +-static struct clk_lookup lookups[] __initdata = { ++static struct clk_lookup lookups[] = { + _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 18:01:59.000000000 +0200 +@@ -56,6 +56,9 @@ config ARCH_HAS_RNGA + bool + depends on ARCH_MXC + ++config ARCH_MXC_IOMUX_V2 ++ bool ++ + 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 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 + +-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 ++obj-$(CONFIG_ARCH_MXC_IOMUX_V2) += iomux-mx1-mx2.o dma-mx1-mx2.o ++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 18:02:13.000000000 +0200 +@@ -0,0 +1,17 @@ ++/* ++ * Copyright 2009 ++ * ++ * 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 ++ */ ++ ++#define UART1_ENABLED 1 ++#define UART2_ENABLED 1 ++#define UART3_ENABLED 1 ++/* 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 18:02:13.000000000 +0200 +@@ -0,0 +1,13 @@ ++/* ++ * Copyright 2009 ++ * ++ * 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 ++ */ ++ ++#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 18:02:05.000000000 +0200 +@@ -17,6 +17,7 @@ struct clk; + extern void mx1_map_io(void); + extern void mx21_map_io(void); + extern void mx27_map_io(void); ++extern void mx25_map_io(void); + extern void mx31_map_io(void); + extern void mx35_map_io(void); + extern void mxc_init_irq(void); +@@ -24,6 +25,7 @@ extern void mxc_timer_init(struct clk *t + extern int mx1_clocks_init(unsigned long fref); + extern int mx21_clocks_init(unsigned long lref, unsigned long fref); + extern int mx27_clocks_init(unsigned long fref); ++extern int mx25_clocks_init(unsigned long fref); + 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 18:02:13.000000000 +0200 +@@ -0,0 +1,259 @@ ++/* ++ * Copyright 2004-2008 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_DMA_H__ ++#define __ASM_ARCH_MXC_DMA_H__ ++ ++#include ++ ++#define MXC_DMA_DYNAMIC_CHANNEL 255 ++ ++#define MXC_DMA_DONE 0x0 ++#define MXC_DMA_REQUEST_TIMEOUT 0x1 ++#define MXC_DMA_TRANSFER_ERROR 0x2 ++ ++/*! This defines the list of device ID's for DMA */ ++typedef enum mxc_dma_device { ++ MXC_DMA_UART1_RX, ++ MXC_DMA_UART1_TX, ++ MXC_DMA_UART2_RX, ++ MXC_DMA_UART2_TX, ++ MXC_DMA_UART3_RX, ++ MXC_DMA_UART3_TX, ++ MXC_DMA_UART4_RX, ++ MXC_DMA_UART4_TX, ++ MXC_DMA_UART5_RX, ++ MXC_DMA_UART5_TX, ++ MXC_DMA_UART6_RX, ++ MXC_DMA_UART6_TX, ++ MXC_DMA_MMC1_WIDTH_1, ++ MXC_DMA_MMC1_WIDTH_4, ++ MXC_DMA_MMC2_WIDTH_1, ++ MXC_DMA_MMC2_WIDTH_4, ++ MXC_DMA_SSI1_8BIT_RX0, ++ MXC_DMA_SSI1_8BIT_TX0, ++ MXC_DMA_SSI1_16BIT_RX0, ++ MXC_DMA_SSI1_16BIT_TX0, ++ MXC_DMA_SSI1_24BIT_RX0, ++ MXC_DMA_SSI1_24BIT_TX0, ++ MXC_DMA_SSI1_8BIT_RX1, ++ MXC_DMA_SSI1_8BIT_TX1, ++ MXC_DMA_SSI1_16BIT_RX1, ++ MXC_DMA_SSI1_16BIT_TX1, ++ MXC_DMA_SSI1_24BIT_RX1, ++ MXC_DMA_SSI1_24BIT_TX1, ++ MXC_DMA_SSI2_8BIT_RX0, ++ MXC_DMA_SSI2_8BIT_TX0, ++ MXC_DMA_SSI2_16BIT_RX0, ++ MXC_DMA_SSI2_16BIT_TX0, ++ MXC_DMA_SSI2_24BIT_RX0, ++ MXC_DMA_SSI2_24BIT_TX0, ++ MXC_DMA_SSI2_8BIT_RX1, ++ MXC_DMA_SSI2_8BIT_TX1, ++ MXC_DMA_SSI2_16BIT_RX1, ++ MXC_DMA_SSI2_16BIT_TX1, ++ MXC_DMA_SSI2_24BIT_RX1, ++ MXC_DMA_SSI2_24BIT_TX1, ++ MXC_DMA_FIR_RX, ++ MXC_DMA_FIR_TX, ++ MXC_DMA_CSPI1_RX, ++ MXC_DMA_CSPI1_TX, ++ MXC_DMA_CSPI2_RX, ++ MXC_DMA_CSPI2_TX, ++ MXC_DMA_CSPI3_RX, ++ MXC_DMA_CSPI3_TX, ++ MXC_DMA_ATA_RX, ++ MXC_DMA_ATA_TX, ++ MXC_DMA_MEMORY, ++ MXC_DMA_FIFO_MEMORY, ++ MXC_DMA_DSP_PACKET_DATA0_RD, ++ MXC_DMA_DSP_PACKET_DATA0_WR, ++ MXC_DMA_DSP_PACKET_DATA1_RD, ++ MXC_DMA_DSP_PACKET_DATA1_WR, ++ MXC_DMA_DSP_LOG0_CHNL, ++ MXC_DMA_DSP_LOG1_CHNL, ++ MXC_DMA_DSP_LOG2_CHNL, ++ MXC_DMA_DSP_LOG3_CHNL, ++ MXC_DMA_CSI_RX, ++ MXC_DMA_SPDIF_16BIT_TX, ++ MXC_DMA_SPDIF_16BIT_RX, ++ MXC_DMA_SPDIF_32BIT_TX, ++ MXC_DMA_SPDIF_32BIT_RX, ++ MXC_DMA_ASRC_A_RX, ++ MXC_DMA_ASRC_A_TX, ++ MXC_DMA_ASRC_B_RX, ++ MXC_DMA_ASRC_B_TX, ++ MXC_DMA_ASRC_C_RX, ++ MXC_DMA_ASRC_C_TX, ++ MXC_DMA_ESAI_16BIT_RX, ++ MXC_DMA_ESAI_16BIT_TX, ++ MXC_DMA_ESAI_24BIT_RX, ++ MXC_DMA_ESAI_24BIT_TX, ++ MXC_DMA_TEST_RAM2D2RAM, ++ MXC_DMA_TEST_RAM2RAM2D, ++ MXC_DMA_TEST_RAM2D2RAM2D, ++ MXC_DMA_TEST_RAM2RAM, ++ MXC_DMA_TEST_HW_CHAINING, ++ MXC_DMA_TEST_SW_CHAINING ++} mxc_dma_device_t; ++ ++/*! This defines the prototype of callback funtion registered by the drivers */ ++typedef void (*mxc_dma_callback_t) (void *arg, int error_status, ++ unsigned int count); ++ ++/*! This defines the type of DMA transfer requested */ ++typedef enum mxc_dma_mode { ++ MXC_DMA_MODE_READ, ++ MXC_DMA_MODE_WRITE, ++} mxc_dma_mode_t; ++ ++/*! This defines the DMA channel parameters */ ++typedef struct mxc_dma_channel { ++ unsigned int active:1; /*!< When there has a active tranfer, it is set to 1 */ ++ unsigned int lock; /*!< Defines the channel is allocated or not */ ++ int curr_buf; /*!< Current buffer */ ++ mxc_dma_mode_t mode; /*!< Read or Write */ ++ unsigned int channel; /*!< Channel info */ ++ unsigned int dynamic:1; /*!< Channel not statically allocated when 1 */ ++ char *dev_name; /*!< Device name */ ++ void *private; /*!< Private structure for platform */ ++ mxc_dma_callback_t cb_fn; /*!< The callback function */ ++ void *cb_args; /*!< The argument of callback function */ ++} mxc_dma_channel_t; ++ ++/*! This structure contains the information about a dma transfer */ ++typedef struct mxc_dma_requestbuf { ++ dma_addr_t src_addr; /*!< source address */ ++ dma_addr_t dst_addr; /*!< destination address */ ++ int num_of_bytes; /*!< the length of this transfer : bytes */ ++} mxc_dma_requestbuf_t; ++ ++/*! ++ * This function is generally called by the driver at open time. ++ * The DMA driver would do any initialization steps that is required ++ * to get the channel ready for data transfer. ++ * ++ * @param channel_id a pre-defined id. The peripheral driver would specify ++ * the id associated with its peripheral. This would be ++ * used by the DMA driver to identify the peripheral ++ * requesting DMA and do the necessary setup on the ++ * channel associated with the particular peripheral. ++ * The DMA driver could use static or dynamic DMA channel ++ * allocation. ++ * @param dev_name module name or device name ++ * @return returns a negative number on error if request for a DMA channel did not ++ * succeed, returns the channel number to be used on success. ++ */ ++extern int mxc_dma_request(mxc_dma_device_t channel_id, char *dev_name); ++ ++/*! ++ * This function is generally called by the driver at close time. The DMA ++ * driver would do any cleanup associated with this channel. ++ * ++ * @param channel_num the channel number returned at request time. This ++ * would be used by the DMA driver to identify the calling ++ * driver and do the necessary cleanup on the channel ++ * associated with the particular peripheral ++ * @return returns a negative number on error or 0 on success ++ */ ++extern int mxc_dma_free(int channel_num); ++ ++/*! ++ * This function would just configure the buffers specified by the user into ++ * dma channel. The caller must call mxc_dma_enable to start this transfer. ++ * ++ * @param channel_num the channel number returned at request time. This ++ * would be used by the DMA driver to identify the calling ++ * driver and do the necessary cleanup on the channel ++ * associated with the particular peripheral ++ * @param dma_buf an array of physical addresses to the user defined ++ * buffers. The caller must guarantee the dma_buf is ++ * available until the transfer is completed. ++ * @param num_buf number of buffers in the array ++ * @param mode specifies whether this is READ or WRITE operation ++ * @return This function returns a negative number on error if buffer could not be ++ * added with DMA for transfer. On Success, it returns 0 ++ */ ++extern int mxc_dma_config(int channel_num, mxc_dma_requestbuf_t * dma_buf, ++ int num_buf, mxc_dma_mode_t mode); ++ ++/*! ++ * This function would just configure the scatterlist specified by the ++ * user into dma channel. This is a slight variation of mxc_dma_config(), ++ * it is provided for the convenience of drivers that have a scatterlist ++ * passed into them. It is the calling driver's responsibility to have the ++ * correct physical address filled in the "dma_address" field of the ++ * scatterlist. ++ * ++ * @param channel_num the channel number returned at request time. This ++ * would be used by the DMA driver to identify the calling ++ * driver and do the necessary cleanup on the channel ++ * associated with the particular peripheral ++ * @param sg a scatterlist of buffers. The caller must guarantee ++ * the dma_buf is available until the transfer is ++ * completed. ++ * @param num_buf number of buffers in the array ++ * @param num_of_bytes total number of bytes to transfer. If set to 0, this ++ * would imply to use the length field of the scatterlist ++ * for each DMA transfer. Else it would calculate the size ++ * for each DMA transfer. ++ * @param mode specifies whether this is READ or WRITE operation ++ * @return This function returns a negative number on error if buffer could not ++ * be added with DMA for transfer. On Success, it returns 0 ++ */ ++extern int mxc_dma_sg_config(int channel_num, struct scatterlist *sg, ++ int num_buf, int num_of_bytes, ++ mxc_dma_mode_t mode); ++ ++/*! ++ * This function is provided if the driver would like to set/change its ++ * callback function. ++ * ++ * @param channel_num the channel number returned at request time. This ++ * would be used by the DMA driver to identify the calling ++ * driver and do the necessary cleanup on the channel ++ * associated with the particular peripheral ++ * @param callback a callback function to provide notification on transfer ++ * completion, user could specify NULL if he does not wish ++ * to be notified ++ * @param arg an argument that gets passed in to the callback ++ * function, used by the user to do any driver specific ++ * operations. ++ * @return this function returns a negative number on error if the callback ++ * could not be set for the channel or 0 on success ++ */ ++extern int mxc_dma_callback_set(int channel_num, mxc_dma_callback_t callback, ++ void *arg); ++ ++/*! ++ * This stops the DMA channel and any ongoing transfers. Subsequent use of ++ * mxc_dma_enable() will restart the channel and restart the transfer. ++ * ++ * @param channel_num the channel number returned at request time. This ++ * would be used by the DMA driver to identify the calling ++ * driver and do the necessary cleanup on the channel ++ * associated with the particular peripheral ++ * @return returns a negative number on error or 0 on success ++ */ ++extern int mxc_dma_disable(int channel_num); ++ ++/*! ++ * This starts DMA transfer. Or it restarts DMA on a stopped channel ++ * previously stopped with mxc_dma_disable(). ++ * ++ * @param channel_num the channel number returned at request time. This ++ * would be used by the DMA driver to identify the calling ++ * driver and do the necessary cleanup on the channel ++ * associated with the particular peripheral ++ * @return returns a negative number on error or 0 on success ++ */ ++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 18:02:06.000000000 +0200 +@@ -29,13 +29,18 @@ + #endif + + #ifdef CONFIG_ARCH_MX2 ++#ifndef CONFIG_MACH_MX25 + # include ++#endif + # ifdef CONFIG_MACH_MX21 + # include + # endif + # ifdef CONFIG_MACH_MX27 + # include + # endif ++# ifdef CONFIG_MACH_MX25 ++# include ++# endif + #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 18:02:06.000000000 +0200 +@@ -13,7 +13,8 @@ + #define PCR_BPIX_4 (2 << 25) + #define PCR_BPIX_8 (3 << 25) + #define PCR_BPIX_12 (4 << 25) +-#define PCR_BPIX_16 (4 << 25) ++#define PCR_BPIX_16 (5 << 25) ++#define PCR_BPIX_18 (6 << 25) + #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 18:02:13.000000000 +0200 +@@ -0,0 +1,905 @@ ++/* ++ * arch/arm/plat-mxc/include/mach/iomux-mx25.h ++ * ++ * Copyright (C) 2009 by Lothar Wassmann ++ * ++ * based on arch/arm/mach-mx25/mx25_pins.h ++ * Copyright 2008 Freescale Semiconductor, Inc. All Rights Reserved. ++ * and ++ * arch/arm/plat-mxc/include/mach/iomux-mx35.h ++ * Copyright (C, NO_PAD_CTRL) 2009 by Jan Weitzel Phytec Messtechnik GmbH ++ * ++ * 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 __IOMUX_MX25_H__ ++#define __IOMUX_MX25_H__ ++ ++#include ++ ++/* ++ * ++ * @brief MX25 I/O Pin List ++ * ++ * @ingroup GPIO_MX25 ++ */ ++ ++#ifndef __ASSEMBLY__ ++ ++/* ++ * 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 IOMUX_TO_GPIO(__pad_desc) ({ \ ++ int __gpio = -1; \ ++ struct pad_desc *__pd = __pad_desc; \ ++ \ ++ switch (__pd->mux_ctrl_ofs) { \ ++ case MX25_PAD_GPIO_A__GPIO_A: \ ++ __gpio = GPIO_A; \ ++ break; \ ++ case MX25_PAD_GPIO_B__GPIO_B: \ ++ __gpio = GPIO_B; \ ++ break; \ ++ case MX25_PAD_GPIO_C__GPIO_C: \ ++ __gpio = GPIO_C; \ ++ break; \ ++ case MX25_PAD_GPIO_D__GPIO_D: \ ++ __gpio = GPIO_D; \ ++ break; \ ++ case MX25_PAD_GPIO_E__GPIO_E: \ ++ __gpio = GPIO_E; \ ++ break; \ ++ case MX25_PAD_GPIO_F__GPIO_F: \ ++ __gpio = GPIO_F; \ ++ break; \ ++ case MX25_PAD_CSI_D7__GPIO_1_6: \ ++ __gpio = GPIO_1_6; \ ++ break; \ ++ case MX25_PAD_CSI_D8__GPIO_1_7: \ ++ __gpio = GPIO_1_7; \ ++ break; \ ++ case MX25_PAD_CSI_MCLK__GPIO_1_8: \ ++ __gpio = GPIO_1_8; \ ++ break; \ ++ case MX25_PAD_CSI_VSYNC__GPIO_1_9: \ ++ __gpio = GPIO_1_9; \ ++ break; \ ++ case MX25_PAD_CSI_HSYNC__GPIO_1_10: \ ++ __gpio = GPIO_1_10; \ ++ break; \ ++ case MX25_PAD_CSI_PIXCLK__GPIO_1_11: \ ++ __gpio = GPIO_1_11; \ ++ break; \ ++ case MX25_PAD_I2C1_CLK__GPIO_1_12: \ ++ __gpio = GPIO_1_12; \ ++ break; \ ++ case MX25_PAD_I2C1_DAT__GPIO_1_13: \ ++ __gpio = GPIO_1_13; \ ++ break; \ ++ case MX25_PAD_CSPI1_MOSI__GPIO_1_14: \ ++ __gpio = GPIO_1_14; \ ++ break; \ ++ case MX25_PAD_CSPI1_MISO__GPIO_1_15: \ ++ __gpio = GPIO_1_15; \ ++ break; \ ++ case MX25_PAD_CSPI1_SS0__GPIO_1_16: \ ++ __gpio = GPIO_1_16; \ ++ break; \ ++ case MX25_PAD_CSPI1_SS1__GPIO_1_17: \ ++ __gpio = GPIO_1_17; \ ++ break; \ ++ case MX25_PAD_CSPI1_SCLK__GPIO_1_18: \ ++ __gpio = GPIO_1_18; \ ++ break; \ ++ case MX25_PAD_LD5__GPIO_1_19: \ ++ __gpio = GPIO_1_19; \ ++ break; \ ++ case MX25_PAD_LD6__GPIO_1_20: \ ++ __gpio = GPIO_1_20; \ ++ break; \ ++ case MX25_PAD_LD7__GPIO_1_21: \ ++ __gpio = GPIO_1_21; \ ++ break; \ ++ case MX25_PAD_HSYNC__GPIO_1_22: \ ++ __gpio = GPIO_1_22; \ ++ break; \ ++ case MX25_PAD_VSYNC__GPIO_1_23: \ ++ __gpio = GPIO_1_23; \ ++ break; \ ++ case MX25_PAD_LSCLK__GPIO_1_24: \ ++ __gpio = GPIO_1_24; \ ++ break; \ ++ case MX25_PAD_OE_ACD__GPIO_1_25: \ ++ __gpio = GPIO_1_25; \ ++ break; \ ++ case MX25_PAD_PWM__GPIO_1_26: \ ++ __gpio = GPIO_1_26; \ ++ break; \ ++ case MX25_PAD_CSI_D2__GPIO_1_27: \ ++ __gpio = GPIO_1_27; \ ++ break; \ ++ case MX25_PAD_CSI_D3__GPIO_1_28: \ ++ __gpio = GPIO_1_28; \ ++ break; \ ++ case MX25_PAD_CSI_D4__GPIO_1_29: \ ++ __gpio = GPIO_1_29; \ ++ break; \ ++ case MX25_PAD_CSI_D5__GPIO_1_30: \ ++ __gpio = GPIO_1_30; \ ++ break; \ ++ case MX25_PAD_CSI_D6__GPIO_1_31: \ ++ __gpio = GPIO_1_31; \ ++ break; \ ++ \ ++ case MX25_PAD_A14__GPIO_2_0: \ ++ __gpio = GPIO_2_0; \ ++ break; \ ++ case MX25_PAD_A15__GPIO_2_1: \ ++ __gpio = GPIO_2_1; \ ++ break; \ ++ case MX25_PAD_A16__GPIO_2_2: \ ++ __gpio = GPIO_2_2; \ ++ break; \ ++ case MX25_PAD_A17__GPIO_2_3: \ ++ __gpio = GPIO_2_3; \ ++ break; \ ++ case MX25_PAD_A18__GPIO_2_4: \ ++ __gpio = GPIO_2_4; \ ++ break; \ ++ case MX25_PAD_A19__GPIO_2_5: \ ++ __gpio = GPIO_2_5; \ ++ break; \ ++ case MX25_PAD_A20__GPIO_2_6: \ ++ __gpio = GPIO_2_6; \ ++ break; \ ++ case MX25_PAD_A21__GPIO_2_7: \ ++ __gpio = GPIO_2_7; \ ++ break; \ ++ case MX25_PAD_A22__GPIO_2_8: \ ++ __gpio = GPIO_2_8; \ ++ break; \ ++ case MX25_PAD_A23__GPIO_2_9: \ ++ __gpio = GPIO_2_9; \ ++ break; \ ++ case MX25_PAD_A24__GPIO_2_10: \ ++ __gpio = GPIO_2_10; \ ++ break; \ ++ case MX25_PAD_A25__GPIO_2_11: \ ++ __gpio = GPIO_2_11; \ ++ break; \ ++ case MX25_PAD_EB0__GPIO_2_12: \ ++ __gpio = GPIO_2_12; \ ++ break; \ ++ case MX25_PAD_EB1__GPIO_2_13: \ ++ __gpio = GPIO_2_13; \ ++ break; \ ++ case MX25_PAD_OE__GPIO_2_14: \ ++ __gpio = GPIO_2_14; \ ++ break; \ ++ case MX25_PAD_LD0__GPIO_2_15: \ ++ __gpio = GPIO_2_15; \ ++ break; \ ++ case MX25_PAD_LD1__GPIO_2_16: \ ++ __gpio = GPIO_2_16; \ ++ break; \ ++ case MX25_PAD_LD2__GPIO_2_17: \ ++ __gpio = GPIO_2_17; \ ++ break; \ ++ case MX25_PAD_LD3__GPIO_2_18: \ ++ __gpio = GPIO_2_18; \ ++ break; \ ++ case MX25_PAD_LD4__GPIO_2_19: \ ++ __gpio = GPIO_2_19; \ ++ break; \ ++ case MX25_PAD_DE_B__GPIO_2_20: \ ++ __gpio = GPIO_2_20; \ ++ break; \ ++ case MX25_PAD_CLKO__GPIO_2_21: \ ++ __gpio = GPIO_2_21; \ ++ break; \ ++ case MX25_PAD_CSPI1_RDY__GPIO_2_22: \ ++ __gpio = GPIO_2_22; \ ++ break; \ ++ case MX25_PAD_SD1_CMD__GPIO_2_23: \ ++ __gpio = GPIO_2_23; \ ++ break; \ ++ case MX25_PAD_SD1_CLK__GPIO_2_24: \ ++ __gpio = GPIO_2_24; \ ++ break; \ ++ case MX25_PAD_SD1_DATA0__GPIO_2_25: \ ++ __gpio = GPIO_2_25; \ ++ break; \ ++ case MX25_PAD_SD1_DATA1__GPIO_2_26: \ ++ __gpio = GPIO_2_26; \ ++ break; \ ++ case MX25_PAD_SD1_DATA2__GPIO_2_27: \ ++ __gpio = GPIO_2_27; \ ++ break; \ ++ case MX25_PAD_SD1_DATA3__GPIO_2_28: \ ++ __gpio = GPIO_2_28; \ ++ break; \ ++ case MX25_PAD_KPP_ROW0__GPIO_2_29: \ ++ __gpio = GPIO_2_29; \ ++ break; \ ++ case MX25_PAD_KPP_ROW1__GPIO_2_30: \ ++ __gpio = GPIO_2_30; \ ++ break; \ ++ case MX25_PAD_KPP_ROW2__GPIO_2_31: \ ++ __gpio = GPIO_2_31; \ ++ break; \ ++ \ ++ case MX25_PAD_KPP_ROW3__GPIO_3_0: \ ++ __gpio = GPIO_3_0; \ ++ break; \ ++ case MX25_PAD_KPP_COL0__GPIO_3_1: \ ++ __gpio = GPIO_3_1; \ ++ break; \ ++ case MX25_PAD_KPP_COL1__GPIO_3_2: \ ++ __gpio = GPIO_3_2; \ ++ break; \ ++ case MX25_PAD_KPP_COL2__GPIO_3_3: \ ++ __gpio = GPIO_3_3; \ ++ break; \ ++ case MX25_PAD_KPP_COL3__GPIO_3_4: \ ++ __gpio = GPIO_3_4; \ ++ break; \ ++ case MX25_PAD_FEC_MDC__GPIO_3_5: \ ++ __gpio = GPIO_3_5; \ ++ break; \ ++ case MX25_PAD_FEC_MDIO__GPIO_3_6: \ ++ __gpio = GPIO_3_6; \ ++ break; \ ++ case MX25_PAD_FEC_TDATA0__GPIO_3_7: \ ++ __gpio = GPIO_3_7; \ ++ break; \ ++ case MX25_PAD_FEC_TDATA1__GPIO_3_8: \ ++ __gpio = GPIO_3_8; \ ++ break; \ ++ case MX25_PAD_FEC_TX_EN__GPIO_3_9: \ ++ __gpio = GPIO_3_9; \ ++ break; \ ++ case MX25_PAD_FEC_RDATA0__GPIO_3_10: \ ++ __gpio = GPIO_3_10; \ ++ break; \ ++ case MX25_PAD_FEC_RDATA1__GPIO_3_11: \ ++ __gpio = GPIO_3_11; \ ++ break; \ ++ case MX25_PAD_FEC_RX_DV__GPIO_3_12: \ ++ __gpio = GPIO_3_12; \ ++ break; \ ++ case MX25_PAD_FEC_TX_CLK__GPIO_3_13: \ ++ __gpio = GPIO_3_13; \ ++ break; \ ++ case MX25_PAD_RTCK__GPIO_3_14: \ ++ __gpio = GPIO_3_14; \ ++ break; \ ++ case MX25_PAD_EXT_ARMCLK__GPIO_3_15: \ ++ __gpio = GPIO_3_15; \ ++ break; \ ++ case MX25_PAD_UPLL_BYPCLK__GPIO_3_16: \ ++ __gpio = GPIO_3_16; \ ++ break; \ ++ case MX25_PAD_VSTBY_REQ__GPIO_3_17: \ ++ __gpio = GPIO_3_17; \ ++ break; \ ++ case MX25_PAD_VSTBY_ACK__GPIO_3_18: \ ++ __gpio = GPIO_3_18; \ ++ break; \ ++ case MX25_PAD_POWER_FAIL__GPIO_3_19: \ ++ __gpio = GPIO_3_19; \ ++ break; \ ++ case MX25_PAD_CS4__GPIO_3_20: \ ++ __gpio = GPIO_3_20; \ ++ break; \ ++ case MX25_PAD_CS5__GPIO_3_21: \ ++ __gpio = GPIO_3_21; \ ++ break; \ ++ case MX25_PAD_NF_CE0__GPIO_3_22: \ ++ __gpio = GPIO_3_22; \ ++ break; \ ++ case MX25_PAD_ECB__GPIO_3_23: \ ++ __gpio = GPIO_3_23; \ ++ break; \ ++ case MX25_PAD_LBA__GPIO_3_24: \ ++ __gpio = GPIO_3_24; \ ++ break; \ ++ case MX25_PAD_RW__GPIO_3_25: \ ++ __gpio = GPIO_3_25; \ ++ break; \ ++ case MX25_PAD_NFWE_B__GPIO_3_26: \ ++ __gpio = GPIO_3_26; \ ++ break; \ ++ case MX25_PAD_NFRE_B__GPIO_3_27: \ ++ __gpio = GPIO_3_27; \ ++ break; \ ++ case MX25_PAD_NFALE__GPIO_3_28: \ ++ __gpio = GPIO_3_28; \ ++ break; \ ++ case MX25_PAD_NFCLE__GPIO_3_29: \ ++ __gpio = GPIO_3_29; \ ++ break; \ ++ case MX25_PAD_NFWP_B__GPIO_3_30: \ ++ __gpio = GPIO_3_30; \ ++ break; \ ++ case MX25_PAD_NFRB__GPIO_3_31: \ ++ __gpio = GPIO_3_31; \ ++ break; \ ++ \ ++ case MX25_PAD_A10__GPIO_4_0: \ ++ __gpio = GPIO_4_0; \ ++ break; \ ++ case MX25_PAD_A13__GPIO_4_1: \ ++ __gpio = GPIO_4_1; \ ++ break; \ ++ case MX25_PAD_CS0__GPIO_4_2: \ ++ __gpio = GPIO_4_2; \ ++ break; \ ++ case MX25_PAD_CS1__GPIO_4_3: \ ++ __gpio = GPIO_4_3; \ ++ break; \ ++ case MX25_PAD_BCLK__GPIO_4_4: \ ++ __gpio = GPIO_4_4; \ ++ break; \ ++ case MX25_PAD_D15__GPIO_4_5: \ ++ __gpio = GPIO_4_5; \ ++ break; \ ++ case MX25_PAD_D14__GPIO_4_6: \ ++ __gpio = GPIO_4_6; \ ++ break; \ ++ case MX25_PAD_D13__GPIO_4_7: \ ++ __gpio = GPIO_4_7; \ ++ break; \ ++ case MX25_PAD_D12__GPIO_4_8: \ ++ __gpio = GPIO_4_8; \ ++ break; \ ++ case MX25_PAD_D11__GPIO_4_9: \ ++ __gpio = GPIO_4_9; \ ++ break; \ ++ case MX25_PAD_D10__GPIO_4_10: \ ++ __gpio = GPIO_4_10; \ ++ break; \ ++ case MX25_PAD_D9__GPIO_4_11: \ ++ __gpio = GPIO_4_11; \ ++ break; \ ++ case MX25_PAD_D8__GPIO_4_12: \ ++ __gpio = GPIO_4_12; \ ++ break; \ ++ case MX25_PAD_D7__GPIO_4_13: \ ++ __gpio = GPIO_4_13; \ ++ break; \ ++ case MX25_PAD_D6__GPIO_4_14: \ ++ __gpio = GPIO_4_14; \ ++ break; \ ++ case MX25_PAD_D5__GPIO_4_15: \ ++ __gpio = GPIO_4_15; \ ++ break; \ ++ case MX25_PAD_D4__GPIO_4_16: \ ++ __gpio = GPIO_4_16; \ ++ break; \ ++ case MX25_PAD_D3__GPIO_4_17: \ ++ __gpio = GPIO_4_17; \ ++ break; \ ++ case MX25_PAD_D2__GPIO_4_18: \ ++ __gpio = GPIO_4_18; \ ++ break; \ ++ case MX25_PAD_D1__GPIO_4_19: \ ++ __gpio = GPIO_4_19; \ ++ break; \ ++ case MX25_PAD_D0__GPIO_4_20: \ ++ __gpio = GPIO_4_20; \ ++ break; \ ++ case MX25_PAD_CSI_D9__GPIO_4_21: \ ++ __gpio = GPIO_4_21; \ ++ break; \ ++ case MX25_PAD_UART1_RXD__GPIO_4_22: \ ++ __gpio = GPIO_4_22; \ ++ break; \ ++ case MX25_PAD_UART1_TXD__GPIO_4_23: \ ++ __gpio = GPIO_4_23; \ ++ break; \ ++ case MX25_PAD_UART1_RTS__GPIO_4_24: \ ++ __gpio = GPIO_4_24; \ ++ break; \ ++ case MX25_PAD_UART1_CTS__GPIO_4_25: \ ++ __gpio = GPIO_4_25; \ ++ break; \ ++ case MX25_PAD_UART2_RXD__GPIO_4_26: \ ++ __gpio = GPIO_4_26; \ ++ break; \ ++ case MX25_PAD_UART2_TXD__GPIO_4_27: \ ++ __gpio = GPIO_4_27; \ ++ break; \ ++ case MX25_PAD_UART2_RTS__GPIO_4_28: \ ++ __gpio = GPIO_4_28; \ ++ break; \ ++ case MX25_PAD_UART2_CTS__GPIO_4_29: \ ++ __gpio = GPIO_4_29; \ ++ break; \ ++ case MX25_PAD_BOOT_MODE0__GPIO_4_30: \ ++ __gpio = GPIO_4_30; \ ++ break; \ ++ case MX25_PAD_BOOT_MODE1__GPIO_4_31: \ ++ __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 18:02:08.000000000 +0200 +@@ -54,7 +54,7 @@ struct pad_desc { + unsigned select_input:3; + }; + +-#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 { + /* + * 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_DRIVE_VOLTAGE_3_3_V (0 << 13) ++#define PAD_CTL_DRIVE_VOLTAGE_1_8_V (1 << 13) + +-#define PAD_CTL_NO_HYSTERESIS 0 +-#define PAD_CTL_HYSTERESIS 1 ++#define PAD_CTL_NO_HYSTERESIS (0 << 8) ++#define PAD_CTL_HYSTERESIS (1 << 8) + +-#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_PULL_DISABLED (0x0 << 4) ++#define PAD_CTL_PULL_KEEPER (0x8 << 4) ++#define PAD_CTL_PULL_DOWN_100K (0xc << 4) ++#define PAD_CTL_PULL_UP_47K (0xd << 4) ++#define PAD_CTL_PULL_UP_100K (0xe << 4) ++#define PAD_CTL_PULL_UP_22K (0xf << 4) ++ ++#define PAD_CTL_OUTPUT_CMOS (0 << 3) ++#define PAD_CTL_OUTPUT_OPEN_DRAIN (1 << 3) ++ ++#define PAD_CTL_DRIVE_STRENGTH_NORM (0 << 1) ++#define PAD_CTL_DRIVE_STRENGTH_HIGH (1 << 1) ++#define PAD_CTL_DRIVE_STRENGTH_MAX (2 << 1) + +-#define PAD_CTL_SLEW_RATE_SLOW 0 +-#define PAD_CTL_SLEW_RATE_FAST 1 ++#define PAD_CTL_SLEW_RATE_SLOW (0 << 0) ++#define PAD_CTL_SLEW_RATE_FAST (1 << 0) + + /* + * 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 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 + */ ++#ifndef CONFIG_MACH_MX25 + #define VA_GPIO_BASE IO_ADDRESS(GPIO_BASE_ADDR) ++#endif + #define MXC_DDIR(x) (0x00 + ((x) << 8)) ++#ifndef CONFIG_MACH_MX25 + #define MXC_OCR1(x) (0x04 + ((x) << 8)) + #define MXC_OCR2(x) (0x08 + ((x) << 8)) ++#endif + #define MXC_ICONFA1(x) (0x0c + ((x) << 8)) + #define MXC_ICONFA2(x) (0x10 + ((x) << 8)) + #define MXC_ICONFB1(x) (0x14 + ((x) << 8)) +@@ -96,16 +100,20 @@ + + + #ifdef CONFIG_ARCH_MX1 +-#include ++# include + #endif + #ifdef CONFIG_ARCH_MX2 +-#include +-#ifdef CONFIG_MACH_MX21 +-#include +-#endif +-#ifdef CONFIG_MACH_MX27 +-#include +-#endif ++# ifndef CONFIG_MACH_MX25 ++# include ++# ifdef CONFIG_MACH_MX21 ++# include ++# endif ++# endif ++# ifdef CONFIG_MACH_MX27 ++# include ++# else ++# include ++# endif + #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 18:02:09.000000000 +0200 +@@ -21,7 +21,11 @@ + #if defined CONFIG_ARCH_MX1 + #define MXC_GPIO_IRQS (32 * 4) + #elif defined CONFIG_ARCH_MX2 ++#ifndef CONFIG_MACH_MX25 + #define MXC_GPIO_IRQS (32 * 6) ++#else ++#define MXC_GPIO_IRQS (32 * 4) ++#endif + #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 18:02:09.000000000 +0200 +@@ -14,12 +14,13 @@ + #if defined CONFIG_ARCH_MX1 + #define PHYS_OFFSET UL(0x08000000) + #elif defined CONFIG_ARCH_MX2 +-#ifdef CONFIG_MACH_MX21 ++# if defined(CONFIG_MACH_MX21) + #define PHYS_OFFSET UL(0xC0000000) +-#endif +-#ifdef CONFIG_MACH_MX27 ++# elif defined(CONFIG_MACH_MX27) + #define PHYS_OFFSET UL(0xA0000000) +-#endif ++# elif defined(CONFIG_MACH_MX25) ++#define PHYS_OFFSET UL(0x80000000) ++# endif + #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 18:02:13.000000000 +0200 +@@ -0,0 +1,482 @@ ++/* ++ * Copyright 2008-2009 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 ++ */ ++ ++/*! ++ * @file arch-mxc/mx25.h ++ * @brief This file contains register definitions. ++ * ++ * @ingroup MSL_MX25 ++ */ ++ ++#ifndef __ASM_ARCH_MXC_MX25_H__ ++#define __ASM_ARCH_MXC_MX25_H__ ++ ++#ifndef __ASM_ARCH_MXC_HARDWARE_H__ ++#error "Do not include directly." ++#endif ++ ++#ifdef CONFIG_DEBUG_LL ++#ifdef CONFIG_MACH_TX25 ++#include ++#endif ++#endif // CONFIG_DEBUG_LL ++ ++/* ++ * MX25 memory map: ++ * ++ * Virt Phys Size What ++ * --------------------------------------------------------------------------- ++ * FC000000 43F00000 1M AIPS 1 ++ * FC100000 50000000 1M SPBA ++ * FC200000 53F00000 1M AIPS 2 ++ * FC300000 60000000 1M ROMPATCH (128M) ++ * FC400000 68000000 1M ASIC (128M) ++ * FC500000 78000000 128K FBC RAM (IRAM) ++ * 80000000 256M SDRAM0 ++ * 90000000 256M SDRAM1 ++ * A0000000 128M CS0 Flash ++ * A8000000 128M CS1 Flash ++ * B0000000 32M CS2 SRAM ++ * B2000000 32M CS3 ++ * B4000000 32M CS4 ++ * B6000000 32M CS5 ++ * FC520000 B8000000 64K SDRAM, WEIM, M3IF, EMI controllers ++ * FC530000 BB000000 8K NFC ++ */ ++ ++#include ++#define VA(x) _AT(void __force __iomem *,x) ++ ++/* ++ * IRAM ++ */ ++#define IRAM_BASE_ADDR UL(0x78000000) /* internal ram */ ++#define IRAM_BASE_ADDR_VIRT VA(0xFC500000) ++#define IRAM_SIZE SZ_128K ++ ++/* ++ * AIPS 1 ++ */ ++#define AIPS1_BASE_ADDR UL(0x43F00000) ++#define AIPS1_BASE_ADDR_VIRT VA(0xFC000000) ++#define AIPS1_SIZE SZ_1M ++ ++#define MAX_BASE_ADDR (AIPS1_BASE_ADDR + 0x00004000) ++#define CLKCTL_BASE_ADDR (AIPS1_BASE_ADDR + 0x00008000) ++#define ETB_SLOT4_BASE_ADDR (AIPS1_BASE_ADDR + 0x0000C000) ++#define ETB_SLOT5_BASE_ADDR (AIPS1_BASE_ADDR + 0x00010000) ++#define AAPE_BASE_ADDR (AIPS1_BASE_ADDR + 0x00014000) ++#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 UART1_BASE_ADDR (AIPS1_BASE_ADDR + 0x00090000) ++#define UART2_BASE_ADDR (AIPS1_BASE_ADDR + 0x00094000) ++#define I2C2_BASE_ADDR (AIPS1_BASE_ADDR + 0x00098000) ++#define OWIRE_BASE_ADDR (AIPS1_BASE_ADDR + 0x0009C000) ++#define ATA_BASE_ADDR (AIPS1_BASE_ADDR + 0x000A0000) ++#define CSPI1_BASE_ADDR (AIPS1_BASE_ADDR + 0x000A4000) ++#define KPP_BASE_ADDR (AIPS1_BASE_ADDR + 0x000A8000) ++#define IOMUXC_BASE_ADDR (AIPS1_BASE_ADDR + 0x000AC000) ++#define AUDMUX_BASE_ADDR (AIPS1_BASE_ADDR + 0x000B0000) ++#define ECT_A_BASE_ADDR (AIPS1_BASE_ADDR + 0x000B8000) ++#define ECT_B_BASE_ADDR (AIPS1_BASE_ADDR + 0x000BC000) ++ ++/* ++ * SPBA global module enabled #0 ++ */ ++#define SPBA0_BASE_ADDR UL(0x50000000) ++#define SPBA0_BASE_ADDR_VIRT VA(0xFC100000) ++#define SPBA0_SIZE SZ_1M ++ ++#define CSPI3_BASE_ADDR (SPBA0_BASE_ADDR + 0x00004000) ++#define UART4_BASE_ADDR (SPBA0_BASE_ADDR + 0x00008000) ++#define UART3_BASE_ADDR (SPBA0_BASE_ADDR + 0x0000C000) ++#define CSPI2_BASE_ADDR (SPBA0_BASE_ADDR + 0x00010000) ++#define SSI2_BASE_ADDR (SPBA0_BASE_ADDR + 0x00014000) ++#define ESAI_BASE_ADDR (SPBA0_BASE_ADDR + 0x00018000) ++#define ATA_DMA_BASE_ADDR (SPBA0_BASE_ADDR + 0x00020000) ++#define SIM1_BASE_ADDR (SPBA0_BASE_ADDR + 0x00024000) ++#define SIM2_BASE_ADDR (SPBA0_BASE_ADDR + 0x00028000) ++#define UART5_BASE_ADDR (SPBA0_BASE_ADDR + 0x0002C000) ++#define TSC_BASE_ADDR (SPBA0_BASE_ADDR + 0x00030000) ++#define SSI1_BASE_ADDR (SPBA0_BASE_ADDR + 0x00034000) ++#define FEC_BASE_ADDR (SPBA0_BASE_ADDR + 0x00038000) ++#define SPBA_CTRL_BASE_ADDR (SPBA0_BASE_ADDR + 0x0003C000) ++ ++/*! ++ * defines for SPBA modules ++ */ ++#define SPBA_CSPI3 (0x1 << 2) ++#define SPBA_UART4 (0x2 << 2) ++#define SPBA_UART3 (0x3 << 2) ++#define SPBA_CSPI2 (0x4 << 2) ++#define SPBA_SSI2 (0x5 << 2) ++#define SPBA_ESAI (0x6 << 2) ++#define SPBA_ATA (0x8 << 2) ++#define SPBA_SIM1 (0x9 << 2) ++#define SPBA_SIM2 (0xA << 2) ++#define SPBA_UART5 (0xB << 2) ++#define SPBA_ANALOG (0xC << 2) ++#define SPBA_SSI1 (0xD << 2) ++#define SPBA_FEC (0xE << 2) ++ ++/*! ++ * Defines for modules using static and dynamic DMA channels ++ */ ++#define MXC_DMA_CHANNEL_IRAM 30 ++#define MXC_DMA_CHANNEL_UART1_RX MXC_DMA_DYNAMIC_CHANNEL ++#define MXC_DMA_CHANNEL_UART1_TX MXC_DMA_DYNAMIC_CHANNEL ++#define MXC_DMA_CHANNEL_UART2_RX MXC_DMA_DYNAMIC_CHANNEL ++#define MXC_DMA_CHANNEL_UART2_TX MXC_DMA_DYNAMIC_CHANNEL ++#define MXC_DMA_CHANNEL_UART3_RX MXC_DMA_DYNAMIC_CHANNEL ++#define MXC_DMA_CHANNEL_UART3_TX MXC_DMA_DYNAMIC_CHANNEL ++#define MXC_DMA_CHANNEL_UART4_RX MXC_DMA_DYNAMIC_CHANNEL ++#define MXC_DMA_CHANNEL_UART4_TX MXC_DMA_DYNAMIC_CHANNEL ++#define MXC_DMA_CHANNEL_UART5_RX MXC_DMA_DYNAMIC_CHANNEL ++#define MXC_DMA_CHANNEL_UART5_TX MXC_DMA_DYNAMIC_CHANNEL ++#define MXC_DMA_CHANNEL_MMC1 MXC_DMA_DYNAMIC_CHANNEL ++#define MXC_DMA_CHANNEL_SSI1_RX MXC_DMA_DYNAMIC_CHANNEL ++#ifdef CONFIG_SDMA_IRAM ++#define MXC_DMA_CHANNEL_SSI1_TX (MXC_DMA_CHANNEL_IRAM + 1) ++#else ++#define MXC_DMA_CHANNEL_SSI1_TX MXC_DMA_DYNAMIC_CHANNEL ++#endif ++#define MXC_DMA_CHANNEL_SSI2_RX MXC_DMA_DYNAMIC_CHANNEL ++#define MXC_DMA_CHANNEL_SSI2_TX MXC_DMA_DYNAMIC_CHANNEL ++#define MXC_DMA_CHANNEL_CSPI1_RX MXC_DMA_DYNAMIC_CHANNEL ++#define MXC_DMA_CHANNEL_CSPI1_TX MXC_DMA_DYNAMIC_CHANNEL ++#define MXC_DMA_CHANNEL_CSPI2_RX MXC_DMA_DYNAMIC_CHANNEL ++#define MXC_DMA_CHANNEL_CSPI2_TX MXC_DMA_DYNAMIC_CHANNEL ++#define MXC_DMA_CHANNEL_CSPI3_RX MXC_DMA_DYNAMIC_CHANNEL ++#define MXC_DMA_CHANNEL_CSPI3_TX MXC_DMA_DYNAMIC_CHANNEL ++#define MXC_DMA_CHANNEL_ATA_RX MXC_DMA_DYNAMIC_CHANNEL ++#define MXC_DMA_CHANNEL_ATA_TX MXC_DMA_DYNAMIC_CHANNEL ++#define MXC_DMA_CHANNEL_MEMORY MXC_DMA_DYNAMIC_CHANNEL ++#define MXC_DMA_CHANNEL_ESAI_RX MXC_DMA_DYNAMIC_CHANNEL ++#define MXC_DMA_CHANNEL_ESAI_TX MXC_DMA_DYNAMIC_CHANNEL ++ ++/* ++ * AIPS 2 ++ */ ++#define AIPS2_BASE_ADDR UL(0x53F00000) ++#define AIPS2_BASE_ADDR_VIRT VA(0xFC200000) ++#define AIPS2_SIZE SZ_1M ++ ++#define CCM_BASE_ADDR (AIPS2_BASE_ADDR + 0x00080000) ++#define GPT4_BASE_ADDR (AIPS2_BASE_ADDR + 0x00084000) ++#define GPT3_BASE_ADDR (AIPS2_BASE_ADDR + 0x00088000) ++#define GPT2_BASE_ADDR (AIPS2_BASE_ADDR + 0x0008C000) ++#define GPT1_BASE_ADDR (AIPS2_BASE_ADDR + 0x00090000) ++#define EPIT1_BASE_ADDR (AIPS2_BASE_ADDR + 0x00094000) ++#define EPIT2_BASE_ADDR (AIPS2_BASE_ADDR + 0x00098000) ++#define GPIO4_BASE_ADDR (AIPS2_BASE_ADDR + 0x0009C000) ++#define PWM2_BASE_ADDR (AIPS2_BASE_ADDR + 0x000A0000) ++#define GPIO3_BASE_ADDR (AIPS2_BASE_ADDR + 0x000A4000) ++#define PWM3_BASE_ADDR (AIPS2_BASE_ADDR + 0x000A8000) ++#define SCC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000AC000) ++#define RNGD_BASE_ADDR (AIPS2_BASE_ADDR + 0x000B0000) ++#define MMC_SDHC1_BASE_ADDR (AIPS2_BASE_ADDR + 0x000B4000) ++#define MMC_SDHC2_BASE_ADDR (AIPS2_BASE_ADDR + 0x000B8000) ++#define LCDC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000BC000) ++#define SLCDC_BASE_ADDR (AIPS2_BASE_ADDR + 0x000C0000) ++#define PWM4_BASE_ADDR (AIPS2_BASE_ADDR + 0x000C8000) ++#define GPIO1_BASE_ADDR (AIPS2_BASE_ADDR + 0x000CC000) ++#define GPIO2_BASE_ADDR (AIPS2_BASE_ADDR + 0x000D0000) ++#define SDMA_BASE_ADDR (AIPS2_BASE_ADDR + 0x000D4000) ++#define WDOG_BASE_ADDR (AIPS2_BASE_ADDR + 0x000DC000) ++#define PWM1_BASE_ADDR (AIPS2_BASE_ADDR + 0x000E0000) ++#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 CSI_BASE_ADDR (AIPS2_BASE_ADDR + 0x000F8000) ++#define DRYICE_BASE_ADDR (AIPS2_BASE_ADDR + 0x000FC000) ++ ++/* ++ * ROMP and ASIC ++ */ ++#define ROMP_BASE_ADDR UL(0x60000000) ++#define ROMP_BASE_ADDR_VIRT VA(0xFC300000) ++#define ROMP_SIZE SZ_1M ++ ++#define ASIC_BASE_ADDR UL(0x68000000) ++#define ASIC_BASE_ADDR_VIRT VA(0xFC400000) ++#define ASIC_SIZE SZ_1M ++#define AVIC_BASE_ADDR ASIC_BASE_ADDR ++#define AVIC_BASE_ADDR_VIRT ASIC_BASE_ADDR_VIRT ++#define AVIC_SIZE ASIC_SIZE ++ ++/* ++ * SDRAM, WEIM, M3IF, EMI controllers ++ */ ++#define X_MEMC_BASE_ADDR UL(0xB8000000) ++#define X_MEMC_BASE_ADDR_VIRT VA(0xFC520000) ++#define X_MEMC_SIZE SZ_64K ++ ++#define SDRAMC_BASE_ADDR (X_MEMC_BASE_ADDR + 0x1000) ++#define WEIM_BASE_ADDR (X_MEMC_BASE_ADDR + 0x2000) ++#define M3IF_BASE_ADDR (X_MEMC_BASE_ADDR + 0x3000) ++#define EMI_CTL_BASE_ADDR (X_MEMC_BASE_ADDR + 0x4000) ++ ++/* ++ * NFC controller ++ */ ++#define NFC_BASE_ADDR UL(0xBB000000) ++#define NFC_BASE_ADDR_VIRT VA(0xFC530000) ++#define NFC_SIZE SZ_8K ++ ++/* ++ * Memory regions and CS ++ */ ++#define CSD0_BASE_ADDR UL(0x80000000) ++#define CSD1_BASE_ADDR UL(0x90000000) ++ ++#define SDRAM_BASE_ADDR CSD0_BASE_ADDR ++ ++#define CS0_BASE_ADDR UL(0xA0000000) ++#define CS1_BASE_ADDR UL(0xA8000000) ++#define CS2_BASE_ADDR UL(0xB0000000) ++#define CS3_BASE_ADDR UL(0xB2000000) ++#define CS4_BASE_ADDR UL(0xB4000000) ++#define CS4_SIZE SZ_32M ++#define CS5_BASE_ADDR UL(0xB6000000) ++#define CS5_SIZE SZ_32M ++ ++/*! ++ * 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 ++ * and returning the virtual address. If the physical address is not mapped, ++ * it returns 0 ++ */ ++#define IO_ADDRESS(x) \ ++ VA((((x) >= AIPS1_BASE_ADDR) && ((x) < (AIPS1_BASE_ADDR + AIPS1_SIZE))) ? AIPS1_IO_ADDRESS(x): \ ++ (((x) >= SPBA0_BASE_ADDR) && ((x) < (SPBA0_BASE_ADDR + SPBA0_SIZE))) ? SPBA0_IO_ADDRESS(x): \ ++ (((x) >= AIPS2_BASE_ADDR) && ((x) < (AIPS2_BASE_ADDR + AIPS2_SIZE))) ? AIPS2_IO_ADDRESS(x): \ ++ (((x) >= ROMP_BASE_ADDR) && ((x) < (ROMP_BASE_ADDR + ROMP_SIZE))) ? ROMP_IO_ADDRESS(x): \ ++ (((x) >= ASIC_BASE_ADDR) && ((x) < (ASIC_BASE_ADDR + AVIC_SIZE))) ? ASIC_IO_ADDRESS(x): \ ++ (((x) >= IRAM_BASE_ADDR) && ((x) < (IRAM_BASE_ADDR + IRAM_SIZE))) ? IRAM_IO_ADDRESS(x): \ ++ (((x) >= X_MEMC_BASE_ADDR) && ((x) < (X_MEMC_BASE_ADDR + X_MEMC_SIZE))) ? X_MEMC_IO_ADDRESS(x): \ ++ (((x) >= NFC_BASE_ADDR) && ((x) < (NFC_BASE_ADDR + NFC_SIZE))) ? NFC_IO_ADDRESS(x): \ ++ 0) ++ ++#define MXC_VADDR_RANGE(v,n) \ ++ (((v)) >= n##_BASE_ADDR_VIRT) && \ ++ (((v)) < n##_BASE_ADDR_VIRT + n##_SIZE) ? \ ++ ((v)-n##_BASE_ADDR_VIRT + n##_BASE_ADDR) : ++ ++#define MXC_PHYS_ADDRESS(v) \ ++ UL(MXC_VADDR_RANGE(v,AIPS1) \ ++ MXC_VADDR_RANGE(v,AIPS2) \ ++ MXC_VADDR_RANGE(v,SPBA0) \ ++ MXC_VADDR_RANGE(v,ROMP) \ ++ MXC_VADDR_RANGE(v,ASIC) \ ++ MXC_VADDR_RANGE(v,IRAM) \ ++ MXC_VADDR_RANGE(v,X_MEMC) \ ++ MXC_VADDR_RANGE(v,NFC) \ ++ 0) ++ ++#define GPIO_BASE_ADDR(port) \ ++ ((port == 1 ? GPIO1_BASE_ADDR : \ ++ (port == 2 ? GPIO2_BASE_ADDR : \ ++ (port == 3 ? GPIO3_BASE_ADDR : \ ++ (port == 4 ? GPIO4_BASE_ADDR : 0))))) ++ ++/* ++ * define the address mapping macros: in physical address order ++ */ ++ ++#define AIPS1_IO_ADDRESS(x) \ ++ (((x) - AIPS1_BASE_ADDR) + AIPS1_BASE_ADDR_VIRT) ++ ++#define SPBA0_IO_ADDRESS(x) \ ++ (((x) - SPBA0_BASE_ADDR) + SPBA0_BASE_ADDR_VIRT) ++ ++#define AIPS2_IO_ADDRESS(x) \ ++ (((x) - AIPS2_BASE_ADDR) + AIPS2_BASE_ADDR_VIRT) ++ ++#define ROMP_IO_ADDRESS(x) \ ++ (((x) - ROMP_BASE_ADDR) + ROMP_BASE_ADDR_VIRT) ++ ++#define ASIC_IO_ADDRESS(x) \ ++ (((x) - ASIC_BASE_ADDR) + ASIC_BASE_ADDR_VIRT) ++ ++/* for entry-macro.S */ ++#define AVIC_IO_ADDRESS(x) ASIC_IO_ADDRESS(x) ++ ++#define IRAM_IO_ADDRESS(x) \ ++ (((x) - IRAM_BASE_ADDR) + IRAM_BASE_ADDR_VIRT) ++ ++#define X_MEMC_IO_ADDRESS(x) \ ++ (((x) - X_MEMC_BASE_ADDR) + X_MEMC_BASE_ADDR_VIRT) ++ ++#define NFC_IO_ADDRESS(x) \ ++ (((x) - NFC_BASE_ADDR) + NFC_BASE_ADDR_VIRT) ++ ++/* ++ * DMA request assignments ++ */ ++#define DMA_REQ_EXTREQ0 0 ++#define DMA_REQ_CCM 1 ++#define DMA_REQ_ATA_TX_END 2 ++#define DMA_REQ_ATA_TX 3 ++#define DMA_REQ_ATA_RX 4 ++#define DMA_REQ_CSPI2_RX 6 ++#define DMA_REQ_CSPI2_TX 7 ++#define DMA_REQ_CSPI1_RX 8 ++#define DMA_REQ_CSPI1_TX 9 ++#define DMA_REQ_UART3_RX 10 ++#define DMA_REQ_UART3_TX 11 ++#define DMA_REQ_UART4_RX 12 ++#define DMA_REQ_UART4_TX 13 ++#define DMA_REQ_EXTREQ1 14 ++#define DMA_REQ_EXTREQ2 15 ++#define DMA_REQ_UART2_RX 16 ++#define DMA_REQ_UART2_TX 17 ++#define DMA_REQ_UART1_RX 18 ++#define DMA_REQ_UART1_TX 19 ++#define DMA_REQ_SSI2_RX1 22 ++#define DMA_REQ_SSI2_TX1 23 ++#define DMA_REQ_SSI2_RX0 24 ++#define DMA_REQ_SSI2_TX0 25 ++#define DMA_REQ_SSI1_RX1 26 ++#define DMA_REQ_SSI1_TX1 27 ++#define DMA_REQ_SSI1_RX0 28 ++#define DMA_REQ_SSI1_TX0 29 ++#define DMA_REQ_NFC 30 ++#define DMA_REQ_ECT 31 ++#define DMA_REQ_ESAI_RX 32 ++#define DMA_REQ_ESAI_TX 33 ++#define DMA_REQ_CSPI3_RX 34 ++#define DMA_REQ_CSPI3_TX 35 ++#define DMA_REQ_SIM2_RX 36 ++#define DMA_REQ_SIM2_TX 37 ++#define DMA_REQ_SIM1_RX 38 ++#define DMA_REQ_SIM1_TX 39 ++#define DMA_REQ_TSC_GCQ 44 ++#define DMA_REQ_TSC_TCQ 45 ++#define DMA_REQ_UART5_RX 46 ++#define DMA_REQ_UART5_TX 47 ++ ++/* ++ * Interrupt numbers ++ */ ++#define MXC_INT_CSPI3 0 ++#define MXC_INT_GPT4 1 ++#define MXC_INT_OWIRE 2 ++#define MXC_INT_I2C 3 ++#define MXC_INT_I2C2 4 ++#define MXC_INT_UART4 5 ++#define MXC_INT_RTIC 6 ++#define MXC_INT_ESAI 7 ++#define MXC_INT_SDHC2 8 ++#define MXC_INT_SDHC1 9 ++#define MXC_INT_I2C3 10 ++#define MXC_INT_SSI2 11 ++#define MXC_INT_SSI1 12 ++#define MXC_INT_CSPI2 13 ++#define MXC_INT_CSPI1 14 ++#define MXC_INT_ATA 15 ++#define MXC_INT_GPIO3 16 ++#define MXC_INT_CSI 17 ++#define MXC_INT_UART3 18 ++#define MXC_INT_IIM 19 ++#define MXC_INT_SIM1 20 ++#define MXC_INT_SIM2 21 ++#define MXC_INT_RNGD 22 ++#define MXC_INT_GPIO4 23 ++#define MXC_INT_KPP 24 ++#define MXC_INT_DRYICE_RTC 25 ++#define MXC_INT_PWM 26 ++#define MXC_INT_EPIT2 27 ++#define MXC_INT_EPIT1 28 ++#define MXC_INT_GPT3 29 ++#define MXC_INT_POWER_FAIL 30 ++#define MXC_INT_CRM 31 ++#define MXC_INT_UART2 32 ++#define MXC_INT_NANDFC 33 ++#define MXC_INT_SDMA 34 ++#define MXC_INT_USB_HTG 35 ++#define MXC_INT_PWM2 36 ++#define MXC_INT_USB_OTG 37 ++#define MXC_INT_SLCDC 38 ++#define MXC_INT_LCDC 39 ++#define MXC_INT_UART5 40 ++#define MXC_INT_PWM3 41 ++#define MXC_INT_PWM4 42 ++#define MXC_INT_CAN1 43 ++#define MXC_INT_CAN2 44 ++#define MXC_INT_UART1 45 ++#define MXC_INT_TSC 46 ++#define MXC_INT_ECT 48 ++#define MXC_INT_SCC_SCM 49 ++#define MXC_INT_SCC_SMN 50 ++#define MXC_INT_GPIO2 51 ++#define MXC_INT_GPIO1 52 ++#define MXC_INT_GPT2 53 ++#define MXC_INT_GPT1 54 ++#define MXC_INT_WDOG 55 ++#define MXC_INT_DRYICE 56 ++#define MXC_INT_FEC 57 ++#define MXC_INT_EXT_INT5 58 ++#define MXC_INT_EXT_INT4 59 ++#define MXC_INT_EXT_INT3 60 ++#define MXC_INT_EXT_INT2 61 ++#define MXC_INT_EXT_INT1 62 ++#define MXC_INT_EXT_INT0 63 ++ ++#define MXC_INT_GPT MXC_INT_GPT1 ++ ++/* silicon revisions specific to i.MX25 */ ++#define CHIP_REV_1_0 0x00 ++#define CHIP_REV_1_1 0x01 ++ ++/* gpio and gpio based interrupt handling */ ++#define GPIO_DR 0x00 ++#define GPIO_GDIR 0x04 ++#define GPIO_PSR 0x08 ++#define GPIO_ICR1 0x0C ++#define GPIO_ICR2 0x10 ++#define GPIO_IMR 0x14 ++#define GPIO_ISR 0x18 ++#define GPIO_INT_LOW_LEV 0x0 ++#define GPIO_INT_HIGH_LEV 0x1 ++#define GPIO_INT_RISE_EDGE 0x2 ++#define GPIO_INT_FALL_EDGE 0x3 ++#define GPIO_INT_NONE 0x4 ++ ++/* Mandatory defines used globally */ ++ ++/* this CPU supports up to 96 GPIOs */ ++#define ARCH_NR_GPIOS 128 ++ ++#define MXC_TIMER_GPT1 1 ++#define MXC_TIMER_GPT2 2 ++#define MXC_TIMER_GPT3 3 ++#define MXC_TIMER_GPT4 4 ++ ++/*! ++ * NFMS bit in RCSR register for pagesize of nandflash ++ */ ++#define NFMS_REG IO_ADDRESS(CCM_BASE_ADDR + 0x28) ++#define NFMS_NF_DWIDTH 14 ++#define NFMS_NF_PG_SZ 8 ++ ++#if !defined(__ASSEMBLY__) && !defined(__MXC_BOOT_UNCOMPRESS) ++#include ++ ++extern int mx25_revision(void); ++ ++#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 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 + * and returning the virtual address. If the physical address is not mapped, +- * it returns 0xDEADBEEF ++ * it returns 0 + */ + #define IO_ADDRESS(x) \ + (void __force __iomem *) \ +@@ -88,7 +88,7 @@ + ((x >= SAHB1_BASE_ADDR) && (x < (SAHB1_BASE_ADDR + SAHB1_SIZE))) ? \ + SAHB1_IO_ADDRESS(x) : \ + ((x >= X_MEMC_BASE_ADDR) && (x < (X_MEMC_BASE_ADDR + X_MEMC_SIZE))) ? \ +- X_MEMC_IO_ADDRESS(x) : 0xDEADBEEF) ++ X_MEMC_IO_ADDRESS(x) : 0) + + /* 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 18:02:12.000000000 +0200 +@@ -27,6 +27,7 @@ + #define MXC_CPU_MX1 1 + #define MXC_CPU_MX21 21 + #define MXC_CPU_MX27 27 ++#define MXC_CPU_MX25 25 + #define MXC_CPU_MX31 31 + #define MXC_CPU_MX35 35 + +@@ -70,6 +71,18 @@ extern unsigned int __mxc_cpu_type; + # define cpu_is_mx27() (0) + #endif + ++#ifdef CONFIG_MACH_MX25 ++# ifdef mxc_cpu_type ++# undef mxc_cpu_type ++# define mxc_cpu_type __mxc_cpu_type ++# else ++# define mxc_cpu_type MXC_CPU_MX25 ++# endif ++# define cpu_is_mx25() (mxc_cpu_type == MXC_CPU_MX25) ++#else ++# define cpu_is_mx25() (0) ++#endif ++ + #ifdef CONFIG_ARCH_MX31 + # ifdef mxc_cpu_type + # undef mxc_cpu_type +@@ -101,6 +114,6 @@ extern unsigned int __mxc_cpu_type; + #endif + + #define cpu_is_mx3() (cpu_is_mx31() || cpu_is_mx35()) +-#define cpu_is_mx2() (cpu_is_mx21() || cpu_is_mx27()) ++#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 18:02:13.000000000 +0200 +@@ -0,0 +1,504 @@ ++ ++/* ++ * Copyright 2004-2008 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_SDMA_H__ ++#define __ASM_ARCH_MXC_SDMA_H__ ++ ++/*! ++ * @defgroup SDMA Smart Direct Memory Access (SDMA) Driver ++ */ ++ ++/*! ++ * @file arch-mxc/sdma.h ++ * ++ * @brief This file contains the SDMA API declarations. ++ * ++ * SDMA is responsible on moving data between peripherals and memories (MCU, EMI and DSP). ++ * ++ * @ingroup SDMA ++ */ ++ ++#include ++#include ++#include ++#include ++ ++/*! ++ * This defines maximum DMA address ++ */ ++#define MAX_DMA_ADDRESS 0xffffffff ++ ++/*! ++ * This defines maximum number of DMA channels ++ */ ++#ifdef CONFIG_MXC_SDMA_API ++#define MAX_DMA_CHANNELS 32 ++#define MAX_BD_NUMBER 16 ++#define MXC_SDMA_DEFAULT_PRIORITY 1 ++#define MXC_SDMA_MIN_PRIORITY 1 ++#define MXC_SDMA_MAX_PRIORITY 7 ++#else ++#define MAX_DMA_CHANNELS 0 ++#endif ++ ++#define MXC_FIFO_MEM_DEST_FIXED 0x1 ++#define MXC_FIFO_MEM_SRC_FIXED 0x2 ++/*! ++ * This enumerates transfer types ++ */ ++typedef enum { ++ emi_2_per = 0, /*!< EMI memory to peripheral */ ++ emi_2_int, /*!< EMI memory to internal RAM */ ++ emi_2_emi, /*!< EMI memory to EMI memory */ ++ emi_2_dsp, /*!< EMI memory to DSP memory */ ++ per_2_int, /*!< Peripheral to internal RAM */ ++ per_2_emi, /*!< Peripheral to internal EMI memory */ ++ per_2_dsp, /*!< Peripheral to DSP memory */ ++ per_2_per, /*!< Peripheral to Peripheral */ ++ int_2_per, /*!< Internal RAM to peripheral */ ++ int_2_int, /*!< Internal RAM to Internal RAM */ ++ int_2_emi, /*!< Internal RAM to EMI memory */ ++ int_2_dsp, /*!< Internal RAM to DSP memory */ ++ dsp_2_per, /*!< DSP memory to peripheral */ ++ dsp_2_int, /*!< DSP memory to internal RAM */ ++ dsp_2_emi, /*!< DSP memory to EMI memory */ ++ dsp_2_dsp, /*!< DSP memory to DSP memory */ ++ emi_2_dsp_loop, /*!< EMI memory to DSP memory loopback */ ++ dsp_2_emi_loop, /*!< DSP memory to EMI memory loopback */ ++ dvfs_pll, /*!< DVFS script with PLL change */ ++ dvfs_pdr /*!< DVFS script without PLL change */ ++} sdma_transferT; ++ ++/*! ++ * This enumerates peripheral types ++ */ ++typedef enum { ++ SSI, /*!< MCU domain SSI */ ++ SSI_SP, /*!< Shared SSI */ ++ MMC, /*!< MMC */ ++ SDHC, /*!< SDHC */ ++ UART, /*!< MCU domain UART */ ++ UART_SP, /*!< Shared UART */ ++ FIRI, /*!< FIRI */ ++ CSPI, /*!< MCU domain CSPI */ ++ CSPI_SP, /*!< Shared CSPI */ ++ SIM, /*!< SIM */ ++ ATA, /*!< ATA */ ++ CCM, /*!< CCM */ ++ EXT, /*!< External peripheral */ ++ MSHC, /*!< Memory Stick Host Controller */ ++ MSHC_SP, /*!< Shared Memory Stick Host Controller */ ++ DSP, /*!< DSP */ ++ MEMORY, /*!< Memory */ ++ FIFO_MEMORY, /*!< FIFO type Memory */ ++ SPDIF, /*!< SPDIF */ ++ IPU_MEMORY, /*!< IPU Memory */ ++ ASRC, /*!< ASRC */ ++ ESAI, /*!< ESAI */ ++} sdma_periphT; ++ ++#ifndef TRANSFER_32BIT ++/*! ++ * This defines SDMA access data size ++ */ ++#define TRANSFER_32BIT 0x00 ++#define TRANSFER_8BIT 0x01 ++#define TRANSFER_16BIT 0x02 ++#define TRANSFER_24BIT 0x03 ++ ++#endif ++ ++/*! ++ * This defines maximum device name length passed during mxc_request_dma(). ++ */ ++#define MAX_DEVNAME_LENGTH 32 ++ ++/*! ++ * This defines SDMA interrupt callback function prototype. ++ */ ++typedef void (*dma_callback_t) (void *arg); ++ ++/*! ++ * Structure containing sdma channel parameters. ++ */ ++typedef struct { ++ __u32 watermark_level; /*!< Lower/upper threshold that ++ * triggers SDMA event ++ */ ++ __u32 per_address; /*!< Peripheral source/destination ++ * physical address ++ */ ++ sdma_periphT peripheral_type; /*!< Peripheral type */ ++ sdma_transferT transfer_type; /*!< Transfer type */ ++ int event_id; /*!< Event number, ++ * needed by all channels ++ * that started by peripherals dma ++ * request (per_2_*,*_2_per) ++ * Not used for memory and DSP ++ * transfers. ++ */ ++ int event_id2; /*!< Second event number, ++ * used in ATA scripts only. ++ */ ++ int bd_number; /*!< Buffer descriptors number. ++ * If not set, single buffer ++ * descriptor will be used. ++ */ ++ dma_callback_t callback; /*! callback function */ ++ void *arg; /*! callback argument */ ++ unsigned long word_size:8; /*!< SDMA data access word size */ ++} dma_channel_params; ++ ++/*! ++ * Structure containing sdma request parameters. ++ */ ++typedef struct { ++ /*! physical source memory address */ ++ __u8 *sourceAddr; ++ /*! physical destination memory address */ ++ __u8 *destAddr; ++ /*! amount of data to transfer, ++ * updated during mxc_dma_get_config ++ */ ++ __u16 count; ++ /*!< DONE bit of the buffer descriptor, ++ * updated during mxc_dma_get_config ++ * 0 - means the BD is done and closed by SDMA ++ * 1 - means the BD is still being processed by SDMA ++ */ ++ int bd_done; ++ /*!< CONT bit of the buffer descriptor, ++ * set it if full multi-buffer descriptor mechanism ++ * required. ++ */ ++ int bd_cont; ++ /*!< ERROR bit of the buffer descriptor, ++ * updated during mxc_dma_get_config. ++ * If it is set - there was an error during BD processing. ++ */ ++ int bd_error; ++} dma_request_t; ++ ++/*! ++ * Structure containing sdma request parameters. ++ */ ++typedef struct { ++ /*! address of ap_2_ap script */ ++ int mxc_sdma_ap_2_ap_addr; ++ /*! address of ap_2_bp script */ ++ int mxc_sdma_ap_2_bp_addr; ++ /*! address of ap_2_ap_fixed script */ ++ int mxc_sdma_ap_2_ap_fixed_addr; ++ /*! address of bp_2_ap script */ ++ int mxc_sdma_bp_2_ap_addr; ++ /*! address of loopback_on_dsp_side script */ ++ int mxc_sdma_loopback_on_dsp_side_addr; ++ /*! address of mcu_interrupt_only script */ ++ int mxc_sdma_mcu_interrupt_only_addr; ++ ++ /*! address of firi_2_per script */ ++ int mxc_sdma_firi_2_per_addr; ++ /*! address of firi_2_mcu script */ ++ int mxc_sdma_firi_2_mcu_addr; ++ /*! address of per_2_firi script */ ++ int mxc_sdma_per_2_firi_addr; ++ /*! address of mcu_2_firi script */ ++ int mxc_sdma_mcu_2_firi_addr; ++ ++ /*! address of uart_2_per script */ ++ int mxc_sdma_uart_2_per_addr; ++ /*! address of uart_2_mcu script */ ++ int mxc_sdma_uart_2_mcu_addr; ++ /*! address of per_2_app script */ ++ int mxc_sdma_per_2_app_addr; ++ /*! address of mcu_2_app script */ ++ int mxc_sdma_mcu_2_app_addr; ++ /*! address of per_2_per script */ ++ int mxc_sdma_per_2_per_addr; ++ ++ /*! address of uartsh_2_per script */ ++ int mxc_sdma_uartsh_2_per_addr; ++ /*! address of uartsh_2_mcu script */ ++ int mxc_sdma_uartsh_2_mcu_addr; ++ /*! address of per_2_shp script */ ++ int mxc_sdma_per_2_shp_addr; ++ /*! address of mcu_2_shp script */ ++ int mxc_sdma_mcu_2_shp_addr; ++ ++ /*! address of ata_2_mcu script */ ++ int mxc_sdma_ata_2_mcu_addr; ++ /*! address of mcu_2_ata script */ ++ int mxc_sdma_mcu_2_ata_addr; ++ ++ /*! address of app_2_per script */ ++ int mxc_sdma_app_2_per_addr; ++ /*! address of app_2_mcu script */ ++ int mxc_sdma_app_2_mcu_addr; ++ /*! address of shp_2_per script */ ++ int mxc_sdma_shp_2_per_addr; ++ /*! address of shp_2_mcu script */ ++ int mxc_sdma_shp_2_mcu_addr; ++ ++ /*! address of mshc_2_mcu script */ ++ int mxc_sdma_mshc_2_mcu_addr; ++ /*! address of mcu_2_mshc script */ ++ int mxc_sdma_mcu_2_mshc_addr; ++ ++ /*! address of spdif_2_mcu script */ ++ int mxc_sdma_spdif_2_mcu_addr; ++ /*! address of mcu_2_spdif script */ ++ int mxc_sdma_mcu_2_spdif_addr; ++ ++ /*! address of asrc_2_mcu script */ ++ int mxc_sdma_asrc_2_mcu_addr; ++ ++ /*! address of ext_mem_2_ipu script */ ++ int mxc_sdma_ext_mem_2_ipu_addr; ++ ++ /*! address of descrambler script */ ++ int mxc_sdma_descrambler_addr; ++ ++ /*! address of dptc_dvfs script */ ++ int mxc_sdma_dptc_dvfs_addr; ++ ++ int mxc_sdma_utra_addr; ++ ++ /*! address where ram code starts */ ++ int mxc_sdma_ram_code_start_addr; ++ /*! size of the ram code */ ++ int mxc_sdma_ram_code_size; ++ /*! RAM image address */ ++ unsigned short *mxc_sdma_start_addr; ++} sdma_script_start_addrs; ++ ++/*! Structure to store the initialized dma_channel parameters */ ++typedef struct mxc_sdma_channel_params { ++ /*! Channel params */ ++ dma_channel_params chnl_params; ++ /*! Channel type (static channel number or dynamic channel) */ ++ unsigned int channel_num; ++ /*! Channel priority [0x1(lowest) - 0x7(highest)] */ ++ unsigned int chnl_priority; ++} mxc_sdma_channel_params_t; ++ ++/*! Private SDMA data structure */ ++typedef struct mxc_dma_channel_private { ++ /*! ID of the buffer that was processed */ ++ unsigned int buf_tail; ++ /*! Tasklet for the channel */ ++ struct tasklet_struct chnl_tasklet; ++ /*! Flag indicates if interrupt is required after every BD transfer */ ++ int intr_after_every_bd; ++} mxc_dma_channel_private_t; ++ ++/*! ++ * Setup channel according to parameters. ++ * Must be called once after mxc_request_dma() ++ * ++ * @param channel channel number ++ * @param p channel parameters pointer ++ * @return 0 on success, error code on fail ++ */ ++int mxc_dma_setup_channel(int channel, dma_channel_params * p); ++ ++/*! ++ * Setup the channel priority. This can be used to change the default priority ++ * for the channel. ++ * ++ * @param channel channel number ++ * @param priority priority to be set for the channel ++ * ++ * @return 0 on success, error code on failure ++ */ ++int mxc_dma_set_channel_priority(unsigned int channel, unsigned int priority); ++ ++/*! ++ * Allocates dma channel. ++ * If channel's value is 0, then the function allocates a free channel ++ * dynamically and sets its value to channel. ++ * Else allocates requested channel if it is free. ++ * If the channel is busy or no free channels (in dynamic allocation) -EBUSY returned. ++ * ++ * @param channel pointer to channel number ++ * @param devicename device name ++ * @return 0 on success, error code on fail ++ */ ++int mxc_request_dma(int *channel, const char *devicename); ++ ++/*! ++ * Configures request parameters. Can be called multiple times after ++ * mxc_request_dma() and mxc_dma_setup_channel(). ++ * ++ * ++ * @param channel channel number ++ * @param p request parameters pointer ++ * @param bd_index index of buffer descriptor to set ++ * @return 0 on success, error code on fail ++ */ ++/* int mxc_dma_set_config(int channel, dma_request_t *p, int bd_index); */ ++int mxc_dma_set_config(int channel, dma_request_t * p, int bd_index); ++ ++/*! ++ * Returns request parameters. ++ * ++ * @param channel channel number ++ * @param p request parameters pointer ++ * @param bd_index index of buffer descriptor to get ++ * @return 0 on success, error code on fail ++ */ ++/* int mxc_dma_get_config(int channel, dma_request_t *p, int bd_index); */ ++int mxc_dma_get_config(int channel, dma_request_t * p, int bd_index); ++ ++/*! ++ * This function is used by MXC IPC's write_ex2. It passes the a pointer to the ++ * data control structure to iapi_write_ipcv2() ++ * ++ * @param channel SDMA channel number ++ * @param ctrl_ptr Data Control structure pointer ++ */ ++int mxc_sdma_write_ipcv2(int channel, void *ctrl_ptr); ++ ++/*! ++ * This function is used by MXC IPC's read_ex2. It passes the a pointer to the ++ * data control structure to iapi_read_ipcv2() ++ * ++ * @param channel SDMA channel number ++ * @param ctrl_ptr Data Control structure pointer ++ */ ++int mxc_sdma_read_ipcv2(int channel, void *ctrl_ptr); ++ ++/*! ++ * Starts dma channel. ++ * ++ * @param channel channel number ++ */ ++int mxc_dma_start(int channel); ++ ++/*! ++ * Stops dma channel. ++ * ++ * @param channel channel number ++ */ ++int mxc_dma_stop(int channel); ++ ++/*! ++ * Frees dma channel. ++ * ++ * @param channel channel number ++ */ ++void mxc_free_dma(int channel); ++ ++/*! ++ * Sets callback function. Used with standard dma api ++ * for supporting interrupts ++ * ++ * @param channel channel number ++ * @param callback callback function pointer ++ * @param arg argument for callback function ++ */ ++void mxc_dma_set_callback(int channel, dma_callback_t callback, void *arg); ++ ++/*! ++ * Allocates uncachable buffer. Uses hash table. ++ * ++ * @param size size of allocated buffer ++ * @return pointer to buffer ++ */ ++void *sdma_malloc(size_t size); ++ ++#ifdef CONFIG_SDMA_IRAM ++/*! ++ * Allocates uncachable buffer from IRAM.. ++ * ++ * @param size size of allocated buffer ++ * @return pointer to buffer ++ */ ++void *sdma_iram_malloc(size_t size); ++#endif /*CONFIG_SDMA_IRAM */ ++ ++/*! ++ * Frees uncachable buffer. Uses hash table. ++ */ ++void sdma_free(void *buf); ++ ++/*! ++ * Converts virtual to physical address. Uses hash table. ++ * ++ * @param buf virtual address pointer ++ * @return physical address value ++ */ ++unsigned long sdma_virt_to_phys(void *buf); ++ ++/*! ++ * Converts physical to virtual address. Uses hash table. ++ * ++ * @param buf physical address value ++ * @return virtual address pointer ++ */ ++void *sdma_phys_to_virt(unsigned long buf); ++ ++/*! ++ * Configures the BD_INTR bit on a buffer descriptor parameters. ++ * ++ * ++ * @param channel channel number ++ * @param bd_index index of buffer descriptor to set ++ * @param bd_intr flag to set or clear the BD_INTR bit ++ */ ++void mxc_dma_set_bd_intr(int channel, int bd_index, int bd_intr); ++ ++/*! ++ * Gets the BD_INTR bit on a buffer descriptor. ++ * ++ * ++ * @param channel channel number ++ * @param bd_index index of buffer descriptor to set ++ * ++ * @return returns the BD_INTR bit status ++ */ ++int mxc_dma_get_bd_intr(int channel, int bd_index); ++ ++/*! ++ * Stop the current transfer ++ * ++ * @param channel channel number ++ * @param buffer_number number of buffers (beginning with 0), ++ * whose done bits should be reset to 0 ++ */ ++int mxc_dma_reset(int channel, int buffer_number); ++ ++/*! ++ * This functions Returns the SDMA paramaters associated for a module ++ * ++ * @param channel_id the ID of the module requesting DMA ++ * @return returns the sdma parameters structure for the device ++ */ ++mxc_sdma_channel_params_t *mxc_sdma_get_channel_params(mxc_dma_device_t ++ channel_id); ++ ++/*! ++ * This functions marks the SDMA channels that are statically allocated ++ * ++ * @param chnl the channel array used to store channel information ++ */ ++void mxc_get_static_channels(mxc_dma_channel_t * chnl); ++ ++/*! ++ * Initializes SDMA driver ++ */ ++int __init sdma_init(void); ++ ++#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 18:02:13.000000000 +0200 +@@ -0,0 +1,66 @@ ++ ++/* ++ * Copyright 2004-2008 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 ++ */ ++ ++/*! ++ * @defgroup SPBA Shared Peripheral Bus Arbiter (SPBA) ++ * @ingroup MSL_MX31 MSL_MX35 MSL_MX37 MSL_MX51 MSL_MXC91321 ++ */ ++ ++/*! ++ * @file arch-mxc/spba.h ++ * @brief This file contains the Shared Peripheral Bus Arbiter (spba) API. ++ * ++ * @ingroup SPBA ++ */ ++ ++#ifndef __ASM_ARCH_MXC_SPBA_H__ ++#define __ASM_ARCH_MXC_SPBA_H__ ++ ++#ifdef __KERNEL__ ++ ++#define MXC_SPBA_RAR_MASK 0x7 ++ ++/*! ++ * Defines three SPBA masters: A - ARM, C - SDMA (no master B for MX31) ++ */ ++enum spba_masters { ++ SPBA_MASTER_A = 1, ++ SPBA_MASTER_B = 2, ++ SPBA_MASTER_C = 4, ++}; ++ ++/*! ++ * This function allows the three masters (A, B, C) to take ownership of a ++ * shared peripheral. ++ * ++ * @param mod specified module as defined in \b enum \b #spba_module ++ * @param master one of more (or-ed together) masters as defined in \b enum \b #spba_masters ++ * ++ * @return 0 if successful; -1 otherwise. ++ */ ++int spba_take_ownership(int mod, int master); ++ ++/*! ++ * This function releases the ownership for a shared peripheral. ++ * ++ * @param mod specified module as defined in \b enum \b #spba_module ++ * @param master one of more (or-ed together) masters as defined in \b enum \b #spba_masters ++ * ++ * @return 0 if successful; -1 otherwise. ++ */ ++int spba_rel_ownership(int mod, int master); ++ ++#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 18:02:12.000000000 +0200 +@@ -23,7 +23,11 @@ + #if defined CONFIG_ARCH_MX1 + #define CLOCK_TICK_RATE 16000000 + #elif defined CONFIG_ARCH_MX2 ++#ifndef CONFIG_MACH_MX25 + #define CLOCK_TICK_RATE 13300000 ++#else ++#define CLOCK_TICK_RATE 12000000 ++#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 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)); + + if (pin < 16) { ++#ifndef CONFIG_MACH_MX25 + tmp = __raw_readl(VA_GPIO_BASE + MXC_OCR1(port)); + tmp &= ~(3 << (pin * 2)); + tmp |= (ocr << (pin * 2)); + __raw_writel(tmp, VA_GPIO_BASE + MXC_OCR1(port)); +- ++#endif + tmp = __raw_readl(VA_GPIO_BASE + MXC_ICONFA1(port)); + tmp &= ~(3 << (pin * 2)); + tmp |= ((gpio_mode >> GPIO_AOUT_SHIFT) & 3) << (pin * 2); +@@ -90,12 +91,12 @@ void mxc_gpio_mode(int gpio_mode) + __raw_writel(tmp, VA_GPIO_BASE + MXC_ICONFB1(port)); + } else { + pin -= 16; +- ++#ifndef CONFIG_MACH_MX25 + tmp = __raw_readl(VA_GPIO_BASE + MXC_OCR2(port)); + tmp &= ~(3 << (pin * 2)); + tmp |= (ocr << (pin * 2)); + __raw_writel(tmp, VA_GPIO_BASE + MXC_OCR2(port)); +- ++#endif + 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 18:02:02.000000000 +0200 +@@ -31,7 +31,24 @@ + + #define IOMUX_BASE IO_ADDRESS(IOMUXC_BASE_ADDR) + +-static unsigned long iomux_v3_pad_alloc_map[0x200 / BITS_PER_LONG]; ++#ifdef CONFIG_MACH_MX25 ++#define NUM_PADS 0x228 ++#else ++#define NUM_PADS 0x200 ++#endif ++ ++static unsigned long iomux_v3_pad_alloc_map[NUM_PADS / BITS_PER_LONG]; ++ ++static inline int mxc_iomux_v3_pad_offset(struct pad_desc *pad) ++{ ++ int pad_ofs; ++ if (cpu_is_mx25()) ++ pad_ofs = pad->mux_ctrl_ofs; ++ else ++ pad_ofs = pad->pad_ctrl_ofs; ++ BUG_ON((pad_ofs >> 7) >= ARRAY_SIZE(iomux_v3_pad_alloc_map)); ++ return pad_ofs; ++} + + /* + * setups a single pin: +@@ -40,7 +57,7 @@ static unsigned long iomux_v3_pad_alloc_ + */ + int mxc_iomux_v3_setup_pad(struct pad_desc *pad) + { +- unsigned int pad_ofs = pad->pad_ctrl_ofs; ++ unsigned int pad_ofs = mxc_iomux_v3_pad_offset(pad); + + if (test_and_set_bit(pad_ofs >> 2, iomux_v3_pad_alloc_map)) + return -EBUSY; +@@ -65,8 +82,10 @@ int mxc_iomux_v3_setup_multiple_pads(str + + for (i = 0; i < count; i++) { + ret = mxc_iomux_v3_setup_pad(p); +- if (ret) ++ if (ret) { ++ printk(KERN_ERR "Failed to setup PAD[%d]: %d\n", i, ret); + goto setup_error; ++ } + p++; + } + return 0; +@@ -79,7 +98,7 @@ EXPORT_SYMBOL(mxc_iomux_v3_setup_multipl + + void mxc_iomux_v3_release_pad(struct pad_desc *pad) + { +- unsigned int pad_ofs = pad->pad_ctrl_ofs; ++ unsigned int pad_ofs = mxc_iomux_v3_pad_offset(pad); + + 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 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; + +- if (cpu_is_mx27() || cpu_is_mx3()) { ++ if (cpu_is_mx27() || cpu_is_mx3() || cpu_is_mx25()) { + 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 18:02:03.000000000 +0200 +@@ -0,0 +1,143 @@ ++/* ++ * Copyright 2004-2008 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 ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++/*! ++ * @file plat-mxc/spba.c ++ * ++ * @brief This file contains the SPBA API implementation details. ++ * ++ * @ingroup SPBA ++ */ ++ ++static DEFINE_SPINLOCK(spba_lock); ++ ++#define SPBA_MASTER_MIN 1 ++#define SPBA_MASTER_MAX 7 ++ ++/*! ++ * the base addresses for the SPBA modules ++ */ ++static unsigned long spba_base = (unsigned long)IO_ADDRESS(SPBA_CTRL_BASE_ADDR); ++ ++/*! ++ * SPBA clock ++ */ ++static struct clk *spba_clk; ++/*! ++ * This function allows the three masters (A, B, C) to take ownership of a ++ * shared peripheral. ++ * ++ * @param mod specified module as defined in \b enum \b #spba_module ++ * @param master one of more (or-ed together) masters as defined in \b enum \b #spba_masters ++ * ++ * @return 0 if successful; a negative errno value otherwise. ++ */ ++int spba_take_ownership(int mod, int master) ++{ ++ unsigned long spba_flags; ++ int rtn_val = -EIO; ++ ++ if (master < SPBA_MASTER_MIN || master > SPBA_MASTER_MAX) { ++ printk("%s() invalid master %d\n", __FUNCTION__, master); ++ return -EINVAL; ++ } ++ ++ if (spba_clk == NULL) { ++ spba_clk = clk_get(NULL, "spba"); ++ if (IS_ERR(spba_clk)) { ++ int ret = PTR_ERR(spba_clk); ++ ++ spba_clk = NULL; ++ return ret; ++ } ++ } ++ clk_enable(spba_clk); ++ ++ spin_lock_irqsave(&spba_lock, spba_flags); ++ __raw_writel(master, spba_base + mod); ++ ++ if ((__raw_readl(spba_base + mod) & MXC_SPBA_RAR_MASK) == master) { ++ rtn_val = 0; ++ } ++ ++ spin_unlock_irqrestore(&spba_lock, spba_flags); ++ ++ clk_disable(spba_clk); ++ return rtn_val; ++} ++ ++/*! ++ * This function releases the ownership for a shared peripheral. ++ * ++ * @param mod specified module as defined in \b enum \b #spba_module ++ * @param master one of more (or-ed together) masters as defined in \b enum \b #spba_masters ++ * ++ * @return 0 if successful; a negativ errno value otherwise. ++ */ ++int spba_rel_ownership(int mod, int master) ++{ ++ unsigned long spba_flags; ++ volatile unsigned long rar; ++ ++ if (master < SPBA_MASTER_MIN || master > SPBA_MASTER_MAX) { ++ printk("%s() invalid master %d\n", __FUNCTION__, master); ++ return -EINVAL; ++ } ++ ++ if (spba_clk == NULL) { ++ spba_clk = clk_get(NULL, "spba"); ++ if (IS_ERR(spba_clk)) { ++ int ret = PTR_ERR(spba_clk); ++ spba_clk = NULL; ++ return ret; ++ } ++ } ++ clk_enable(spba_clk); ++ ++ if ((__raw_readl(spba_base + mod) & master) == 0) { ++ clk_disable(spba_clk); ++ return -EBUSY; /* does not own it */ ++ } ++ ++ spin_lock_irqsave(&spba_lock, spba_flags); ++ ++ /* Since only the last 3 bits are writeable, doesn't need to mask off ++ bits 31-3 */ ++ rar = __raw_readl(spba_base + mod) & (~master); ++ __raw_writel(rar, spba_base + mod); ++ ++ if ((__raw_readl(spba_base + mod) & master) != 0) { ++ spin_unlock_irqrestore(&spba_lock, spba_flags); ++ clk_disable(spba_clk); ++ return -EIO; ++ } ++ spin_unlock_irqrestore(&spba_lock, spba_flags); ++ ++ clk_disable(spba_clk); ++ return 0; ++} ++ ++EXPORT_SYMBOL(spba_take_ownership); ++EXPORT_SYMBOL(spba_rel_ownership); ++ ++MODULE_AUTHOR("Freescale Semiconductor, Inc."); ++MODULE_DESCRIPTION("SPBA"); ++MODULE_LICENSE("GPL"); +diff -urNp linux-2.6.30-rc4/arch/arm/plat-mxc/system.c linux-2.6.30-rc4-karo/arch/arm/plat-mxc/system.c +--- linux-2.6.30-rc4/arch/arm/plat-mxc/system.c 2009-05-13 09:46:19.000000000 +0200 ++++ linux-2.6.30-rc4-karo/arch/arm/plat-mxc/system.c 2009-06-08 12:48:23.000000000 +0200 +@@ -21,6 +21,7 @@ + */ + + #include ++#include + #include + #include + #include +@@ -38,18 +39,15 @@ + #define WDOG_WCR_ENABLE (1 << 2) + #endif + ++static struct clk *mxc_wdt_clk; ++ + /* + * Reset the system. It is called by machine_restart(). + */ + 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); +- } ++ if (mxc_wdt_clk) ++ clk_enable(mxc_wdt_clk); + + /* Assert SRS signal */ + __raw_writew(WDOG_WCR_ENABLE, WDOG_WCR_REG); +@@ -65,3 +63,20 @@ 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) ++{ ++ if (cpu_is_mx1()) ++ return 0; ++ ++ mxc_wdt_clk = clk_get_sys("imx-wdt.0", NULL); ++ if (IS_ERR(mxc_wdt_clk)) { ++ int ret = PTR_ERR(mxc_wdt_clk); ++ ++ printk(KERN_ERR "%s: Failed to get imx-wdt.0 clk: %d\n", __FUNCTION__, ret); ++ mxc_wdt_clk = NULL; ++ return ret; ++ } ++ return 0; ++} ++arch_initcall(mxc_wdt_init); +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 18:02:02.000000000 +0200 +@@ -66,7 +66,7 @@ static inline void gpt_irq_disable(void) + { + unsigned int tmp; + +- if (cpu_is_mx3()) ++ if (cpu_is_mx3() || cpu_is_mx25()) + __raw_writel(0, timer_base + MX3_IR); + else { + tmp = __raw_readl(timer_base + MXC_TCTL); +@@ -76,7 +76,7 @@ static inline void gpt_irq_disable(void) + + static inline void gpt_irq_enable(void) + { +- if (cpu_is_mx3()) ++ if (cpu_is_mx3() || cpu_is_mx25()) + __raw_writel(1<<0, timer_base + MX3_IR); + else { + __raw_writel(__raw_readl(timer_base + MXC_TCTL) | MX1_2_TCTL_IRQEN, +@@ -88,9 +88,9 @@ static void gpt_irq_acknowledge(void) + { + if (cpu_is_mx1()) + __raw_writel(0, timer_base + MX1_2_TSTAT); +- if (cpu_is_mx2()) ++ if (cpu_is_mx2() && !cpu_is_mx25()) + __raw_writel(MX2_TSTAT_CAPT | MX2_TSTAT_COMP, timer_base + MX1_2_TSTAT); +- if (cpu_is_mx3()) ++ if (cpu_is_mx3() || cpu_is_mx25()) + __raw_writel(MX3_TSTAT_OF1, timer_base + MX3_TSTAT); + } + +@@ -117,7 +117,7 @@ static int __init mxc_clocksource_init(s + { + unsigned int c = clk_get_rate(timer_clk); + +- if (cpu_is_mx3()) ++ if (cpu_is_mx3() || cpu_is_mx25()) + clocksource_mxc.read = mx3_get_cycles; + + clocksource_mxc.mult = clocksource_hz2mult(c, +@@ -180,7 +180,7 @@ static void mxc_set_mode(enum clock_even + + if (mode != clockevent_mode) { + /* Set event time into far-far future */ +- if (cpu_is_mx3()) ++ if (cpu_is_mx3() || cpu_is_mx25()) + __raw_writel(__raw_readl(timer_base + MX3_TCN) - 3, + timer_base + MX3_TCMP); + else +@@ -233,7 +233,7 @@ static irqreturn_t mxc_timer_interrupt(i + struct clock_event_device *evt = &clockevent_mxc; + uint32_t tstat; + +- if (cpu_is_mx3()) ++ if (cpu_is_mx3() || cpu_is_mx25()) + tstat = __raw_readl(timer_base + MX3_TSTAT); + else + tstat = __raw_readl(timer_base + MX1_2_TSTAT); +@@ -264,7 +264,7 @@ static int __init mxc_clockevent_init(st + { + unsigned int c = clk_get_rate(timer_clk); + +- if (cpu_is_mx3()) ++ if (cpu_is_mx3() || cpu_is_mx25()) + 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 + __raw_writel(0, timer_base + MXC_TCTL); + __raw_writel(0, timer_base + MXC_TPRER); /* see datasheet note */ + +- if (cpu_is_mx3()) ++ if (cpu_is_mx3() || cpu_is_mx25()) + 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 18:02:54.000000000 +0200 +@@ -12,7 +12,7 @@ + # + # http://www.arm.linux.org.uk/developer/machines/?action=new + # +-# Last update: Mon Mar 23 20:09:01 2009 ++# Last update: Mon Apr 20 10:31:38 2009 + # + # machine_is_xxx CONFIG_xxxx MACH_TYPE_xxx number + # +@@ -1721,7 +1721,7 @@ sapphire MACH_SAPPHIRE SAPPHIRE 1729 + csb637xo MACH_CSB637XO CSB637XO 1730 + evisiong MACH_EVISIONG EVISIONG 1731 + stmp37xx MACH_STMP37XX STMP37XX 1732 +-stmp378x MACH_STMP38XX STMP38XX 1733 ++stmp378x MACH_STMP378X STMP378X 1733 + tnt MACH_TNT TNT 1734 + tbxt MACH_TBXT TBXT 1735 + playmate MACH_PLAYMATE PLAYMATE 1736 +@@ -2132,3 +2132,41 @@ apollo MACH_APOLLO APOLLO 2141 + at91cap9stk MACH_AT91CAP9STK AT91CAP9STK 2142 + spc300 MACH_SPC300 SPC300 2143 + eko MACH_EKO EKO 2144 ++ccw9m2443 MACH_CCW9M2443 CCW9M2443 2145 ++ccw9m2443js MACH_CCW9M2443JS CCW9M2443JS 2146 ++m2m_router_device MACH_M2M_ROUTER_DEVICE M2M_ROUTER_DEVICE 2147 ++str9104nas MACH_STAR9104NAS STAR9104NAS 2148 ++pca100 MACH_PCA100 PCA100 2149 ++z3_dm365_mod_01 MACH_Z3_DM365_MOD_01 Z3_DM365_MOD_01 2150 ++hipox MACH_HIPOX HIPOX 2151 ++omap3_piteds MACH_OMAP3_PITEDS OMAP3_PITEDS 2152 ++bm150r MACH_BM150R BM150R 2153 ++tbone MACH_TBONE TBONE 2154 ++merlin MACH_MERLIN MERLIN 2155 ++falcon MACH_FALCON FALCON 2156 ++davinci_da850_evm MACH_DAVINCI_DA850_EVM DAVINCI_DA850_EVM 2157 ++s5p6440 MACH_S5P6440 S5P6440 2158 ++at91sam9g10ek MACH_AT91SAM9G10EK AT91SAM9G10EK 2159 ++omap_4430sdp MACH_OMAP_4430SDP OMAP_4430SDP 2160 ++lpc313x MACH_LPC313X LPC313X 2161 ++magx_zn5 MACH_MAGX_ZN5 MAGX_ZN5 2162 ++magx_em30 MACH_MAGX_EM30 MAGX_EM30 2163 ++magx_ve66 MACH_MAGX_VE66 MAGX_VE66 2164 ++meesc MACH_MEESC MEESC 2165 ++otc570 MACH_OTC570 OTC570 2166 ++bcu2412 MACH_BCU2412 BCU2412 2167 ++beacon MACH_BEACON BEACON 2168 ++actia_tgw MACH_ACTIA_TGW ACTIA_TGW 2169 ++e4430 MACH_E4430 E4430 2170 ++ql300 MACH_QL300 QL300 2171 ++btmavb101 MACH_BTMAVB101 BTMAVB101 2172 ++btmawb101 MACH_BTMAWB101 BTMAWB101 2173 ++sq201 MACH_SQ201 SQ201 2174 ++quatro45xx MACH_QUATRO45XX QUATRO45XX 2175 ++openpad MACH_OPENPAD OPENPAD 2176 ++tx25 MACH_TX25 TX25 2177 ++omap3_torpedo MACH_OMAP3_TORPEDO OMAP3_TORPEDO 2178 ++htcraphael_k MACH_HTCRAPHAEL_K HTCRAPHAEL_K 2179 ++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 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", + template->gpio, template->name); +- return 0; ++ return -EINVAL; + } + + 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 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. + ++config MTD_NAND_MXC_FLASH_BBT ++ bool "Support a flash based bad block table" ++ depends on MTD_NAND_MXC ++ ++config ARCH_MXC_HAS_NFC_V1 ++ bool ++ ++config ARCH_MXC_HAS_NFC_V1_1 ++ select ARCH_MXC_HAS_NFC_V1 ++ bool ++ ++config ARCH_MXC_HAS_NFC_V2 ++ bool ++ ++config ARCH_MXC_HAS_NFC_V2_1 ++ bool ++ select ARCH_MXC_HAS_NFC_V2 ++ ++config ARCH_MXC_HAS_NFC_V3 ++ bool ++ + 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/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-08 12:51:07.000000000 +0200 +@@ -34,23 +34,52 @@ + #include + #include + ++#ifdef CONFIG_MTD_DEBUG ++static int debug = 0; ++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(l, fmt...) DBG(l, fmt) ++#else ++static int debug; ++module_param(debug, int, 0); ++ ++#define dbg_lvl(n) 0 ++#define DBG(lvl, fmt...) do { } while (0) ++#endif ++ ++ + #define DRIVER_NAME "mxc_nand" + + /* Addresses for NFC registers */ +-#define NFC_BUF_SIZE 0xE00 +-#define NFC_BUF_ADDR 0xE04 +-#define NFC_FLASH_ADDR 0xE06 +-#define NFC_FLASH_CMD 0xE08 +-#define NFC_CONFIG 0xE0A +-#define NFC_ECC_STATUS_RESULT 0xE0C +-#define NFC_RSLTMAIN_AREA 0xE0E +-#define NFC_RSLTSPARE_AREA 0xE10 +-#define NFC_WRPROT 0xE12 +-#define NFC_UNLOCKSTART_BLKADDR 0xE14 +-#define NFC_UNLOCKEND_BLKADDR 0xE16 +-#define NFC_NF_WRPRST 0xE18 +-#define NFC_CONFIG1 0xE1A +-#define NFC_CONFIG2 0xE1C ++#define NFC_BUF_SIZE 0x000 ++#define NFC_BUF_ADDR 0x004 ++#define NFC_FLASH_ADDR 0x006 ++#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_UNLOCKSTART_BLKADDR 0x014 ++#define NFC_UNLOCKEND_BLKADDR 0x016 ++#endif ++#define NFC_NF_WRPRST 0x018 ++#define NFC_CONFIG1 0x01A ++#define NFC_CONFIG2 0x01C ++#ifdef CONFIG_ARCH_MXC_HAS_NFC_V1_1 ++#define NFC_UNLOCKSTART_BLKADDR 0x020 ++#define NFC_UNLOCKEND_BLKADDR 0x022 ++#define NFC_UNLOCKSTART_BLKADDR1 0x024 ++#define NFC_UNLOCKEND_BLKADDR1 0x026 ++#define NFC_UNLOCKSTART_BLKADDR2 0x028 ++#define NFC_UNLOCKEND_BLKADDR2 0x02a ++#define NFC_UNLOCKSTART_BLKADDR3 0x02c ++#define NFC_UNLOCKEND_BLKADDR3 0x02e ++#endif + + /* Addresses for NFC RAM BUFFER Main area 0 */ + #define MAIN_AREA0 0x000 +@@ -59,10 +88,27 @@ + #define MAIN_AREA3 0x600 + + /* Addresses for NFC SPARE BUFFER Spare area 0 */ ++#ifndef CONFIG_ARCH_MXC_HAS_NFC_V1_1 ++#define SPARE_AREA_SIZE 16 + #define SPARE_AREA0 0x800 + #define SPARE_AREA1 0x810 + #define SPARE_AREA2 0x820 + #define SPARE_AREA3 0x830 ++#else ++#define SPARE_AREA_SIZE 64 ++#define MAIN_AREA4 0x800 ++#define MAIN_AREA5 0xa00 ++#define MAIN_AREA6 0xc00 ++#define MAIN_AREA7 0xe00 ++#define SPARE_AREA0 0x1000 ++#define SPARE_AREA1 0x1040 ++#define SPARE_AREA2 0x1080 ++#define SPARE_AREA3 0x10c0 ++#define SPARE_AREA4 0x1100 ++#define SPARE_AREA5 0x1140 ++#define SPARE_AREA6 0x1180 ++#define SPARE_AREA7 0x11c0 ++#endif + + /* 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 { + struct device *dev; + + void __iomem *regs; ++ void __iomem *nfc_buf; + int spare_only; + int status_request; + int pagesize_2k; +@@ -120,40 +167,149 @@ 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}} ++}; ++ + static struct nand_ecclayout nand_hw_eccoob_8 = { + .eccbytes = 5, + .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}} ++}; ++ ++#ifdef CONFIG_MTD_NAND_MXC_FLASH_BBT ++static u8 bbt_pattern[] = {'B', 'b', 't', '0' }; ++static u8 mirror_pattern[] = {'1', 't', 'b', 'B' }; ++ ++static struct nand_bbt_descr bbt_main_descr = { ++ .options = (NAND_BBT_LASTBLOCK | NAND_BBT_WRITE | ++ NAND_BBT_2BIT | NAND_BBT_VERSION | NAND_BBT_PERCHIP), ++ .offs = 12, ++ .len = 4, ++ .veroffs = 11, ++ .maxblocks = 4, ++ .pattern = bbt_pattern, + }; + ++static struct nand_bbt_descr bbt_mirror_descr = { ++ .options = (NAND_BBT_LASTBLOCK | NAND_BBT_WRITE | ++ NAND_BBT_2BIT | NAND_BBT_VERSION | NAND_BBT_PERCHIP), ++ .offs = 12, ++ .len = 4, ++ .veroffs = 11, ++ .maxblocks = 4, ++ .pattern = mirror_pattern, ++}; ++#endif ++#else ++/* ++ * 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 = {{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}, ++ .oobfree = {{0, 4}}, ++}; ++ ++static struct nand_ecclayout nand_hw_eccoob2k_16 = { ++ .eccbytes = 9, ++ .eccpos = {6, 7, 8, 9, 10, 11, 12, 13, 14}, ++ .oobfree = {{2, 4}, {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 ++*/ ++static u8 bbt_pattern[] = { 'B', 'b', 't', '0' }; ++static u8 mirror_pattern[] = { '1', 't', 'b', 'B' }; ++ ++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 ++}; ++ ++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 ++}; ++#endif ++#endif ++ + #ifdef CONFIG_MTD_PARTITIONS + static const char *part_probes[] = { "RedBoot", "cmdlinepart", NULL }; + #endif + ++#ifdef CONFIG_MTD_DEBUG ++#define nfc_read_reg(b, r) __nfc_read_reg(b, r, #r, __FUNCTION__) ++static inline u16 __nfc_read_reg(void __iomem *base, unsigned int reg, ++ const char *name, const char *fn) ++{ ++ u16 val = readw(base + reg); ++ DBG(3, "%s: Read %04x from %s[%02x]\n", fn, val, name, reg); ++ return val; ++} ++ ++#define nfc_write_reg(v, b, r) __nfc_write_reg(v, b, r, #r, __FUNCTION__) ++static inline void __nfc_write_reg(u16 val, void __iomem *base, unsigned int reg, ++ const char *name, const char *fn) ++{ ++ DBG(3, "%s: Writing %04x to %s[%02x]\n", fn, val, name, reg); ++ writew(val, base + reg); ++} ++#else ++#define nfc_read_reg(b, r) readw(b + r) ++#define nfc_write_reg(v, b, r) writew(v, b + r) ++#endif ++ + 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_LEVEL3, "%s(%d)\n", __FUNCTION__, irq); ++ ++ tmp = nfc_read_reg(host->regs, NFC_CONFIG1); + tmp |= NFC_INT_MSK; /* Disable interrupt */ +- writew(tmp, host->regs + NFC_CONFIG1); ++ nfc_write_reg(tmp, host->regs, NFC_CONFIG1); + + wake_up(&host->irq_waitq); + +@@ -166,35 +322,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; +- + if (useirq) { +- if ((readw(host->regs + NFC_CONFIG2) & NFC_INT) == 0) { +- +- tmp = readw(host->regs + NFC_CONFIG1); +- tmp &= ~NFC_INT_MSK; /* Enable interrupt */ +- writew(tmp, host->regs + NFC_CONFIG1); +- +- wait_event(host->irq_waitq, +- readw(host->regs + NFC_CONFIG2) & NFC_INT); +- +- tmp = readw(host->regs + NFC_CONFIG2); +- tmp &= ~NFC_INT; +- writew(tmp, host->regs + NFC_CONFIG2); ++ if (!(nfc_read_reg(host->regs, NFC_CONFIG2) & NFC_INT)) { ++ uint32_t cfg1; ++ 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_read_reg(host->regs, NFC_CONFIG2) & ++ NFC_INT, timeout); + } + } else { +- while (max_retries-- > 0) { +- if (readw(host->regs + NFC_CONFIG2) & NFC_INT) { +- tmp = readw(host->regs + NFC_CONFIG2); +- tmp &= ~NFC_INT; +- writew(tmp, host->regs + NFC_CONFIG2); +- break; +- } ++ 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); + } + } + +@@ -204,8 +354,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 +369,9 @@ 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); +@@ -230,22 +382,28 @@ static void send_addr(struct mxc_nand_ho + static void send_prog_page(struct mxc_nand_host *host, uint8_t buf_id, + int spare_only) + { ++ int i; + DEBUG(MTD_DEBUG_LEVEL3, "send_prog_page (%d)\n", spare_only); + ++ for (i = 0; i < 4; i++) { ++ void *src = host->nfc_buf + SPARE_AREA0 + i * 16; ++ void *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); ++ nfc_write_reg(buf_id, host->regs, NFC_BUF_ADDR); + + /* Configure spare or page+spare access */ + if (!host->pagesize_2k) { +- uint16_t config1 = readw(host->regs + NFC_CONFIG1); ++ uint16_t config1 = nfc_read_reg(host->regs, NFC_CONFIG1); + if (spare_only) + config1 |= NFC_SP_EN; + else +- 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); +@@ -256,25 +414,33 @@ 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 */ +- writew(buf_id, host->regs + NFC_BUF_ADDR); ++ nfc_write_reg(buf_id, host->regs, NFC_BUF_ADDR); + + /* Configure spare or page+spare access */ + if (!host->pagesize_2k) { +- uint32_t config1 = readw(host->regs + NFC_CONFIG1); ++ uint32_t config1 = nfc_read_reg(host->regs, NFC_CONFIG1); + if (spare_only) + config1 |= NFC_SP_EN; + else + config1 &= ~NFC_SP_EN; +- writew(config1, host->regs + NFC_CONFIG1); ++ nfc_write_reg(config1, host->regs, NFC_CONFIG1); + } + +- 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); ++ for (i = 0; i < 4; i++) { ++ void *src = host->nfc_buf + SPARE_AREA0 + i * 64; ++ void *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 +450,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 */ +- tmp = readw(host->regs + NFC_CONFIG1); ++ tmp = nfc_read_reg(host->regs, NFC_CONFIG1); + tmp &= ~NFC_SP_EN; +- writew(tmp, host->regs + NFC_CONFIG1); ++ 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 */ + wait_op_done(host, TROP_US_DELAY, 0, true); + + 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,32 +480,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_AREA1; + uint32_t store; + uint16_t ret, tmp; + /* 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 + * corruption of read/write buffer on status requests. */ +- writew(1, 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); ++ tmp = nfc_read_reg(host->regs, NFC_CONFIG1); + tmp &= ~NFC_SP_EN; +- writew(tmp, host->regs + NFC_CONFIG1); ++ nfc_write_reg(tmp, host->regs, NFC_CONFIG1); + +- writew(NFC_STATUS, host->regs + NFC_CONFIG2); ++ WARN_ON(nfc_read_reg(host->regs, NFC_CONFIG2)); ++ nfc_write_reg(NFC_STATUS, host->regs, NFC_CONFIG2); + + /* Wait for operation to complete */ + wait_op_done(host, TROP_US_DELAY, 0, true); + + /* Status is placed in first word of main buffer */ +- /* get status, then recovery area 1 data */ ++ /* get status, then recover area 1 data */ + ret = readw(main_buf); + writel(store, main_buf); + ++ DBG(0, "%s: status=%02x\n", __FUNCTION__, ret); ++ + return ret; + } + +@@ -369,7 +541,7 @@ static int mxc_nand_correct_data(struct + * 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, +@@ -392,8 +564,10 @@ 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; +- uint16_t __iomem *main_buf = host->regs + MAIN_AREA0; +- 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; ++ ++ WARN_ON(host->spare_only && host->col_addr >= 16); + + /* Check for status request */ + if (host->status_request) +@@ -431,14 +605,16 @@ static uint16_t mxc_nand_read_word(struc + "mxc_nand_read_word(col = %d)\n", host->col_addr); + + col = host->col_addr; ++ + /* Adjust saved column address */ + if (col < mtd->writesize && host->spare_only) + col += mtd->writesize; ++ WARN_ON(col >= mtd->writesize + 16); + + if (col < mtd->writesize) +- p = (host->regs + MAIN_AREA0) + (col >> 1); ++ p = (host->nfc_buf + MAIN_AREA0) + (col >> 1); + else +- p = (host->regs + SPARE_AREA0) + ((col - mtd->writesize) >> 1); ++ p = (host->nfc_buf + SPARE_AREA0) + ((col - mtd->writesize) >> 1); + + if (col & 1) { + rd_word = readw(p); +@@ -474,10 +650,13 @@ static void mxc_nand_write_buf(struct mt + /* 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 ++ 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); + +@@ -485,10 +664,10 @@ static void mxc_nand_write_buf(struct mt + void __iomem *p; + + if (col < mtd->writesize) +- p = host->regs + MAIN_AREA0 + (col & ~3); ++ p = host->nfc_buf + MAIN_AREA0 + (col & ~3); + else +- p = host->regs + SPARE_AREA0 - +- mtd->writesize + (col & ~3); ++ p = host->nfc_buf + SPARE_AREA0 + ++ (col & ~3) - mtd->writesize; + + DEBUG(MTD_DEBUG_LEVEL3, "%s:%d: p = %p\n", __func__, + __LINE__, p); +@@ -542,6 +721,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); + + memcpy(p, &buf[i], m); + col += m; +@@ -571,18 +751,28 @@ static void mxc_nand_read_buf(struct mtd + /* 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 ++ /* 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; + + if (col < mtd->writesize) +- p = host->regs + MAIN_AREA0 + (col & ~3); ++ p = host->nfc_buf + MAIN_AREA0 + (col & ~3); + else +- p = host->regs + SPARE_AREA0 - +- mtd->writesize + (col & ~3); ++ p = host->nfc_buf + SPARE_AREA0 + ++ (col & ~3) - mtd->writesize; ++ ++ if (dbg_lvl(3)) { ++ print_hex_dump(KERN_DEBUG, "spare: ", DUMP_PREFIX_ADDRESS, ++ 16, 2, p, 64, 0); ++ } + + if (((col | (int)&buf[i]) & 3) || n < 16) { + uint32_t data; +@@ -621,15 +811,20 @@ static void mxc_nand_read_buf(struct mtd + m += mtd->oobsize; + + 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; + } + } ++ 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 +@@ -637,7 +832,22 @@ 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; ++ ++ for (i = 0; i < len >> 1; i++) { ++ u16 w = *wp++; ++ u8 c1 = *buf++; ++ u8 c2 = *buf++; ++ if ((w & 0xff) != c1 || (w >> 8) != c2) { ++ DBG(0, "%s: verify error @ %03x: read: %02x %02x expected: %02x %02x\n", ++ __FUNCTION__, i, w & 0xff, w >> 8, c1, c2); ++ return -EFAULT; ++ } ++ } ++ return 0; + } + + /* This function is used by upper layer for select and +@@ -655,13 +865,15 @@ 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); + 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); + #endif + + switch (chip) { +@@ -679,9 +891,6 @@ static void mxc_nand_select_chip(struct + host->clk_act = 1; + } + break; +- +- default: +- break; + } + } + +@@ -692,7 +901,7 @@ 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", +@@ -712,13 +921,11 @@ static void mxc_nand_command(struct mtd_ + case NAND_CMD_READ0: + 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; +@@ -751,23 +958,25 @@ 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); +- ++#ifndef CONFIG_ARCH_MXC_HAS_NFC_V1_1 + if (host->pagesize_2k) { + /* 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); + } +- ++#endif ++ useirq = true; + break; + + case NAND_CMD_ERASE1: +- useirq = false; ++ break; ++ case NAND_CMD_ERASE2: ++ useirq = true; + break; + } + +@@ -791,23 +1000,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 +1022,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); ++#ifndef CONFIG_ARCH_MXC_HAS_NFC_V1_1 + send_read_page(host, 1, host->spare_only); + send_read_page(host, 2, host->spare_only); + send_read_page(host, 3, host->spare_only); ++#endif + } else + send_read_page(host, 0, host->spare_only); + break; + + case NAND_CMD_READID: ++ host->col_addr = 0; + send_read_id(host); + break; + +@@ -851,9 +1053,12 @@ 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; +- struct resource *res; ++ struct resource *res1, *res2; + 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 +1073,6 @@ static int __init mxcnd_probe(struct pla + mtd->owner = THIS_MODULE; + mtd->dev.parent = &pdev->dev; + +- /* 50 us command delay time */ +- this->chip_delay = 5; +- + this->priv = host; + this->dev_ready = mxc_nand_dev_ready; + this->cmdfunc = mxc_nand_command; +@@ -880,29 +1082,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; ++#ifdef CONFIG_MTD_NAND_MXC_FLASH_BBT ++ this->bbt_td = &bbt_main_descr; ++ this->bbt_md = &bbt_mirror_descr; ++ this->options |= NAND_USE_FLASH_BBT; ++#endif + +- host->clk = clk_get(&pdev->dev, "nfc"); +- if (IS_ERR(host->clk)) ++ host->clk = clk_get(&pdev->dev, "nfc_clk"); ++ if (IS_ERR(host->clk)) { ++ err = PTR_ERR(host->clk); + goto eclk; ++ } + + clk_enable(host->clk); + host->clk_act = 1; + +- res = platform_get_resource(pdev, IORESOURCE_MEM, 0); +- if (!res) { ++ res1 = platform_get_resource(pdev, IORESOURCE_MEM, 0); ++ res2 = platform_get_resource(pdev, IORESOURCE_MEM, 1); ++ if (!res1 || !res2) { + err = -ENODEV; + goto eres; + } + +- 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; ++ } ++ ++ if (!request_mem_region(res2->start, resource_size(res2), "mxc_nand buffer")) { ++ err = -EBUSY; ++ goto ereq2; ++ } ++ ++ host->regs = ioremap(res1->start, resource_size(res1)); + if (!host->regs) { +- err = -EIO; +- goto eres; ++ err = -ENOMEM; ++ goto eunmap1; + } + +- tmp = readw(host->regs + NFC_CONFIG1); ++ 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); + +@@ -912,57 +1139,84 @@ static int __init mxcnd_probe(struct pla + if (err) + goto eirq; + +- 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_ECC_EN; +- writew(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; +- tmp = readw(host->regs + NFC_CONFIG1); +- tmp &= ~NFC_ECC_EN; +- writew(tmp, host->regs + NFC_CONFIG1); +- } +- + /* Reset NAND */ + this->cmdfunc(mtd, NAND_CMD_RESET, -1, -1); + + /* preset operation */ + /* Unlock the internal RAM Buffer */ +- writew(0x2, host->regs + NFC_CONFIG); ++ nfc_write_reg(0x2, host->regs, NFC_CONFIG); + + /* Blocks to be unlocked */ +- writew(0x0, host->regs + NFC_UNLOCKSTART_BLKADDR); +- writew(0x4000, host->regs + NFC_UNLOCKEND_BLKADDR); ++ nfc_write_reg(0x0, host->regs, NFC_UNLOCKSTART_BLKADDR); ++ nfc_write_reg(0x4000, host->regs, NFC_UNLOCKEND_BLKADDR); + + /* Unlock Block Command for given address range */ +- writew(0x4, host->regs + NFC_WRPROT); ++ nfc_write_reg(0x4, host->regs, NFC_WRPROT); + + /* NAND bus width determines access funtions used by upper layer */ + if (pdata->width == 2) { + this->options |= NAND_BUSWIDTH_16; +- this->ecc.layout = &nand_hw_eccoob_16; + } + +- host->pagesize_2k = 0; +- + /* Scan to find existence of the device */ +- if (nand_scan(mtd, 1)) { ++ err = nand_scan_ident(mtd, 1); ++ if (err) { + DEBUG(MTD_DEBUG_LEVEL0, + "MXC_ND: Unable to find any NAND device.\n"); +- err = -ENXIO; ++ goto escan; ++ } ++ /* this is required before completing the scan */ ++ host->pagesize_2k = (mtd->writesize == 2048); ++ tmp = nfc_read_reg(host->regs, NFC_CONFIG1); ++ tmp |= NFC_ONE_CYCLE; ++ tmp &= ~(3 << 9); /* clear PPB mask */ ++ DBG(0, "%s: ppb=%d (%02x)\n", __FUNCTION__, ++ mtd->erasesize / mtd->writesize, ++ ffs(mtd->erasesize / mtd->writesize) - 6); ++ ++ /* set PPB (pages per block */ ++ tmp |= (ffs(mtd->erasesize / mtd->writesize) - 6) << 9; ++ nfc_write_reg(tmp, host->regs, NFC_CONFIG1); ++ if (pdata->width == 2) { ++ if (host->pagesize_2k) { ++ this->ecc.layout = &nand_hw_eccoob2k_16; ++ } else { ++ this->ecc.layout = &nand_hw_eccoob_16; ++ } ++ } 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; ++ nfc_write_reg(tmp, host->regs, NFC_CONFIG1); ++ } ++ ++ err = nand_scan_tail(mtd); ++ if (err) { + goto escan; + } + ++ 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 +1235,19 @@ static int __init mxcnd_probe(struct pla + return 0; + + escan: +- free_irq(host->irq, NULL); ++ free_irq(host->irq, host); + eirq: ++ if (res2) ++ iounmap(host->nfc_buf); ++eunmap2: + iounmap(host->regs); ++eunmap1: ++ release_mem_region(res2->start, resource_size(res2)); ++ereq2: ++ release_mem_region(res1->start, resource_size(res1)); ++ereq1: + eres: ++ clk_disable(host->clk); + clk_put(host->clk); + eclk: + kfree(host); +@@ -995,46 +1258,63 @@ eclk: + static int __devexit mxcnd_remove(struct platform_device *pdev) + { + struct mxc_nand_host *host = platform_get_drvdata(pdev); ++ struct resource *res; + ++ if (host->clk_act) ++ clk_disable(host->clk); + clk_put(host->clk); + +- platform_set_drvdata(pdev, NULL); +- + nand_release(&host->mtd); +- free_irq(host->irq, NULL); ++ free_irq(host->irq, host); + iounmap(host->regs); + kfree(host); + ++ res = platform_get_resource(pdev, IORESOURCE_MEM, 0); ++ if (res) { ++ release_mem_region(res->start, resource_size(res)); ++ } ++ res = platform_get_resource(pdev, IORESOURCE_MEM, 1); ++ if (res) { ++ release_mem_region(res->start, resource_size(res)); ++ } + return 0; + } + + #ifdef CONFIG_PM + static int mxcnd_suspend(struct platform_device *pdev, pm_message_t state) + { +- struct mtd_info *info = platform_get_drvdata(pdev); ++ struct mtd_info *mtd = platform_get_drvdata(pdev); ++ struct nand_chip *nand_chip = mtd->priv; ++ struct mxc_nand_host *host = nand_chip->priv; + int ret = 0; + + DEBUG(MTD_DEBUG_LEVEL0, "MXC_ND : NAND suspend\n"); +- if (info) +- ret = info->suspend(info); ++ if (mtd) ++ ret = mtd->suspend(mtd); + +- /* Disable the NFC clock */ +- clk_disable(nfc_clk); /* FIXME */ ++ if (host->clk_act) { ++ /* Disable the NFC clock */ ++ clk_disable(host->clk); ++ } + + return ret; + } + + static int mxcnd_resume(struct platform_device *pdev) + { +- struct mtd_info *info = platform_get_drvdata(pdev); ++ struct mtd_info *mtd = platform_get_drvdata(pdev); ++ struct nand_chip *nand_chip = mtd->priv; ++ struct mxc_nand_host *host = nand_chip->priv; + int ret = 0; + + DEBUG(MTD_DEBUG_LEVEL0, "MXC_ND : NAND resume\n"); +- /* Enable the NFC clock */ +- clk_enable(nfc_clk); /* FIXME */ + +- if (info) +- info->resume(info); ++ if (host->clk_act) { ++ /* Enable the NFC clock */ ++ clk_enable(host->clk); ++ } ++ if (mtd) ++ mtd->resume(mtd); + + return ret; + } +@@ -1047,7 +1327,7 @@ static int mxcnd_resume(struct platform_ + static struct platform_driver mxcnd_driver = { + .driver = { + .name = DRIVER_NAME, +- }, ++ }, + .remove = __exit_p(mxcnd_remove), + .suspend = mxcnd_suspend, + .resume = mxcnd_resume, +@@ -1055,13 +1335,14 @@ static struct platform_driver mxcnd_driv + + static int __init mxc_nd_init(void) + { ++ int ret; ++ + /* Register the device driver structure. */ +- pr_info("MXC MTD nand Driver\n"); +- if (platform_driver_probe(&mxcnd_driver, mxcnd_probe) != 0) { ++ ret = platform_driver_probe(&mxcnd_driver, mxcnd_probe); ++ if (ret != 0) { + printk(KERN_ERR "Driver register failed for mxcnd_driver\n"); +- return -ENODEV; + } +- return 0; ++ return ret; + } + + static void __exit mxc_nd_cleanup(void) +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 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 -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 18:43:03.000000000 +0200 +@@ -2,6 +2,12 @@ + * Fast Ethernet Controller (FEC) driver for Motorola MPC8xx. + * Copyright (c) 1997 Dan Malek (dmalek@jlc.net) + * ++ * This version of the driver is specific to the FADS implementation, ++ * since the board contains control registers external to the processor ++ * for the control of the LevelOne LXT970 transceiver. The MPC860T manual ++ * describes connections using the internal parallel port I/O, which ++ * is basically all of Port D. ++ * + * Right now, I am very wasteful with the buffers. I allocate memory + * pages and then divide them into 2K frame buffers. This way I know I + * have buffers large enough to hold one frame within one buffer descriptor. +@@ -18,77 +24,123 @@ + * Bug fixes and cleanup by Philippe De Muyter (phdm@macqel.be) + * Copyright (c) 2004-2006 Macq Electronique SA. + */ ++/* ++ * Copyright 2006-2007 Freescale Semiconductor, Inc. All Rights Reserved. ++ */ + + #include + #include +-#include +-#include ++#include + #include + #include + #include + #include +-#include +-#include ++#include + #include ++#include + #include + #include + #include + #include +-#include +-#include +-#include +-#include ++#include + #include +-#include ++#include ++#include + +-#include ++#include ++#include + +-#ifndef CONFIG_ARCH_MXC +-#include +-#include ++#define DRV_NAME "fec" ++#define DEBUG ++ ++#ifdef DEBUG ++static int debug = 0; ++#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 + ++#if defined(CONFIG_M523x) || defined(CONFIG_M527x) || \ ++ defined(CONFIG_M5272) || defined(CONFIG_M528x) || \ ++ defined(CONFIG_M520x) || defined(CONFIG_M532x) ++#include ++#include + #include "fec.h" +- +-#ifdef CONFIG_ARCH_MXC ++#define FEC_ALIGNMENT (0x03) /*FEC needs 4bytes alignment*/ ++#elif defined(CONFIG_ARCH_MXC) + #include +-#define FEC_ALIGNMENT 0xf ++#include ++#include "fec.h" ++#define FEC_ALIGNMENT (0x0F) /*FEC needs 128bits(16bytes) alignment*/ + #else +-#define FEC_ALIGNMENT 0x3 ++#include ++#include ++#include "commproc.h" ++#define FEC_ALIGNMENT (0x03) /*FEC needs 4bytes alignment */ + #endif + ++#define FEC_ADDR_ALIGNMENT(x) ((unsigned char *)(((unsigned long)(x) + (FEC_ALIGNMENT)) & (~FEC_ALIGNMENT))) ++ ++#if 0 + /* + * Define the fixed address of the FEC hardware. + */ ++/* USE resources provided by platform_device! */ ++static unsigned int fec_hw[] = { + #if defined(CONFIG_M5272) +-#define HAVE_mii_link_interrupt +- +-static unsigned char fec_mac_default[] = { +- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ++ (MCF_MBAR + 0x840), ++#elif defined(CONFIG_M527x) ++ (MCF_MBAR + 0x1000), ++ (MCF_MBAR + 0x1800), ++#elif defined(CONFIG_M523x) || defined(CONFIG_M528x) ++ (MCF_MBAR + 0x1000), ++#elif defined(CONFIG_M520x) ++ (MCF_MBAR+0x30000), ++#elif defined(CONFIG_M532x) ++ (MCF_MBAR+0xfc030000), ++#elif defined(CONFIG_ARCH_MXC) ++ (IO_ADDRESS(FEC_BASE_ADDR)), ++#else ++ &(((immap_t *)IMAP_ADDR)->im_cpm.cp_fec), ++#endif + }; ++#endif + ++#if 0 + /* + * Some hardware gets it MAC address out of local flash memory. + * if this is non-zero then assume it is the address to get MAC from. + */ ++/* implemented using platform_data! */ + #if defined(CONFIG_NETtel) + #define FEC_FLASHMAC 0xf0006006 + #elif defined(CONFIG_GILBARCONAP) || defined(CONFIG_SCALES) + #define FEC_FLASHMAC 0xf0006000 ++#elif defined (CONFIG_MTD_KeyTechnology) ++#define FEC_FLASHMAC 0xffe04000 + #elif defined(CONFIG_CANCam) + #define FEC_FLASHMAC 0xf0020000 + #elif defined (CONFIG_M5272C3) + #define FEC_FLASHMAC (0xffe04000 + 4) + #elif defined(CONFIG_MOD5272) +-#define FEC_FLASHMAC 0xffc0406b ++#define FEC_FLASHMAC 0xffc0406b + #else + #define FEC_FLASHMAC 0 + #endif +-#endif /* CONFIG_M5272 */ ++#endif ++ ++#define platform_func(p, args...) ((p) ? (p)(args) : 0) + + /* Forward declarations of some structures to support different PHYs + */ +- ++#ifndef CONFIG_PHYLIB + typedef struct { + uint mii_data; + void (*funct)(uint mii_reg, struct net_device *dev); +@@ -103,6 +155,7 @@ typedef struct { + const phy_cmd_t *ack_int; + const phy_cmd_t *shutdown; + } phy_info_t; ++#endif + + /* The number of Tx and Rx buffers. These are allocated from the page + * pool. The code may assume these are power of two, so it it best +@@ -116,12 +169,13 @@ typedef struct { + #define RX_RING_SIZE (FEC_ENET_RX_FRPPG * FEC_ENET_RX_PAGES) + #define FEC_ENET_TX_FRSIZE 2048 + #define FEC_ENET_TX_FRPPG (PAGE_SIZE / FEC_ENET_TX_FRSIZE) +-#define TX_RING_SIZE 16 /* Must be power of two */ +-#define TX_RING_MOD_MASK 15 /* for this to work */ ++#define TX_RING_SIZE 16 /* Must be power of two */ ++#define TX_RING_MOD_MASK (TX_RING_SIZE - 1) /* for this to work */ + + #if (((RX_RING_SIZE + TX_RING_SIZE) * 8) > PAGE_SIZE) + #error "FEC: descriptor ring size constants too large" + #endif ++#define CBD_BUF_SIZE ((RX_RING_SIZE + TX_RING_SIZE) * sizeof(cbd_t)) + + /* Interrupt events/masks. + */ +@@ -136,6 +190,17 @@ typedef struct { + #define FEC_ENET_MII ((uint)0x00800000) /* MII interrupt */ + #define FEC_ENET_EBERR ((uint)0x00400000) /* SDMA bus error */ + ++/* MXC arch interrupt bits */ ++#define FEC_ENET_LC ((uint)0x00200000) /* Late collision */ ++#define FEC_ENET_RL ((uint)0x00100000) /* Collision retry limit exceeded */ ++#define FEC_ENET_UN ((uint)0x00080000) /* TX Fifo underrun */ ++ ++#ifndef CONFIG_ARCH_MXC ++#define FEC_ENET_MASK ((uint)0xffc00000) ++#else ++#define FEC_ENET_MASK ((uint)0xfff80000) ++#endif ++ + /* The FEC stores dest/src/type, data, and checksum for receive packets. + */ + #define PKT_MAXBUF_SIZE 1518 +@@ -150,7 +215,7 @@ typedef struct { + */ + #if defined(CONFIG_M523x) || defined(CONFIG_M527x) || defined(CONFIG_M528x) || \ + defined(CONFIG_M520x) || defined(CONFIG_M532x) || defined(CONFIG_ARCH_MXC) +-#define OPT_FRAME_SIZE (PKT_MAXBUF_SIZE << 16) ++#define OPT_FRAME_SIZE (RCR_MAX_FL_set(PKT_MAXBUF_SIZE)) + #else + #define OPT_FRAME_SIZE 0 + #endif +@@ -165,31 +230,45 @@ typedef struct { + */ + struct fec_enet_private { + /* Hardware registers of the FEC device */ +- volatile fec_t *hwp; +- +- struct net_device *netdev; +- +- struct clk *clk; ++ void __iomem *reg_base; ++ void __iomem *mib_base; ++ struct resource *res_mem1; ++ struct resource *res_mem2; ++ int etn_irq; ++ int mii_irq; ++#ifndef CONFIG_PHYLIB ++ struct timer_list *phy_timer; ++#else ++ struct mii_bus *mii; ++ int mii_complete; ++#endif ++ u32 msg_enable; + + /* The saved address of a sent-in-place packet/buffer, for skfree(). */ +- unsigned char *tx_bounce[TX_RING_SIZE]; ++ void *tx_bounce[TX_RING_SIZE]; + struct sk_buff* tx_skbuff[TX_RING_SIZE]; ++ struct sk_buff* rx_skbuff[RX_RING_SIZE]; + ushort skb_cur; + ushort skb_dirty; + + /* CPM dual port RAM relative addresses. + */ +- dma_addr_t bd_dma; ++ struct device *dma_dev; /* pointer to (platform_)device for dma_sync*() functions */ ++ void *cbd_mem_base; /* save the virtual base address of rx&tx buffer descriptor */ ++ dma_addr_t cbd_phys_base; /* physical address of buffer descriptor memory for access by FEC HW */ ++ + cbd_t *rx_bd_base; /* Address of Rx and Tx buffers. */ + cbd_t *tx_bd_base; +- cbd_t *cur_rx, *cur_tx; /* The next free ring entry */ +- cbd_t *dirty_tx; /* The ring entries to be free()ed. */ ++ cbd_t *cur_rx, *cur_tx; /* The next free ring entry */ ++ cbd_t *dirty_tx; /* The ring entries to be free()ed. */ ++ struct net_device_stats stats; + uint tx_full; +- /* hold while accessing the HW like ringbuffer for tx/rx but not MAC */ +- spinlock_t hw_lock; +- /* hold while accessing the mii_list_t() elements */ +- spinlock_t mii_lock; ++ spinlock_t lock; + ++#ifdef CONFIG_PHYLIB ++ struct phy_device *phy; ++ uint phy_speed; ++#else + uint phy_id; + uint phy_id_done; + uint phy_status; +@@ -199,28 +278,41 @@ struct fec_enet_private { + + uint sequence_done; + uint mii_phy_task_queued; +- ++#endif + uint phy_addr; + +- int index; +- int opened; +- int link; +- int old_link; +- int full_duplex; ++ unsigned int opened:1; ++ unsigned int phy_int_enabled:1; ++ unsigned int linkstatus:1; ++#ifndef CONFIG_PHYLIB ++ unsigned int old_linkstatus:1; ++#endif ++ unsigned int full_duplex:1; ++ ++ struct clk *clk; + }; + +-static int fec_enet_open(struct net_device *dev); +-static int fec_enet_start_xmit(struct sk_buff *skb, struct net_device *dev); +-static void fec_enet_mii(struct net_device *dev); +-static irqreturn_t fec_enet_interrupt(int irq, void * dev_id); ++#ifdef CONFIG_PHYLIB ++static int fec_connect_phy(struct net_device *dev, struct fec_enet_private *fep); ++#else ++static irqreturn_t mii_link_interrupt(int irq, void *dev_id); ++#endif ++static void fec_restart(struct net_device *dev, int duplex); + static void fec_enet_tx(struct net_device *dev); + static void fec_enet_rx(struct net_device *dev); +-static int fec_enet_close(struct net_device *dev); +-static void set_multicast_list(struct net_device *dev); +-static void fec_restart(struct net_device *dev, int duplex); ++static void fec_enet_mii(struct net_device *dev); + static void fec_stop(struct net_device *dev); +-static void fec_set_mac_address(struct net_device *dev); ++static void _fec_set_mac_address(struct net_device *dev); + ++/* ++ * fec_copy_threshold controls the copy when receiving ethernet frame. ++ * If ethernet header is aligned on a 4byte boundary, the ip header and ++ * higher level header will not be aligned. ++ * The reason is, that an ethernet header is 14bytes long. ++ * And the max size of tcp & ip header is 128bytes. Normally it is 40bytes. ++ * So I set the default value between 128 to 256. ++ */ ++static int fec_copy_threshold = 192; + + /* MII processing. We keep this as simple as possible. Requests are + * placed on the list (if there is room). When the request is finished +@@ -232,14 +324,16 @@ typedef struct mii_list { + struct mii_list *mii_next; + } mii_list_t; + ++#ifndef CONFIG_PHYLIB + #define NMII 20 + static mii_list_t mii_cmds[NMII]; + static mii_list_t *mii_free; + static mii_list_t *mii_head; + static mii_list_t *mii_tail; + +-static int mii_queue(struct net_device *dev, int request, +- void (*func)(uint, struct net_device *)); ++static int mii_queue(struct net_device *dev, int request, ++ void (*func)(uint, struct net_device *)); ++#endif + + /* Make MII read/write commands for the FEC. + */ +@@ -284,87 +378,233 @@ 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 */ + ++#ifndef DEBUG ++static inline unsigned long fec_reg_read(struct fec_enet_private *fep, unsigned int reg) ++{ ++ return readl(fep->reg_base + reg); ++} ++ ++static inline void fec_reg_write(struct fec_enet_private *fep, unsigned int reg, unsigned long val) ++{ ++ writel(val, fep->reg_base + reg); ++} ++#else ++#define fec_reg_read(fep, reg) __fec_reg_read(fep, reg, __FUNCTION__, #reg) ++#define fec_reg_write(fep, reg, val) __fec_reg_write(fep, reg, val, __FUNCTION__, #reg) ++ ++static inline unsigned long __fec_reg_read(struct fec_enet_private *fep, unsigned int reg, ++ const char *func, const char *reg_name) ++{ ++ unsigned long val = readl(fep->reg_base + reg); ++ DBG(3, "%s: Read %08lx from %s(%03x)\n", func, val, reg_name, reg); ++ return val; ++} ++ ++static inline void __fec_reg_write(struct fec_enet_private *fep, unsigned int reg, ++ unsigned long val, const char *func, const char *reg_name) ++{ ++ DBG(3, "%s: Writing %08lx to %s(%03x)\n", func, val, reg_name, reg); ++ writel(val, fep->reg_base + reg); ++} ++#endif ++ ++static inline void fec_enet_cbd_get(struct fec_enet_private *fep) ++{ ++ DBG(2, "%s: Requesting cbd area: %08lx\n", __FUNCTION__, ++ (unsigned long)fep->cbd_phys_base); ++ dma_sync_single_for_cpu(fep->dma_dev, fep->cbd_phys_base, ++ CBD_BUF_SIZE, DMA_BIDIRECTIONAL); ++} ++ ++static inline void fec_enet_cbd_put(struct fec_enet_private *fep) ++{ ++ DBG(2, "%s: Flushing changes to cbd area\n", __FUNCTION__); ++ dma_sync_single_for_device(fep->dma_dev, fep->cbd_phys_base, ++ CBD_BUF_SIZE, DMA_BIDIRECTIONAL); ++} ++ ++static inline void fec_enet_rxbuf_get(struct fec_enet_private *fep, cbd_t *bdp, ushort len) ++{ ++ DBG(2, "%s: Requesting RX buffer %08lx(%u)\n", __FUNCTION__, ++ (unsigned long)bdp->cbd_bufaddr, len); ++ dma_sync_single_for_cpu(fep->dma_dev, bdp->cbd_bufaddr, ++ len, DMA_FROM_DEVICE); ++} ++ ++static inline void fec_enet_rxbuf_put(struct fec_enet_private *fep, cbd_t *bdp, ushort len) ++{ ++ DBG(2, "%s: Releasing RX buffer %08lx(%u)\n", __FUNCTION__, (ulong)bdp->cbd_bufaddr, len); ++ dma_sync_single_for_device(fep->dma_dev, bdp->cbd_bufaddr, len, DMA_FROM_DEVICE); ++} ++ ++static inline void fec_enet_rxbuf_map(struct fec_enet_private *fep, cbd_t *bdp, ++ void *buf, ushort len) ++{ ++ BUG_ON(!dma_mapping_error(fep->dma_dev, bdp->cbd_bufaddr)); ++ bdp->cbd_bufaddr = dma_map_single(fep->dma_dev, buf, ++ len, DMA_FROM_DEVICE); ++ DBG(2, "%s: RX buffer %p(%u) mapped to %08lx\n", __FUNCTION__, ++ buf, len, (unsigned long)bdp->cbd_bufaddr); ++} ++ ++static inline void fec_enet_rxbuf_unmap(struct fec_enet_private *fep, cbd_t *bdp, ushort len) ++{ ++ DBG(2, "%s: Unmapping RX buffer %08lx(%u)\n", __FUNCTION__, ++ (unsigned long)bdp->cbd_bufaddr, len); ++ BUG_ON(dma_mapping_error(fep->dma_dev, bdp->cbd_bufaddr)); ++ dma_unmap_single(fep->dma_dev, bdp->cbd_bufaddr, ++ len, DMA_FROM_DEVICE); ++ bdp->cbd_bufaddr = ~0; ++} ++ ++static inline void fec_enet_txbuf_map(struct fec_enet_private *fep, cbd_t *bdp, ++ void *buf, ushort len) ++{ ++ BUG_ON(!dma_mapping_error(fep->dma_dev, bdp->cbd_bufaddr)); ++ bdp->cbd_bufaddr = dma_map_single(fep->dma_dev, buf, ++ len, DMA_TO_DEVICE); ++ DBG(2, "%s: TX buffer %p(%u) mapped to %08lx\n", __FUNCTION__, ++ buf, len, (unsigned long)bdp->cbd_bufaddr); ++} ++ ++static inline void fec_enet_txbuf_unmap(struct fec_enet_private *fep, cbd_t *bdp, ushort len) ++{ ++ DBG(2, "%s: Unmapping TX buffer %08lx(%u)\n", __FUNCTION__, ++ (unsigned long)bdp->cbd_bufaddr, len); ++ BUG_ON(dma_mapping_error(fep->dma_dev, bdp->cbd_bufaddr)); ++ dma_unmap_single(fep->dma_dev, bdp->cbd_bufaddr, ++ len, DMA_TO_DEVICE); ++ bdp->cbd_bufaddr = ~0; ++} ++ ++static inline void fec_enet_txbuf_get(struct fec_enet_private *fep, cbd_t *bdp, ushort len) ++{ ++ DBG(2, "%s: Requesting TX buffer %08lx(%u)\n", __FUNCTION__, ++ (unsigned long)bdp->cbd_bufaddr, len); ++ dma_sync_single_for_cpu(fep->dma_dev, bdp->cbd_bufaddr, ++ len, DMA_TO_DEVICE); ++} ++ ++static inline void fec_enet_txbuf_put(struct fec_enet_private *fep, cbd_t *bdp, ushort len) ++{ ++ DBG(2, "%s: Releasing TX buffer %08lx(%u)\n", __FUNCTION__, ++ (unsigned long)bdp->cbd_bufaddr, len); ++ 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) + { +- struct fec_enet_private *fep; +- volatile fec_t *fecp; +- volatile cbd_t *bdp; +- unsigned short status; ++ struct fec_enet_private *fep = netdev_priv(dev); ++ cbd_t *bdp; ++ unsigned short status; + unsigned long flags; + +- fep = netdev_priv(dev); +- fecp = (volatile fec_t*)dev->base_addr; +- +- if (!fep->link) { ++ if (!fep->linkstatus) { ++ DBG(0, "%s: Cannot send packet; link is down\n", __FUNCTION__); + /* Link is down or autonegotiation is in progress. */ + return 1; + } + +- 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 */ + bdp = fep->cur_tx; + + status = bdp->cbd_sc; +-#ifndef final_version ++#ifdef DEBUG + if (status & BD_ENET_TX_READY) { + /* Ooops. All transmit buffers are full. Bail out. + * This should not happen, since dev->tbusy should be set. + */ + printk("%s: tx queue full!.\n", dev->name); +- spin_unlock_irqrestore(&fep->hw_lock, flags); ++ fec_enet_cbd_put(fep); ++ spin_unlock_irqrestore(&fep->lock, flags); + return 1; + } + #endif +- + /* Clear all of the status flags. + */ + status &= ~BD_ENET_TX_STATS; + + /* Set buffer length and buffer pointer. + */ +- 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 + * 4-byte boundaries. Use bounce buffers to copy data + * and get it aligned. Ugh. + */ +- if (bdp->cbd_bufaddr & FEC_ALIGNMENT) { ++ if (unlikely((bdp->cbd_bufaddr) & FEC_ALIGNMENT)) { + unsigned int index; + index = bdp - fep->tx_bd_base; +- memcpy(fep->tx_bounce[index], (void *)skb->data, skb->len); +- bdp->cbd_bufaddr = __pa(fep->tx_bounce[index]); ++ memcpy(fep->tx_bounce[index], skb->data, skb->len); ++ fec_enet_txbuf_map(fep, bdp, fep->tx_bounce[index], skb->len); ++ } else { ++ fec_enet_txbuf_map(fep, bdp, skb->data, skb->len); + } + + /* Save skb pointer. + */ + fep->tx_skbuff[fep->skb_cur] = skb; + +- dev->stats.tx_bytes += skb->len; +- fep->skb_cur = (fep->skb_cur+1) & TX_RING_MOD_MASK; +- +- /* Push the data cache so the CPM does not get stale memory +- * data. +- */ +- dma_sync_single(NULL, bdp->cbd_bufaddr, +- bdp->cbd_datlen, DMA_TO_DEVICE); ++ fep->stats.tx_bytes += skb->len; ++ fep->skb_cur = (fep->skb_cur + 1) & TX_RING_MOD_MASK; + + /* Send it on its way. Tell FEC it's ready, interrupt when done, + * it's the last BD of the frame, and to put the CRC on the end. + */ +- + status |= (BD_ENET_TX_READY | BD_ENET_TX_INTR + | BD_ENET_TX_LAST | BD_ENET_TX_TC); + bdp->cbd_sc = status; + + dev->trans_start = jiffies; + +- /* Trigger transmission start */ +- fecp->fec_x_des_active = 0; +- + /* 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, + + if (bdp == fep->dirty_tx) { + fep->tx_full = 1; ++ DBG(0, "TX ring full, stopping netif queue\n"); + netif_stop_queue(dev); + } + +- 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; + } +@@ -390,101 +640,126 @@ fec_timeout(struct net_device *dev) + { + struct fec_enet_private *fep = netdev_priv(dev); + +- printk("%s: transmit timed out.\n", dev->name); +- dev->stats.tx_errors++; +-#ifndef final_version ++ printk(KERN_WARNING "%s: transmit timed out.\n", dev->name); ++ fep->stats.tx_errors++; ++#ifdef DEBUG + { +- int i; +- cbd_t *bdp; ++ int i; ++ cbd_t *bdp; + +- printk("Ring data dump: cur_tx %lx%s, dirty_tx %lx cur_rx: %lx\n", +- (unsigned long)fep->cur_tx, fep->tx_full ? " (full)" : "", +- (unsigned long)fep->dirty_tx, +- (unsigned long)fep->cur_rx); ++ fec_enet_cbd_get(fep); + +- bdp = fep->tx_bd_base; +- printk(" tx: %u buffers\n", TX_RING_SIZE); +- for (i = 0 ; i < TX_RING_SIZE; i++) { +- printk(" %08x: %04x %04x %08x\n", +- (uint) bdp, +- bdp->cbd_sc, +- bdp->cbd_datlen, +- (int) bdp->cbd_bufaddr); +- bdp++; +- } ++ printk(KERN_DEBUG "%s: Ring data dump: cur_tx %p%s, dirty_tx %p cur_rx: %p\n", ++ __FUNCTION__, ++ fep->cur_tx, fep->tx_full ? " (full)" : "", ++ fep->dirty_tx, ++ fep->cur_rx); + +- bdp = fep->rx_bd_base; +- printk(" rx: %lu buffers\n", (unsigned long) RX_RING_SIZE); +- for (i = 0 ; i < RX_RING_SIZE; i++) { +- printk(" %08x: %04x %04x %08x\n", +- (uint) bdp, +- bdp->cbd_sc, +- bdp->cbd_datlen, +- (int) bdp->cbd_bufaddr); +- bdp++; +- } ++ bdp = fep->tx_bd_base; ++ printk(" tx: %u buffers\n", TX_RING_SIZE); ++ for (i = 0; i < TX_RING_SIZE; i++) { ++ printk(" %p: %04x %04x %08x\n", ++ bdp, ++ bdp->cbd_sc, ++ bdp->cbd_datlen, ++ bdp->cbd_bufaddr); ++ bdp++; ++ } ++ ++ bdp = fep->rx_bd_base; ++ printk(" rx: %lu buffers\n", RX_RING_SIZE); ++ for (i = 0; i < RX_RING_SIZE; i++) { ++ printk(" %p: %04x %04x %08x\n", ++ bdp, ++ bdp->cbd_sc, ++ bdp->cbd_datlen, ++ bdp->cbd_bufaddr); ++ bdp++; ++ } ++ fec_enet_cbd_put(fep); + } + #endif + fec_restart(dev, fep->full_duplex); +- netif_wake_queue(dev); ++ DBG(0, "%s: Scheduling netif queue\n", __FUNCTION__); ++ //netif_schedule(dev); + } + + /* The interrupt handler. + * This is called from the MPC core interrupt. + */ + static irqreturn_t +-fec_enet_interrupt(int irq, void * dev_id) ++fec_enet_interrupt(int irq, void *dev_id) + { +- struct net_device *dev = dev_id; +- volatile fec_t *fecp; +- uint int_events; +- irqreturn_t ret = IRQ_NONE; +- +- fecp = (volatile fec_t*)dev->base_addr; ++ struct net_device *dev = dev_id; ++ struct fec_enet_private *fep = netdev_priv(dev); ++ uint int_events; ++ int handled = 0; ++ unsigned int eimr = fec_reg_read(fep, FEC_EIMR); + ++ DBG(2, "%s: %08lx:%08lx\n", __FUNCTION__, ++ fec_reg_read(fep, FEC_EIR), fec_reg_read(fep, FEC_EIMR)); + /* Get the interrupt events that caused us to be here. + */ +- do { +- int_events = fecp->fec_ievent; +- fecp->fec_ievent = int_events; ++ while ((int_events = fec_reg_read(fep, FEC_EIR) & FEC_ENET_MASK) != 0) { ++ if (int_events & ~eimr) { ++ printk(KERN_WARNING "%s: masked interrupt condition: %08x\n", ++ __FUNCTION__, int_events & ~eimr); ++ } ++ ++ fec_reg_write(fep, FEC_EIR, int_events); + + /* Handle receive event in its own function. + */ +- if (int_events & FEC_ENET_RXF) { +- ret = IRQ_HANDLED; ++ if (int_events & (FEC_ENET_RXF | FEC_ENET_RXB)) { ++ DBG(2, "%s: Handling RX Interrupt\n", __FUNCTION__); ++ handled = 1; + fec_enet_rx(dev); + } + ++ if (int_events & FEC_ENET_UN) { ++ printk(KERN_WARNING "TX fifo underrun"); ++ } + /* Transmit OK, or non-fatal error. Update the buffer + descriptors. FEC handles all errors, we just discover + them as part of the transmit process. + */ +- if (int_events & FEC_ENET_TXF) { +- ret = IRQ_HANDLED; ++ if (int_events & (FEC_ENET_TXF | FEC_ENET_TXB)) { ++ DBG(2, "%s: Handling TX Interrupt\n", __FUNCTION__); ++ handled = 1; + fec_enet_tx(dev); + } + +- if (int_events & FEC_ENET_MII) { +- ret = IRQ_HANDLED; ++ if (int_events & (FEC_ENET_MII | FEC_ENET_HBERR)) { ++ DBG(2, "%s: Handling MII Interrupt\n", __FUNCTION__); ++ handled = 1; + fec_enet_mii(dev); + } +- +- } while (int_events); +- +- return ret; ++ } ++ return IRQ_RETVAL(handled); + } + ++static void fec_free_skb(struct fec_enet_private *fep, cbd_t *bdp, struct sk_buff **pskb) ++{ ++ struct sk_buff *skb = *pskb; ++ if (!dma_mapping_error(fep->dma_dev, bdp->cbd_bufaddr)) { ++ fec_enet_txbuf_unmap(fep, bdp, skb->len); ++ } ++ dev_kfree_skb_any(skb); ++ *pskb = NULL; ++} + + static void + fec_enet_tx(struct net_device *dev) + { +- struct fec_enet_private *fep; +- volatile cbd_t *bdp; ++ struct fec_enet_private *fep = netdev_priv(dev); ++ cbd_t *bdp; + unsigned short status; +- struct sk_buff *skb; ++ struct sk_buff *skb; + +- fep = netdev_priv(dev); +- 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) + if (status & (BD_ENET_TX_HB | BD_ENET_TX_LC | + BD_ENET_TX_RL | BD_ENET_TX_UN | + BD_ENET_TX_CSL)) { +- dev->stats.tx_errors++; ++ fep->stats.tx_errors++; + if (status & BD_ENET_TX_HB) /* No heartbeat */ +- dev->stats.tx_heartbeat_errors++; ++ fep->stats.tx_heartbeat_errors++; + if (status & BD_ENET_TX_LC) /* Late collision */ +- dev->stats.tx_window_errors++; ++ fep->stats.tx_window_errors++; + if (status & BD_ENET_TX_RL) /* Retrans limit */ +- dev->stats.tx_aborted_errors++; ++ fep->stats.tx_aborted_errors++; + if (status & BD_ENET_TX_UN) /* Underrun */ +- dev->stats.tx_fifo_errors++; ++ fep->stats.tx_fifo_errors++; + if (status & BD_ENET_TX_CSL) /* Carrier lost */ +- dev->stats.tx_carrier_errors++; ++ fep->stats.tx_carrier_errors++; + } else { +- dev->stats.tx_packets++; ++ fep->stats.tx_packets++; + } + +-#ifndef final_version ++#ifdef DEBUG + 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) + * 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); +- fep->tx_skbuff[fep->skb_dirty] = NULL; ++ fec_free_skb(fep, bdp, &fep->tx_skbuff[fep->skb_dirty]); + 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) + */ + if (fep->tx_full) { + fep->tx_full = 0; +- if (netif_queue_stopped(dev)) ++ if (netif_queue_stopped(dev)) { ++ DBG(0, "%s: Waking up netif queue\n", __FUNCTION__); + netif_wake_queue(dev); ++ } + } + } +- fep->dirty_tx = (cbd_t *)bdp; +- spin_unlock_irq(&fep->hw_lock); ++ fec_enet_cbd_put(fep); ++ fep->dirty_tx = bdp; ++ spin_unlock(&fep->lock); + } + + +@@ -555,22 +834,22 @@ fec_enet_tx(struct net_device *dev) + static void + fec_enet_rx(struct net_device *dev) + { +- struct fec_enet_private *fep; +- volatile fec_t *fecp; +- volatile cbd_t *bdp; ++ struct fec_enet_private *fep = netdev_priv(dev); ++ cbd_t *bdp; + unsigned short status; +- struct sk_buff *skb; +- ushort pkt_len; +- __u8 *data; ++ struct sk_buff *skb; ++ ushort pkt_len; ++ int rx_index; + + #ifdef CONFIG_M532x ++ /* This is probably nonsense ++ Proper use of dma-mapping functions should make this obsolete ++ */ + flush_cache_all(); + #endif +- +- fep = netdev_priv(dev); +- fecp = (volatile fec_t*)dev->base_addr; +- +- spin_lock_irq(&fep->hw_lock); ++ /* reserve the dual port memory area for our use */ ++ //WARN_ON(fec_reg_read(fep, FEC_RDAR) & RDAR_BUSY); ++ fec_enet_cbd_get(fep); + + /* 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) + bdp = fep->cur_rx; + + while (!((status = bdp->cbd_sc) & BD_ENET_RX_EMPTY)) { +- +-#ifndef final_version ++ rx_index = bdp - fep->rx_bd_base; ++#ifdef DEBUG + /* Since we have allocated space to hold a complete frame, + * the last indicator should be set. + */ +- if ((status & BD_ENET_RX_LAST) == 0) +- printk("FEC ENET: rcv is not +last\n"); ++ WARN_ON(!(status & BD_ENET_RX_LAST)); + #endif + +- if (!fep->opened) ++ if (WARN_ON(!fep->opened)) { ++ DBG(0, "%s: Driver not opened; ignoring packet\n", __FUNCTION__); ++#if 0 + goto rx_processing_done; +- ++#endif ++ } + /* Check for errors. */ + if (status & (BD_ENET_RX_LG | BD_ENET_RX_SH | BD_ENET_RX_NO | + BD_ENET_RX_CR | BD_ENET_RX_OV)) { +- dev->stats.rx_errors++; ++ fep->stats.rx_errors++; + if (status & (BD_ENET_RX_LG | BD_ENET_RX_SH)) { + /* Frame too long or too short. */ +- dev->stats.rx_length_errors++; ++ fep->stats.rx_length_errors++; + } + if (status & BD_ENET_RX_NO) /* Frame alignment */ +- dev->stats.rx_frame_errors++; ++ fep->stats.rx_frame_errors++; + if (status & BD_ENET_RX_CR) /* CRC Error */ +- dev->stats.rx_crc_errors++; ++ fep->stats.rx_crc_errors++; + if (status & BD_ENET_RX_OV) /* FIFO overrun */ +- dev->stats.rx_fifo_errors++; ++ fep->stats.rx_fifo_errors++; + } + + /* Report late collisions as a frame error. +@@ -611,39 +892,91 @@ 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) { +- dev->stats.rx_errors++; +- dev->stats.rx_frame_errors++; ++ 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 + /* Process the incoming frame. + */ +- dev->stats.rx_packets++; ++ fep->stats.rx_packets++; + pkt_len = bdp->cbd_datlen; +- dev->stats.rx_bytes += pkt_len; +- data = (__u8*)__va(bdp->cbd_bufaddr); +- +- dma_sync_single(NULL, (unsigned long)__pa(data), +- pkt_len - 4, DMA_FROM_DEVICE); ++ fep->stats.rx_bytes += pkt_len; + + /* This does 16 byte alignment, exactly what we need. + * The packet length includes FCS, but we don't want to + * include that when passing upstream as it messes up + * bridging applications. + */ +- skb = dev_alloc_skb(pkt_len-4); ++ if ((pkt_len - 4) < fec_copy_threshold) { ++ skb = dev_alloc_skb(pkt_len); ++ } else { ++ skb = dev_alloc_skb(FEC_ENET_RX_FRSIZE); ++ } + + if (skb == NULL) { + printk("%s: Memory squeeze, dropping packet.\n", dev->name); +- dev->stats.rx_dropped++; ++ fep->stats.rx_dropped++; + } else { +- skb_put(skb,pkt_len-4); /* Make room */ +- skb_copy_to_linear_data(skb, data, pkt_len-4); +- skb->protocol=eth_type_trans(skb,dev); ++ if ((pkt_len - 4) < fec_copy_threshold) { ++ /* skip 2 bytes, so IP header is on a 4 bytes boundary */ ++ skb_reserve(skb, 2); ++ skb_put(skb, pkt_len - 4); /* Make room */ ++ fec_enet_rxbuf_get(fep, bdp, pkt_len - 4); ++ skb_copy_to_linear_data(skb, ++ fep->rx_skbuff[rx_index]->data, ++ pkt_len - 4); ++ fec_enet_rxbuf_put(fep, bdp, pkt_len - 4); ++ } else { ++ struct sk_buff *pskb = fep->rx_skbuff[rx_index]; ++ ++ /* unmap the skb we are going to hand down to the network layer */ ++ fec_enet_rxbuf_unmap(fep, bdp, FEC_ENET_RX_FRSIZE); ++ ++ /* init the newly allocated skb */ ++ fep->rx_skbuff[rx_index] = skb; ++ skb->data = FEC_ADDR_ALIGNMENT(skb->data); ++ /* map the newly allocated skb's data buffer for DMA */ ++ fec_enet_rxbuf_map(fep, bdp, skb->data, FEC_ENET_RX_FRSIZE); ++ ++ skb_put(pskb, pkt_len - 4); /* Make room */ ++ skb = pskb; ++ } ++ skb->dev = dev; ++ skb->protocol = eth_type_trans(skb, dev); + netif_rx(skb); + } + 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 + status |= BD_ENET_RX_EMPTY; + bdp->cbd_sc = status; + ++ /* release the dual port memory area for use by the FEC hardware */ ++ fec_enet_cbd_put(fep); ++ + /* Update BD pointer to next entry. + */ + if (status & BD_ENET_RX_WRAP) +@@ -665,10 +1001,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. + */ +- fecp->fec_r_des_active = 0; ++ fec_reg_write(fep, FEC_RDAR, DONT_CARE); + #endif + } /* while (!((status = bdp->cbd_sc) & BD_ENET_RX_EMPTY)) */ +- fep->cur_rx = (cbd_t *)bdp; ++ fep->cur_rx = bdp; + + #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 + * our way back to the interrupt return only to come right back + * here. + */ +- fecp->fec_r_des_active = 0; ++ fec_reg_write(fep, FEC_RDAR, DONT_CARE); + #endif +- +- spin_unlock_irq(&fep->hw_lock); + } + +- ++#ifdef CONFIG_PHYLIB + /* called from interrupt context */ ++static void fec_enet_mii(struct net_device *dev) ++{ ++ struct fec_enet_private *fep = netdev_priv(dev); ++ fep->mii_complete = 1; ++} ++#else + static void + fec_enet_mii(struct net_device *dev) + { +- struct fec_enet_private *fep; +- volatile fec_t *ep; ++ struct fec_enet_private *fep = netdev_priv(dev); + mii_list_t *mip; + uint mii_reg; + +- fep = netdev_priv(dev); +- spin_lock_irq(&fep->mii_lock); ++ mii_reg = fec_reg_read(fep, FEC_MMFR); + +- ep = fep->hwp; +- mii_reg = ep->fec_mii_data; ++ spin_lock(&fep->lock); + + if ((mip = mii_head) == NULL) { + printk("MII and no head!\n"); +@@ -713,27 +1050,27 @@ fec_enet_mii(struct net_device *dev) + mii_free = mip; + + if ((mip = mii_head) != NULL) +- ep->fec_mii_data = mip->mii_regval; ++ fec_reg_write(fep, FEC_MMFR, mip->mii_regval); + + unlock: +- spin_unlock_irq(&fep->mii_lock); ++ spin_unlock(&fep->lock); + } + + static int + mii_queue(struct net_device *dev, int regval, void (*func)(uint, struct net_device *)) + { +- struct fec_enet_private *fep; ++ struct fec_enet_private *fep = netdev_priv(dev); + unsigned long flags; + mii_list_t *mip; + int retval; + ++ retval = 0; ++ ++ spin_lock_irqsave(&fep->lock,flags); ++ + /* Add PHY address to register command. + */ +- fep = netdev_priv(dev); +- spin_lock_irqsave(&fep->mii_lock, flags); +- + regval |= fep->phy_addr << 23; +- retval = 0; + + if ((mip = mii_free) != NULL) { + mii_free = mip->mii_next; +@@ -745,32 +1082,32 @@ mii_queue(struct net_device *dev, int re + mii_tail = mip; + } else { + mii_head = mii_tail = mip; +- fep->hwp->fec_mii_data = regval; ++ fec_reg_write(fep, FEC_MMFR, regval); + } + } else { + retval = 1; + } + +- spin_unlock_irqrestore(&fep->mii_lock, flags); +- return retval; ++ spin_unlock_irqrestore(&fep->lock,flags); ++ ++ return(retval); + } + + static void mii_do_cmd(struct net_device *dev, const phy_cmd_t *c) + { +- if(!c) +- return; ++ int k; + +- for (; c->mii_data != mk_mii_end; c++) +- mii_queue(dev, c->mii_data, c->funct); ++ for (k = 0; c != NULL && c[k].mii_data != mk_mii_end; k++) { ++ mii_queue(dev, c[k].mii_data, c[k].funct); ++ } + } + + static void mii_parse_sr(uint mii_reg, struct net_device *dev) + { + struct fec_enet_private *fep = netdev_priv(dev); +- volatile uint *s = &(fep->phy_status); + uint status; + +- status = *s & ~(PHY_STAT_LINK | PHY_STAT_FAULT | PHY_STAT_ANC); ++ status = fep->phy_status & ~(PHY_STAT_LINK | PHY_STAT_FAULT | PHY_STAT_ANC); + + if (mii_reg & 0x0004) + status |= PHY_STAT_LINK; +@@ -778,31 +1115,30 @@ static void mii_parse_sr(uint mii_reg, s + status |= PHY_STAT_FAULT; + if (mii_reg & 0x0020) + status |= PHY_STAT_ANC; +- *s = status; ++ ++ fep->phy_status = status; + } + + static void mii_parse_cr(uint mii_reg, struct net_device *dev) + { + struct fec_enet_private *fep = netdev_priv(dev); +- volatile uint *s = &(fep->phy_status); + uint status; + +- status = *s & ~(PHY_CONF_ANE | PHY_CONF_LOOP); ++ status = fep->phy_status & ~(PHY_CONF_ANE | PHY_CONF_LOOP); + + if (mii_reg & 0x1000) + status |= PHY_CONF_ANE; + if (mii_reg & 0x4000) + status |= PHY_CONF_LOOP; +- *s = status; ++ fep->phy_status = status; + } + + static void mii_parse_anar(uint mii_reg, struct net_device *dev) + { + struct fec_enet_private *fep = netdev_priv(dev); +- volatile uint *s = &(fep->phy_status); + uint status; + +- status = *s & ~(PHY_CONF_SPMASK); ++ status = fep->phy_status & ~(PHY_CONF_SPMASK); + + if (mii_reg & 0x0020) + status |= PHY_CONF_10HDX; +@@ -812,7 +1148,7 @@ static void mii_parse_anar(uint mii_reg, + status |= PHY_CONF_100HDX; + if (mii_reg & 0x00100) + status |= PHY_CONF_100FDX; +- *s = status; ++ fep->phy_status = status; + } + + /* ------------------------------------------------------------------------- */ +@@ -827,10 +1163,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); +- volatile uint *s = &(fep->phy_status); + uint status; + +- status = *s & ~(PHY_STAT_SPMASK); ++ status = fep->phy_status & ~(PHY_STAT_SPMASK); + if (mii_reg & 0x0800) { + if (mii_reg & 0x1000) + status |= PHY_STAT_100FDX; +@@ -842,7 +1177,7 @@ static void mii_parse_lxt970_csr(uint mi + else + status |= PHY_STAT_10HDX; + } +- *s = status; ++ fep->phy_status = status; + } + + static phy_cmd_t const phy_cmd_lxt970_config[] = { +@@ -898,16 +1233,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); +- volatile uint *s = &(fep->phy_status); + uint status; + +- status = *s & ~(PHY_STAT_SPMASK | PHY_STAT_LINK | PHY_STAT_ANC); ++ status = fep->phy_status & ~(PHY_STAT_SPMASK | PHY_STAT_LINK | PHY_STAT_ANC); + + if (mii_reg & 0x0400) { +- fep->link = 1; ++ fep->linkstatus = 1; + status |= PHY_STAT_LINK; + } else { +- fep->link = 0; ++ fep->linkstatus = 0; + } + if (mii_reg & 0x0080) + status |= PHY_STAT_ANC; +@@ -925,7 +1259,7 @@ static void mii_parse_lxt971_sr2(uint mi + if (mii_reg & 0x0008) + status |= PHY_STAT_FAULT; + +- *s = status; ++ fep->phy_status = status; + } + + static phy_cmd_t const phy_cmd_lxt971_config[] = { +@@ -982,10 +1316,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); +- volatile uint *s = &(fep->phy_status); + uint status; + +- status = *s & ~(PHY_STAT_SPMASK); ++ status = fep->phy_status & ~(PHY_STAT_SPMASK); + + switch((mii_reg >> 2) & 7) { + case 1: status |= PHY_STAT_10HDX; break; +@@ -994,7 +1327,7 @@ static void mii_parse_qs6612_pcr(uint mi + case 6: status |= PHY_STAT_100FDX; break; + } + +- *s = status; ++ fep->phy_status = status; + } + + static phy_cmd_t const phy_cmd_qs6612_config[] = { +@@ -1052,10 +1385,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); +- volatile uint *s = &(fep->phy_status); + uint status; + +- status = *s & ~(PHY_STAT_SPMASK | PHY_STAT_ANC); ++ status = fep->phy_status & ~(PHY_STAT_SPMASK | PHY_STAT_ANC); + + if (mii_reg & 0x0080) + status |= PHY_STAT_ANC; +@@ -1064,7 +1396,7 @@ static void mii_parse_am79c874_dr(uint m + else + status |= ((mii_reg & 0x0800) ? PHY_STAT_10FDX : PHY_STAT_10HDX); + +- *s = status; ++ fep->phy_status = status; + } + + static phy_cmd_t const phy_cmd_am79c874_config[] = { +@@ -1107,7 +1439,7 @@ static phy_info_t const phy_info_am79c87 + /* register definitions for the 8721 */ + + #define MII_KS8721BL_RXERCR 21 +-#define MII_KS8721BL_ICSR 27 ++#define MII_KS8721BL_ICSR 22 + #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 + static void mii_parse_dp8384x_sr2(uint mii_reg, struct net_device *dev) + { + struct fec_enet_private *fep = netdev_priv(dev); +- volatile uint *s = &(fep->phy_status); + +- *s &= ~(PHY_STAT_SPMASK | PHY_STAT_LINK | PHY_STAT_ANC); ++ fep->phy_status &= ~(PHY_STAT_SPMASK | PHY_STAT_LINK | PHY_STAT_ANC); + + /* Link up */ + if (mii_reg & 0x0001) { +- fep->link = 1; +- *s |= PHY_STAT_LINK; ++ fep->linkstatus = 1; ++ fep->phy_status |= PHY_STAT_LINK; + } else +- fep->link = 0; ++ fep->linkstatus = 0; + /* Status of link */ + if (mii_reg & 0x0010) /* Autonegotioation complete */ +- *s |= PHY_STAT_ANC; ++ fep->phy_status |= PHY_STAT_ANC; + if (mii_reg & 0x0002) { /* 10MBps? */ + if (mii_reg & 0x0004) /* Full Duplex? */ +- *s |= PHY_STAT_10FDX; ++ fep->phy_status |= PHY_STAT_10FDX; + else +- *s |= PHY_STAT_10HDX; ++ fep->phy_status |= PHY_STAT_10HDX; + } else { /* 100 Mbps? */ + if (mii_reg & 0x0004) /* Full Duplex? */ +- *s |= PHY_STAT_100FDX; ++ fep->phy_status |= PHY_STAT_100FDX; + else +- *s |= PHY_STAT_100HDX; ++ fep->phy_status |= PHY_STAT_100HDX; + } + if (mii_reg & 0x0008) +- *s |= PHY_STAT_FAULT; ++ fep->phy_status |= PHY_STAT_FAULT; + } + + static phy_info_t phy_info_dp83848= { +@@ -1211,92 +1542,362 @@ static phy_info_t const * const phy_info + &phy_info_dp83848, + NULL + }; +- +-/* ------------------------------------------------------------------------- */ +-#ifdef HAVE_mii_link_interrupt +-static irqreturn_t +-mii_link_interrupt(int irq, void * dev_id); ++#endif + + /* +- * This is specific to the MII interrupt setup of the M5272EVB. ++ * do some initializtion based architecture of this chip ++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; +-} +-#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) ++ 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__, ++ fep->linkstatus, phydev->link, fep->full_duplex ? "full" : "half", ++ phydev->duplex ? "full" : "half"); ++ if (phydev->link) { ++ fec_restart(dev, phydev->duplex); ++ } else { ++ fec_stop(dev); ++ } ++ if (fep->linkstatus != phydev->link && netif_msg_link(fep)) { ++ phy_print_status(phydev); ++ } ++ fep->linkstatus = phydev->link; ++#if 0 ++ int i; ++ for (i = 0; i < 32; i++) { ++ DBG(0, "%s: PHY reg[%02x]=%04x\n", __FUNCTION__, i, ++ fec_mii_read(fep->mii, fep->phy_addr, i)); ++ } ++#endif ++ } ++} ++#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; ++ 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; ++ } ++ fec_restart(dev, duplex); ++ 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]; ++ 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 fec_phy_timer(unsigned long data) + { ++ struct net_device *dev = (struct net_device *)data; + struct fec_enet_private *fep = netdev_priv(dev); +- volatile uint *s = &(fep->phy_status); ++ 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 ++ ++/* ++ * 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); ++ ++ fep->etn_irq = platform_get_irq(pdev, 0); ++ fep->mii_irq = platform_get_irq(pdev, 1); ++ ++ /* Setup interrupt handlers. */ ++ ret = request_irq(fep->etn_irq, fec_enet_interrupt, 0, "fec", dev); ++ if (ret != 0) { ++ printk(KERN_ERR "FEC: Could not allocate FEC IRQ(%d)!\n", fep->etn_irq); ++ return ret; ++ } ++#ifndef CONFIG_PHYLIB ++ if (fep->mii_irq >= 0) { ++ /* TODO: disable now due to CPLD issue */ ++ ret = request_irq(fep->mii_irq, mii_link_interrupt, 0, "fec(MII)", dev); ++ if (ret != 0) { ++ printk(KERN_ERR "FEC: Could not allocate FEC(MII) IRQ(%d)!\n", ++ fep->mii_irq); ++ free_irq(fep->etn_irq, dev); ++ return ret; ++ } ++ /* ++ * 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. ++ */ ++ fep->phy_int_enabled = 1; ++ } else { ++ fep->phy_timer = kzalloc(sizeof(struct timer_list), GFP_KERNEL); ++ if (fep->phy_timer == NULL) { ++ free_irq(fep->etn_irq, dev); ++ return -ENOMEM; ++ } ++ init_timer(fep->phy_timer); ++ fep->phy_timer->function = fec_phy_timer; ++ fep->phy_timer->data = (unsigned long)dev; ++ fec_link_change(dev); ++ } ++#endif ++ ++ return 0; ++} ++ ++static void fec_release_intrs(struct net_device *dev) ++{ ++ struct fec_enet_private *fep = netdev_priv(dev); ++ ++ free_irq(fep->etn_irq, dev); ++#ifndef CONFIG_PHYLIB ++ if (fep->mii_irq >= 0) { ++ free_irq(fep->mii_irq, dev); ++ } ++#endif ++} ++ ++#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 ++ ++#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) ++ ++#ifndef DEBUG ++static inline unsigned long fec_reg_read16(struct fec_enet_private *fep, unsigned int reg) ++{ ++ return readw(fep->reg_base + reg); ++} ++ ++static inline void fec_reg_write(struct fec_enet_private *fep, unsigned int reg, unsigned long val) ++{ ++ writew(val, fep->reg_base + reg); ++} ++#else ++#define fec_reg_read16(fep, reg) __fec_reg_read16(fep, reg, __FUNCTION__, #reg) ++#define fec_reg_write16(fep, reg, val) __fec_reg_write16(fep, reg, val, __FUNCTION__, #reg) ++ ++static inline u16 __fec_reg_read16(struct fec_enet_private *fep, unsigned int reg, ++ const char *func, const char *reg_name) ++{ ++ u16 val = readw(fep->reg_base + reg); ++ DBG(0, "%s: Read %04x from %s(%03x)\n", func, val, reg_name, reg); ++ return val; ++} ++ ++static inline void __fec_reg_write16(struct fec_enet_private *fep, unsigned int reg, ++ u16 val, const char *func, const char *reg_name) ++{ ++ DBG(0, "%s: Writing %04x to %s(%03x)\n", func, val, reg_name, reg); ++ writew(val, fep->reg_base + reg); ++} ++#endif ++ ++static void fec_localhw_setup(struct net_device *dev) ++{ ++ struct fec_enet_private *fep = netdev_priv(dev); ++ int loops; ++ const int max_loops = 10000; ++ ++ /* ++ * Set up the MII gasket for RMII mode ++ */ ++ dev_dbg(&dev->dev, "enable RMII gasket\n"); ++ ++ /* disable the gasket and wait */ ++ fec_reg_write16(fep, FEC_MIIGSK_ENR, 0); ++ DBG(0, "%s: Waiting for RMII gasket idle\n", __FUNCTION__); ++ while (fec_reg_read16(fep, FEC_MIIGSK_ENR) & FEC_MIIGSK_ENR_READY) ++ udelay(1); ++ DBG(0, "%s: RMII gasket idle\n", __FUNCTION__); ++ ++ /* 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); ++ ++#if 1 ++ DBG(0, "%s: Waiting for RMII gasket ready\n", __FUNCTION__); ++ for (loops = 0; loops < max_loops; loops++) { ++ if (readw(fep->reg_base + FEC_MIIGSK_ENR) & FEC_MIIGSK_ENR_READY) ++ break; ++ udelay(1); ++ } ++ if (fec_reg_read16(fep, FEC_MIIGSK_ENR) & FEC_MIIGSK_ENR_READY) { ++ DBG(0, "%s: RMII gasket ready after %u loops\n", __FUNCTION__, loops); ++ } else { ++ DBG(0, "%s: RMII gasket NOT ready after %u loops\n", __FUNCTION__, loops); ++ } ++#endif ++} ++#else ++static inline void fec_localhw_setup(struct net_device *dev) ++{ ++} ++#endif ++ ++static int fec_set_mii(struct net_device *dev, struct fec_enet_private *fep) ++{ ++ unsigned long rate; ++ struct clk *clk; ++ ++ DBG(0, "%s: \n", __FUNCTION__); ++ ++ fec_reg_write(fep, FEC_RCR, OPT_FRAME_SIZE | RCR_MII_MODE); ++ fec_reg_write(fep, FEC_TCR, 0x00); ++ ++ /* ++ * Set MII speed to 2.5 MHz ++ */ ++ clk = clk_get(fep->dma_dev, NULL); ++ if (!IS_ERR(clk)) { ++ rate = clk_get_rate(clk); ++ clk_put(clk); ++ } else { ++ printk(KERN_ERR "Failed to get fec clock: %ld\n", PTR_ERR(clk)); ++ return PTR_ERR(clk); ++ } ++ fep->phy_speed = ((((rate + 4999999) / 2500000) / 2) & 0x3F) << 1; ++ fec_reg_write(fep, FEC_MSCR, fep->phy_speed); ++ DBG(0, "%s: clkdiv set to %u for MII clock %u at base clock %lu\n", ++ __FUNCTION__, fep->phy_speed >> 1, 2500000, rate); ++ DBG(0, "%s: actual MII clock is: %lu\n", __FUNCTION__, rate / (fep->phy_speed)); ++ ++ return 0; ++} ++ ++static const unsigned char default_mac[ETH_ALEN] = { ++ 0x00, 0x04, 0x9f, 0x00, 0x74, 0x4a, ++}; ++ ++#define FEC_IIM_BASE IO_ADDRESS(IIM_BASE_ADDR) ++static void fec_get_mac(struct net_device *dev) ++{ ++#if 1 ++ // keep bootloader assigned MAC address ++ struct fec_enet_private *fep = netdev_priv(dev); ++ unsigned long eth_addr = fec_reg_read(fep, FEC_PALR); ++ dev->dev_addr[0] = eth_addr >> 24; ++ dev->dev_addr[1] = eth_addr >> 16; ++ dev->dev_addr[2] = eth_addr >> 8; ++ dev->dev_addr[3] = eth_addr >> 0; ++ eth_addr = fec_reg_read(fep, FEC_PAUR); ++ dev->dev_addr[5] = eth_addr >> 16; ++ dev->dev_addr[4] = eth_addr >> 24; ++#else ++ int i; ++ unsigned long fec_mac_base = FEC_IIM_BASE + MXC_IIMKEY0; ++ ++ if (cpu_is_mx27_rev(CHIP_REV_2_0) > 0) { ++ fec_mac_base = FEC_IIM_BASE + MXC_IIMMAC; ++ } ++ ++ DBG(0, "%s: Reading MAC address from %08lx\n", __FUNCTION__, fec_mac_base); ++ for (i = 0; i < ETH_ALEN; i++) { ++ dev->dev_addr[ETH_ALEN - 1 - i] = __raw_readb(fec_mac_base + i * 4); ++ } ++ //memcpy(dev->dev_addr, default_mac, ETH_ALEN); ++#endif ++} ++ ++#ifdef CONFIG_PHYLIB ++static inline void fec_enable_phy_intr(struct fec_enet_private *fep) ++{ ++} ++static inline void fec_disable_phy_intr(struct fec_enet_private *fep) ++{ ++} ++static inline void fec_phy_ack_intr(struct fec_enet_private *fep) ++{ ++} ++#else ++static inline void fec_enable_phy_intr(struct fec_enet_private *fep) ++{ ++ if (!fep->phy_int_enabled) { ++ fep->phy_int_enabled = 1; ++ enable_irq(fep->mii_irq); ++ } ++} ++ ++static inline void fec_disable_phy_intr(struct fec_enet_private *fep) ++{ ++ if (fep->phy_int_enabled) { ++ disable_irq(fep->mii_irq); ++ fep->phy_int_enabled = 0; ++ } ++} ++ ++static inline void fec_phy_ack_intr(struct fec_enet_private *fep) ++{ ++ if (fep->phy_int_enabled) { ++ disable_irq(fep->mii_irq); ++ fep->phy_int_enabled = 0; ++ } ++} ++#endif ++ ++/* ------------------------------------------------------------------------- */ ++ ++#ifndef CONFIG_PHYLIB ++static void mii_display_status(struct net_device *dev) ++{ ++ struct fec_enet_private *fep = netdev_priv(dev); ++ ++ if (!fep->linkstatus && !fep->old_linkstatus) { ++ /* Link is still down - don't print anything */ + return; + } + + printk("%s: status: ", dev->name); + +- if (!fep->link) { ++ if (!fep->linkstatus) { + printk("link down"); + } else { + printk("link up"); + +- switch(*s & PHY_STAT_SPMASK) { ++ 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) ++ if (fep->phy_status & PHY_STAT_ANC) + printk(", auto-negotiation complete"); + } + +- if (*s & PHY_STAT_FAULT) ++ if (fep->phy_status & PHY_STAT_FAULT) + printk(", remote fault"); + + printk(".\n"); + } + +-static void mii_display_config(struct work_struct *work) ++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; + + /* +@@ -1326,7 +1926,7 @@ static void mii_display_config(struct wo + ** the workqueue. It is thus safe to allow to reuse it. + */ + fep->mii_phy_task_queued = 0; +- printk("%s: config: auto-negotiation ", dev->name); ++ //printk("%s: config: auto-negotiation ", dev->name); + + if (status & PHY_CONF_ANE) + printk("on"); +@@ -1351,11 +1951,21 @@ static void mii_display_config(struct wo + + fep->sequence_done = 1; + } ++#endif + +-static void mii_relink(struct work_struct *work) ++#ifndef CONFIG_PHYLIB ++static inline void *priv_netdev(struct fec_enet_private *fep) + { +- struct fec_enet_private *fep = container_of(work, struct fec_enet_private, phy_task); +- struct net_device *dev = fep->netdev; ++ /* ugly hack, stolen from include linux/netdevice.h */ ++ return (char *)fep - ((sizeof(struct net_device) ++ + NETDEV_ALIGN_CONST) ++ & ~NETDEV_ALIGN_CONST); ++} ++ ++static void mii_relink(struct work_struct *w) ++{ ++ struct fec_enet_private *fep = container_of(w, struct fec_enet_private, phy_task); ++ struct net_device *dev = priv_netdev(fep); + int duplex; + + /* +@@ -1363,23 +1973,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; +- fep->link = (fep->phy_status & PHY_STAT_LINK) ? 1 : 0; ++ fep->linkstatus = (fep->phy_status & PHY_STAT_LINK) ? 1 : 0; + mii_display_status(dev); +- fep->old_link = fep->link; ++ fep->old_linkstatus = fep->linkstatus; + +- if (fep->link) { ++ if (fep->linkstatus) { + duplex = 0; +- if (fep->phy_status +- & (PHY_STAT_100FDX | PHY_STAT_10FDX)) ++ if (fep->phy_status & (PHY_STAT_100FDX | PHY_STAT_10FDX)) { + duplex = 1; ++ } + fec_restart(dev, duplex); +- } else ++ } else { + fec_stop(dev); +- +-#if 0 +- enable_irq(fep->mii_irq); +-#endif +- ++ } + } + + /* mii_queue_relink is called in interrupt context from mii_link_interrupt */ +@@ -1429,15 +2035,14 @@ phy_cmd_t const phy_cmd_config[] = { + static void + mii_discover_phy3(uint mii_reg, struct net_device *dev) + { +- struct fec_enet_private *fep; ++ struct fec_enet_private *fep = netdev_priv(dev); + int i; + +- fep = netdev_priv(dev); + fep->phy_id |= (mii_reg & 0xffff); + printk("fec: PHY @ 0x%x, ID 0x%08x", fep->phy_addr, fep->phy_id); + +- for(i = 0; phy_info[i]; i++) { +- if(phy_info[i]->id == (fep->phy_id >> 4)) ++ for (i = 0; phy_info[i]; i++) { ++ if (phy_info[i]->id == (fep->phy_id >> 4)) + break; + } + +@@ -1456,13 +2061,9 @@ mii_discover_phy3(uint mii_reg, struct n + static void + mii_discover_phy(uint mii_reg, struct net_device *dev) + { +- struct fec_enet_private *fep; +- volatile fec_t *fecp; ++ struct fec_enet_private *fep = netdev_priv(dev); + uint phytype; + +- fep = netdev_priv(dev); +- fecp = fep->hwp; +- + 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 + */ + fep->phy_id = phytype << 16; + mii_queue(dev, mk_mii_read(MII_REG_PHYIR2), +- mii_discover_phy3); ++ mii_discover_phy3); + } else { + fep->phy_addr++; + mii_queue(dev, mk_mii_read(MII_REG_PHYIR1), +- mii_discover_phy); ++ mii_discover_phy); + } + } else { + printk("FEC: No PHY device found.\n"); + /* Disable external MII interface */ +- fecp->fec_mii_speed = fep->phy_speed = 0; +-#ifdef HAVE_mii_link_interrupt +- fec_disable_phy_intr(); +-#endif ++ fec_disable_phy_intr(fep); ++ fec_reg_write(fep, FEC_MSCR, 0); + } + } ++#endif + +-/* This interrupt occurs when the PHY detects a link change. +-*/ +-#ifdef HAVE_mii_link_interrupt ++#ifndef CONFIG_PHYLIB + static irqreturn_t +-mii_link_interrupt(int irq, void * dev_id) ++mii_link_interrupt(int irq, void *dev_id) + { +- struct net_device *dev = dev_id; ++ struct net_device *dev = dev_id; + struct fec_enet_private *fep = netdev_priv(dev); + +- fec_phy_ack_intr(); ++ DBG(0, "%s: \n", __FUNCTION__); + +-#if 0 +- disable_irq(fep->mii_irq); /* disable now, enable later */ +-#endif ++ fec_phy_ack_intr(fep); + +- mii_do_cmd(dev, fep->phy->ack_int); +- mii_do_cmd(dev, phy_cmd_relink); /* restart and display status */ ++ /* ++ * Some board will trigger phy interrupt before phy enable. ++ * And at that moment , fep->phy is not initialized. ++ */ ++ if (fep->phy) { ++ mii_do_cmd(dev, fep->phy->ack_int); ++ mii_do_cmd(dev, phy_cmd_relink); /* restart and display status */ ++ } + + return IRQ_HANDLED; + } +@@ -1511,16 +2113,31 @@ mii_link_interrupt(int irq, void * dev_i + static int + fec_enet_open(struct net_device *dev) + { ++ int ret = 0; + struct fec_enet_private *fep = netdev_priv(dev); + + /* I should reset the ring buffers here, but I don't yet know + * a simple way to do that. + */ +- fec_set_mac_address(dev); ++ DBG(0, "%s: \n", __FUNCTION__); ++ _fec_set_mac_address(dev); + +- fep->sequence_done = 0; +- fep->link = 0; ++#ifdef CONFIG_PHYLIB ++ fec_restart(dev, 0); + ++ ret = fec_connect_phy(dev, fep); ++ if (ret != 0) { ++ DBG(0, "%s: Failed to connect to PHY: %d\n", __FUNCTION__, ret); ++ return ret; ++ } ++ phy_start(fep->phy); ++ ++ fep->linkstatus = fep->phy->link; ++ //fec_restart(dev, 0); ++ DBG(0, "%s: Link status is: %d\n", __FUNCTION__, fep->linkstatus); ++#else ++ fep->linkstatus = 0; ++ fep->sequence_done = 0; + 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) + * based on this device does not implement a PHY interrupt, + * so we are never notified of link change. + */ +- fep->link = 1; ++ fep->linkstatus = 1; + } else { +- fep->link = 1; /* lets just try it and see */ ++ fep->linkstatus = 1; /* lets just try it and see */ + /* no phy, go full duplex, it's most likely a hub chip */ + fec_restart(dev, 1); + } +- +- netif_start_queue(dev); ++ fep->old_linkstatus = fep->linkstatus; ++#endif + fep->opened = 1; +- return 0; /* Success */ ++#if 1 ++ /* enable receiver */ ++ fec_reg_write(fep, FEC_RDAR, DONT_CARE); ++#endif ++ return ret; + } + + static int +@@ -1559,15 +2180,46 @@ fec_enet_close(struct net_device *dev) + { + struct fec_enet_private *fep = netdev_priv(dev); + +- /* Don't know what to do yet. +- */ ++ DBG(0, "%s: \n", __FUNCTION__); ++ + fep->opened = 0; +- netif_stop_queue(dev); +- fec_stop(dev); ++ if (fep->linkstatus) { ++ fec_stop(dev); ++ } ++#ifdef CONFIG_PHYLIB ++ if (fep->phy) { ++ DBG(0, "%s: Stopping PHY %p\n", __FUNCTION__, fep->phy); ++ phy_stop(fep->phy); + ++ DBG(0, "%s: Disconnecting PHY %p\n", __FUNCTION__, fep->phy); ++ phy_disconnect(fep->phy); ++ fep->phy = NULL; ++ } ++#endif ++#if 1 ++ /* Whack a reset. We should wait for this. ++ */ ++ fec_reg_write(fep, FEC_ECR, FEC_ECR_RESET); ++ udelay(10); ++ ++ /* Mask and clear outstanding MII command interrupts. ++ */ ++ fec_reg_write(fep, FEC_EIMR, 0); ++ fec_reg_write(fep, FEC_EIR, FEC_ENET_MII); ++ fec_disable_phy_intr(fep); ++ /* Switch off MII */ ++ fec_reg_write(fep, FEC_MSCR, 0); ++#endif + return 0; + } + ++static struct net_device_stats *fec_enet_get_stats(struct net_device *dev) ++{ ++ struct fec_enet_private *fep = netdev_priv(dev); ++ ++ return &fep->stats; ++} ++ + /* 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) + + static void set_multicast_list(struct net_device *dev) + { +- struct fec_enet_private *fep; +- volatile fec_t *ep; ++ struct fec_enet_private *fep = netdev_priv(dev); + struct dev_mc_list *dmi; + unsigned int i, j, bit, data, crc; + unsigned char hash; + +- fep = netdev_priv(dev); +- ep = fep->hwp; +- +- if (dev->flags&IFF_PROMISC) { +- ep->fec_r_cntrl |= 0x0008; ++ if (dev->flags & IFF_PROMISC) { ++ fec_reg_write(fep, FEC_RCR, fec_reg_read(fep, FEC_RCR) | RCR_PROM); + } else { + +- ep->fec_r_cntrl &= ~0x0008; ++ fec_reg_write(fep, FEC_RCR, fec_reg_read(fep, FEC_RCR) & ~RCR_PROM); + + if (dev->flags & IFF_ALLMULTI) { + /* Catch all multicast addresses, so set the + * filter to all 1's. + */ +- ep->fec_grp_hash_table_high = 0xffffffff; +- ep->fec_grp_hash_table_low = 0xffffffff; ++ fec_reg_write(fep, FEC_IAUR, ~0); ++ fec_reg_write(fep, FEC_IALR, ~0); + } else { + /* Clear filter and add the addresses in hash register. + */ +- ep->fec_grp_hash_table_high = 0; +- ep->fec_grp_hash_table_low = 0; ++ fec_reg_write(fep, FEC_IAUR, 0); ++ fec_reg_write(fep, FEC_IALR, 0); + + dmi = dev->mc_list; + +- for (j = 0; j < dev->mc_count; j++, dmi = dmi->next) +- { ++ for (j = 0; j < dev->mc_count; j++, dmi = dmi->next) { + /* Only support group multicast for now. + */ + if (!(dmi->dmi_addr[0] & 1)) +@@ -1621,13 +2268,11 @@ static void set_multicast_list(struct ne + + /* calculate crc32 value of mac address + */ +- crc = 0xffffffff; ++ crc = ~0; + +- for (i = 0; i < dmi->dmi_addrlen; i++) +- { ++ for (i = 0; i < dmi->dmi_addrlen; i++) { + data = dmi->dmi_addr[i]; +- for (bit = 0; bit < 8; bit++, data >>= 1) +- { ++ for (bit = 0; bit < 8; bit++, data >>= 1) { + crc = (crc >> 1) ^ + (((crc ^ data) & 1) ? CRC32_POLY : 0); + } +@@ -1639,9 +2284,13 @@ static void set_multicast_list(struct ne + hash = (crc >> (32 - HASH_BITS)) & 0x3f; + + if (hash > 31) +- ep->fec_grp_hash_table_high |= 1 << (hash - 32); ++ fec_reg_write(fep, FEC_IAUR, ++ fec_reg_read(fep, FEC_IAUR) | ++ (1 << (hash - 32))); + else +- ep->fec_grp_hash_table_low |= 1 << hash; ++ fec_reg_write(fep, FEC_IALR, ++ fec_reg_read(fep, FEC_IALR) | ++ (1 << hash)); + } + } + } +@@ -1650,106 +2299,272 @@ static void set_multicast_list(struct ne + /* Set a MAC change in hardware. + */ + static void +-fec_set_mac_address(struct net_device *dev) ++_fec_set_mac_address(struct net_device *dev) + { +- volatile fec_t *fecp; +- +- fecp = ((struct fec_enet_private *)netdev_priv(dev))->hwp; ++ struct fec_enet_private *fep = netdev_priv(dev); + + /* Set station address. */ +- fecp->fec_addr_low = dev->dev_addr[3] | (dev->dev_addr[2] << 8) | +- (dev->dev_addr[1] << 16) | (dev->dev_addr[0] << 24); +- fecp->fec_addr_high = (dev->dev_addr[5] << 16) | +- (dev->dev_addr[4] << 24); ++ fec_reg_write(fep, FEC_PALR, dev->dev_addr[3] | (dev->dev_addr[2] << 8) | ++ (dev->dev_addr[1] << 16) | (dev->dev_addr[0] << 24)); ++ 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) ++{ ++ struct sockaddr *addr = _addr; ++ ++ if (!is_valid_ether_addr((const char *)&addr->sa_data)) { ++ printk(KERN_WARNING "Bad ethernet address: %02x:%02x:%02x:%02x:%02x:%02x\n", ++ addr->sa_data[0], addr->sa_data[1], addr->sa_data[2], addr->sa_data[3], ++ addr->sa_data[4], addr->sa_data[5]); ++ return -EINVAL; ++ } ++ printk(KERN_DEBUG "Setting MAC address to %02x:%02x:%02x:%02x:%02x:%02x\n", ++ addr->sa_data[0], addr->sa_data[1], addr->sa_data[2], addr->sa_data[3], ++ addr->sa_data[4], addr->sa_data[5]); ++ ++ memcpy(&dev->dev_addr, &addr->sa_data, ETH_ALEN); + ++ _fec_set_mac_address(dev); ++ ++ return 0; + } + +- /* +- * XXX: We need to clean up on failure exits here. +- * +- * index is only used in legacy code +- */ +-int __init fec_enet_init(struct net_device *dev, int index) ++static void fec_enet_free_buffers(struct fec_enet_private *fep) ++{ ++ cbd_t *bdp = fep->rx_bd_base; ++ int i; ++ ++ DBG(0, "%s: Freeing TX bounce buffers %p\n", __FUNCTION__, fep->tx_bounce[0]); ++ kfree(fep->tx_bounce[0]); ++ memset(fep->tx_bounce, 0, TX_RING_SIZE * sizeof(void*)); ++ for (i = 0; i < RX_RING_SIZE; i++, bdp++) { ++ if (fep->rx_skbuff[i] != NULL) { ++ DBG(0, "%s: Freeing RX skb %p\n", __FUNCTION__, fep->rx_skbuff[i]); ++ fec_enet_rxbuf_unmap(fep, bdp, FEC_ENET_RX_FRSIZE); ++ kfree_skb(fep->rx_skbuff[i]); ++ fep->rx_skbuff[i] = NULL; ++ } ++ } ++} ++ ++#ifdef CONFIG_PHYLIB ++/* called by the generic PHY layer in interrupt context */ ++static int phy_regs[32] = { [0 ... ARRAY_SIZE(phy_regs) - 1] = -1}; ++static int fec_mii_read(struct mii_bus *bus, int phy_id, int regnum) + { ++ int ret; ++ struct net_device *dev = bus->priv; + struct fec_enet_private *fep = netdev_priv(dev); +- unsigned long mem_addr; +- volatile cbd_t *bdp; +- cbd_t *cbd_base; +- volatile fec_t *fecp; +- int i, j; ++ unsigned long regval = mk_mii_read(regnum) | phy_id << 23; ++ unsigned long flags; ++ int loops = 0; + +- /* Allocate memory for buffer descriptors. +- */ +- mem_addr = (unsigned long)dma_alloc_coherent(NULL, PAGE_SIZE, +- &fep->bd_dma, GFP_KERNEL); +- if (mem_addr == 0) { +- printk("FEC: allocate descriptor memory failed?\n"); ++ DBG(1, "%s: \n", __FUNCTION__); ++#if 0 ++ DBG(0, "%s: ECR: %08lx\n", __FUNCTION__, fec_reg_read(fep, FEC_ECR)); ++ DBG(0, "%s: EIR: %08lx\n", __FUNCTION__, fec_reg_read(fep, FEC_EIR)); ++ DBG(0, "%s: EIMR: %08lx\n", __FUNCTION__, fec_reg_read(fep, FEC_EIMR)); ++ DBG(0, "%s: RCR: %08lx\n", __FUNCTION__, fec_reg_read(fep, FEC_RCR)); ++ DBG(0, "%s: TCR: %08lx\n", __FUNCTION__, fec_reg_read(fep, FEC_TCR)); ++#endif ++ spin_lock_irqsave(&fep->lock, flags); ++ fep->mii_complete = 0; ++ fec_reg_write(fep, FEC_MMFR, regval); ++ spin_unlock_irqrestore(&fep->lock, flags); ++ ++ while (!fep->mii_complete) { ++ if (loops++ == 1000) { ++ DBG(1, "%s: Waiting for MII completion\n", __FUNCTION__); ++ } ++ cpu_relax(); ++ } ++ if (loops >= 1000) { ++ DBG(1, "%s: MII transaction completed\n", __FUNCTION__); ++ } ++ ret = fec_reg_read(fep, FEC_MMFR); ++ if (ret < 0) { ++ DBG(0, "%s: Failed to read PHY[%02x] reg %02x: %d\n", __FUNCTION__, ++ phy_id, regnum, ret); ++ return ret; ++ } ++ ret &= 0xffff; ++ if (phy_regs[regnum] != ret) { ++ DBG(1, "%s: Read %04x from PHY[%02x] reg %02x\n", __FUNCTION__, ++ ret, phy_id, regnum); ++ phy_regs[regnum] = ret; ++ } ++ return ret; ++} ++ ++static int fec_mii_write(struct mii_bus *bus, int phy_id, int regnum, u16 val) ++{ ++ struct net_device *dev = bus->priv; ++ struct fec_enet_private *fep = netdev_priv(dev); ++ unsigned long regval = mk_mii_write(regnum, val) | phy_id << 23; ++ unsigned long flags; ++ ++ DBG(0, "%s: \n", __FUNCTION__); ++ ++ spin_lock_irqsave(&fep->lock, flags); ++ fep->mii_complete = 0; ++ fec_reg_write(fep, FEC_MMFR, regval); ++ spin_unlock_irqrestore(&fep->lock, flags); ++ ++ while (!fep->mii_complete) { ++ cpu_relax(); ++ } ++ DBG(1, "%s: Wrote %04x to PHY[%02x] reg %02x\n", __FUNCTION__, val, phy_id, regnum); ++ return 0; ++} ++ ++static int fec_mii_reset(struct mii_bus *bus) ++{ ++ DBG(0, "%s: \n", __FUNCTION__); ++ memset(phy_regs, -1, sizeof(phy_regs)); ++ return 0; ++} ++ ++static int fec_init_phy(struct net_device *dev, struct fec_enet_private *fep) ++{ ++ int ret; ++ int i; ++ struct mii_bus *mii; ++ ++ mii = mdiobus_alloc(); ++ if (mii == NULL) { + return -ENOMEM; + } ++ mii->name = "fec mii"; ++ mii->read = fec_mii_read; ++ mii->write = fec_mii_write; ++ mii->reset = fec_mii_reset; ++ mii->priv = dev; ++ snprintf(mii->id, MII_BUS_ID_SIZE, "%x", 0); ++ mii->irq = kmalloc(sizeof(int) * PHY_MAX_ADDR, GFP_KERNEL); ++ for (i = 0; i < PHY_MAX_ADDR; i++) { ++ mii->irq[i] = fep->mii_irq >= 0 ? fep->mii_irq : PHY_POLL; ++ } ++ ++ ret = mdiobus_register(mii); ++ if (ret != 0) { ++ DBG(0, "%s: Failed to register MII bus: %d\n", __FUNCTION__, ret); ++ kfree(mii->irq); ++ mdiobus_free(mii); ++ return ret; ++ } ++ fep->phy_addr = -1; ++ DBG(0, "%s: MII bus registered\n", __FUNCTION__); ++ for (i = 0; i < PHY_MAX_ADDR; i++) { ++ if (mii->phy_map[i] != NULL) { ++ fep->phy_addr = i; ++ break; ++ } ++ } ++ if (fep->phy_addr == -1) { ++ DBG(0, "%s: No PHY found\n", __FUNCTION__); ++ return -ENODEV; ++ } ++ DBG(0, "%s: Using PHY at addr %02x\n", __FUNCTION__, fep->phy_addr); ++ fep->mii = mii; + +- spin_lock_init(&fep->hw_lock); +- spin_lock_init(&fep->mii_lock); ++ return 0; ++} + +- /* Create an Ethernet device instance. +- */ +- fecp = (volatile fec_t *)dev->base_addr; ++static int fec_connect_phy(struct net_device *dev, struct fec_enet_private *fep) ++{ ++ struct mii_bus *mii = fep->mii; + +- fep->index = index; +- fep->hwp = fecp; +- fep->netdev = dev; ++ DBG(0, "%s: Connecting PHY at addr %02x\n", __FUNCTION__, ++ fep->phy_addr); + +- /* Whack a reset. We should wait for this. +- */ +- fecp->fec_ecntrl = 1; +- udelay(10); ++ fep->phy = phy_connect(dev, dev_name(&mii->phy_map[fep->phy_addr]->dev), ++ fec_link_change, 0, mii->phy_map[fep->phy_addr]->interface); ++ if (IS_ERR(fep->phy)) { ++ int ret = PTR_ERR(fep->phy); ++ printk(KERN_ERR "%s: Could not attach to PHY\n", dev->name); ++ fep->phy = NULL; ++ return ret; ++ } ++ DBG(0, "%s: Registered PHY %s[%02x] IRQ %d with %s\n", __FUNCTION__, ++ dev_name(&fep->phy->dev), fep->phy_addr, fep->phy->irq, dev->name); + +- /* Set the Ethernet address */ +-#ifdef CONFIG_M5272 +- fec_get_mac(dev); ++ return 0; ++} + #else +- { +- unsigned long l; +- l = fecp->fec_addr_low; +- dev->dev_addr[0] = (unsigned char)((l & 0xFF000000) >> 24); +- dev->dev_addr[1] = (unsigned char)((l & 0x00FF0000) >> 16); +- dev->dev_addr[2] = (unsigned char)((l & 0x0000FF00) >> 8); +- dev->dev_addr[3] = (unsigned char)((l & 0x000000FF) >> 0); +- l = fecp->fec_addr_high; +- dev->dev_addr[4] = (unsigned char)((l & 0xFF000000) >> 24); +- dev->dev_addr[5] = (unsigned char)((l & 0x00FF0000) >> 16); +- } ++static int fec_init_phy(struct net_device *dev, struct fec_enet_private *fep) ++{ ++ /* Queue up command to detect the PHY and initialize the ++ * remainder of the interface. ++ */ ++ fep->phy_id_done = 0; ++ fep->phy_addr = 0; ++ mii_queue(dev, mk_mii_read(MII_REG_PHYIR1), mii_discover_phy); ++ ++ return 0; ++} + #endif + +- cbd_base = (cbd_t *)mem_addr; ++/* Initialize the FEC Ethernet on 860T (or ColdFire 5272). ++ */ ++ /* ++ * 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; ++ struct fec_enet_private *fep = netdev_priv(dev); ++ cbd_t *bdp; ++ struct sk_buff *pskb; ++ int i; ++ void *mem; ++ ++ spin_lock_init(&fep->lock); ++ ++ /* Whack a reset. We should wait for this. + */ +- fep->rx_bd_base = cbd_base; +- fep->tx_bd_base = cbd_base + RX_RING_SIZE; ++ fec_reg_write(fep, FEC_ECR, FEC_ECR_RESET); ++ udelay(10); ++ ++ /* Set the Ethernet address. If using multiple Enets on the 8xx, ++ * this needs some work to get unique addresses. ++ * ++ * This is our default MAC address unless the user changes ++ * it via eth_mac_addr (our dev->set_mac_addr handler). ++ */ ++ fec_get_mac(dev); + + fep->dirty_tx = fep->cur_tx = fep->tx_bd_base; + fep->cur_rx = fep->rx_bd_base; + + fep->skb_cur = fep->skb_dirty = 0; + +- /* Initialize the receive buffer descriptors. ++ /* allocate memory for TX bounce buffers */ ++ mem = kzalloc(TX_RING_SIZE * FEC_ENET_TX_FRSIZE, GFP_KERNEL); ++ if (mem == NULL) { ++ return -ENOMEM; ++ } ++ ++ fec_enet_cbd_get(fep); ++ ++ /* Initialize the transmit buffer descriptors. + */ +- bdp = fep->rx_bd_base; +- for (i=0; itx_bd_base; + +- /* Allocate a page. +- */ +- mem_addr = __get_free_page(GFP_KERNEL); +- /* XXX: missing check for allocation failure */ ++ DBG(0, "%s: Allocated %d byte of TX buffer memory @ %p\n", __FUNCTION__, ++ TX_RING_SIZE * FEC_ENET_TX_FRSIZE, mem); ++ for (i = 0; i < TX_RING_SIZE; i++) { ++ fep->tx_bounce[i] = mem; ++ DBG(0, "%s: TX bounce buffer[%d]=%p\n", __FUNCTION__, i, fep->tx_bounce[i]); ++ mem = (void *)((unsigned long)(mem + FEC_ENET_TX_FRSIZE)); + + /* Initialize the BD for every fragment in the page. + */ +- for (j=0; jcbd_sc = BD_ENET_RX_EMPTY; +- bdp->cbd_bufaddr = __pa(mem_addr); +- mem_addr += FEC_ENET_RX_FRSIZE; +- bdp++; +- } ++ bdp->cbd_bufaddr = ~0; ++ bdp++; + } + + /* Set the last buffer to wrap. +@@ -1757,87 +2572,88 @@ int __init fec_enet_init(struct net_devi + bdp--; + bdp->cbd_sc |= BD_SC_WRAP; + +- /* ...and the same for transmmit. ++ /* ...and the same for receive. + */ +- bdp = fep->tx_bd_base; +- for (i=0, j=FEC_ENET_TX_FRPPG; i= FEC_ENET_TX_FRPPG) { +- mem_addr = __get_free_page(GFP_KERNEL); +- j = 1; +- } else { +- mem_addr += FEC_ENET_TX_FRSIZE; +- j++; ++ bdp = fep->rx_bd_base; ++ for (i = 0; i < RX_RING_SIZE; i++, bdp++) { ++ pskb = __dev_alloc_skb(FEC_ENET_RX_FRSIZE, GFP_KERNEL); ++ if (pskb == NULL) { ++ DBG(0, "%s: Failed to allocate RX skb; cleaning up\n", __FUNCTION__); ++ ret = -ENOMEM; ++ goto cleanup; + } +- fep->tx_bounce[i] = (unsigned char *) mem_addr; +- +- /* Initialize the BD for every fragment in the page. +- */ +- bdp->cbd_sc = 0; +- bdp->cbd_bufaddr = 0; +- bdp++; ++ DBG(0, "%s: RX skb allocated @ %p\n", __FUNCTION__, pskb); ++ fep->rx_skbuff[i] = pskb; ++ pskb->data = FEC_ADDR_ALIGNMENT(pskb->data); ++ bdp->cbd_sc = BD_ENET_RX_EMPTY; ++ bdp->cbd_bufaddr = ~0; ++ fec_enet_rxbuf_map(fep, bdp, pskb->data, FEC_ENET_RX_FRSIZE); + } +- + /* Set the last buffer to wrap. + */ + bdp--; + bdp->cbd_sc |= BD_SC_WRAP; ++ fec_enet_cbd_put(fep); + + /* Set receive and transmit descriptor base. + */ +- fecp->fec_r_des_start = fep->bd_dma; +- fecp->fec_x_des_start = (unsigned long)fep->bd_dma + sizeof(cbd_t) +- * RX_RING_SIZE; +- +-#ifdef HAVE_mii_link_interrupt +- fec_request_mii_intr(dev); +-#endif +- +- fecp->fec_grp_hash_table_high = 0; +- fecp->fec_grp_hash_table_low = 0; +- fecp->fec_r_buff_size = PKT_MAXBLR_SIZE; +- fecp->fec_ecntrl = 2; +- fecp->fec_r_des_active = 0; +-#ifndef CONFIG_M5272 +- fecp->fec_hash_table_high = 0; +- fecp->fec_hash_table_low = 0; +-#endif ++ fec_reg_write(fep, FEC_ERDSR, fep->cbd_phys_base); ++ fec_reg_write(fep, FEC_ETDSR, fep->cbd_phys_base + RX_RING_SIZE * sizeof(cbd_t)); + ++ /* Install our interrupt handlers. This varies depending on ++ * the architecture. ++ */ ++ ret = fec_request_intrs(pdev, dev); ++ if (ret != 0) { ++ goto cleanup; ++ } ++ /* Clear and enable interrupts */ ++ fec_reg_write(fep, FEC_EIR, fec_reg_read(fep, FEC_EIR)); ++ fec_reg_write(fep, FEC_EIMR, FEC_ENET_TXF | FEC_ENET_TXB | ++ FEC_ENET_RXF | FEC_ENET_RXB | FEC_ENET_MII); ++ ++ fec_reg_write(fep, FEC_IAUR, 0); ++ fec_reg_write(fep, FEC_IALR, 0); ++ fec_reg_write(fep, FEC_EMRBR, PKT_MAXBLR_SIZE); ++ fec_reg_write(fep, FEC_ECR, FEC_ECR_ETHER_EN); ++ fec_localhw_setup(dev); ++#if 0 ++ /* do this in enet_open()! */ ++ fec_reg_write(fep, FEC_RDAR, DONT_CARE); ++#endif + /* The FEC Ethernet specific entries in the device structure. */ + dev->open = fec_enet_open; + dev->hard_start_xmit = fec_enet_start_xmit; + dev->tx_timeout = fec_timeout; + dev->watchdog_timeo = TX_TIMEOUT; + dev->stop = fec_enet_close; ++ dev->get_stats = fec_enet_get_stats; + dev->set_multicast_list = set_multicast_list; ++ dev->set_mac_address = fec_set_mac_address; + +- for (i=0; ifec_r_cntrl = OPT_FRAME_SIZE | 0x04; +- fecp->fec_x_cntrl = 0x00; +- +- /* +- * Set MII speed to 2.5 MHz +- */ +- fep->phy_speed = ((((clk_get_rate(fep->clk) / 2 + 4999999) +- / 2500000) / 2) & 0x3F) << 1; +- fecp->fec_mii_speed = fep->phy_speed; +- fec_restart(dev, 0); +- +- /* Clear and enable interrupts */ +- fecp->fec_ievent = 0xffc00000; +- fecp->fec_imask = (FEC_ENET_TXF | FEC_ENET_RXF | FEC_ENET_MII); +- +- /* Queue up command to detect the PHY and initialize the +- * remainder of the interface. +- */ +- fep->phy_id_done = 0; +- fep->phy_addr = 0; +- mii_queue(dev, mk_mii_read(MII_REG_PHYIR1), mii_discover_phy); ++ ret = fec_set_mii(dev, fep); ++ if (ret) { ++ DBG(0, "%s: Failed to initialize MII interface: %d\n", __FUNCTION__, ret); ++ goto cleanup; ++ } + ++ ret = fec_init_phy(dev, fep); ++ if (ret) { ++ DBG(0, "%s: Failed to initialize PHY: %d\n", __FUNCTION__, ret); ++ goto cleanup; ++ } + return 0; ++ cleanup: ++ fec_enet_free_buffers(fep); ++ fec_enet_cbd_put(fep); ++ return ret; + } + + /* 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 + static void + fec_restart(struct net_device *dev, int duplex) + { +- struct fec_enet_private *fep; +- volatile cbd_t *bdp; +- volatile fec_t *fecp; ++ struct fec_enet_private *fep = netdev_priv(dev); ++ cbd_t *bdp; + int i; ++ u32 rcr = OPT_FRAME_SIZE | RCR_MII_MODE; /* MII enable */ ++ u32 tcr = TCR_HBC; + +- fep = netdev_priv(dev); +- fecp = fep->hwp; +- ++ DBG(0, "%s: Restarting FEC in %s-duplex mode\n", __FUNCTION__, ++ duplex ? "full" : "half"); + /* Whack a reset. We should wait for this. +- */ +- fecp->fec_ecntrl = 1; ++ */ ++ fec_reg_write(fep, FEC_ECR, FEC_ECR_RESET); + udelay(10); + ++ /* Enable interrupts we wish to service. ++ */ ++ fec_reg_write(fep, FEC_EIMR, FEC_ENET_TXF | FEC_ENET_TXB | ++ FEC_ENET_RXF | FEC_ENET_RXB | FEC_ENET_MII); ++ + /* Clear any outstanding interrupt. +- */ +- fecp->fec_ievent = 0xffc00000; ++ * ++ */ ++ fec_reg_write(fep, FEC_EIR, FEC_ENET_MASK); ++ ++ fec_enable_phy_intr(fep); + + /* Set station address. +- */ +- fec_set_mac_address(dev); ++ */ ++ _fec_set_mac_address(dev); + + /* Reset all multicast. +- */ +- fecp->fec_grp_hash_table_high = 0; +- fecp->fec_grp_hash_table_low = 0; ++ */ ++ fec_reg_write(fep, FEC_IAUR, 0); ++ fec_reg_write(fep, FEC_IALR, 0); + + /* Set maximum receive buffer size. +- */ +- fecp->fec_r_buff_size = PKT_MAXBLR_SIZE; ++ */ ++ fec_reg_write(fep, FEC_EMRBR, PKT_MAXBLR_SIZE); + + /* Set receive and transmit descriptor base. +- */ +- fecp->fec_r_des_start = fep->bd_dma; +- fecp->fec_x_des_start = (unsigned long)fep->bd_dma + sizeof(cbd_t) +- * RX_RING_SIZE; ++ */ ++ fec_reg_write(fep, FEC_ERDSR, fep->cbd_phys_base); ++ fec_reg_write(fep, FEC_ETDSR, fep->cbd_phys_base + RX_RING_SIZE * sizeof(cbd_t)); + + fep->dirty_tx = fep->cur_tx = fep->tx_bd_base; + fep->cur_rx = fep->rx_bd_base; + + /* Reset SKB transmit buffers. +- */ ++ */ + fep->skb_cur = fep->skb_dirty = 0; +- for (i=0; i<=TX_RING_MOD_MASK; i++) { ++ bdp = fep->tx_bd_base; ++ for (i = 0; i <= TX_RING_MOD_MASK; i++) { + if (fep->tx_skbuff[i] != NULL) { +- dev_kfree_skb_any(fep->tx_skbuff[i]); +- fep->tx_skbuff[i] = NULL; ++ fec_free_skb(fep, bdp, &fep->tx_skbuff[i]); ++ bdp++; + } + } + + /* Initialize the receive buffer descriptors. +- */ ++ */ + bdp = fep->rx_bd_base; +- for (i=0; icbd_sc = BD_ENET_RX_EMPTY; +@@ -1908,246 +2731,366 @@ fec_restart(struct net_device *dev, int + } + + /* Set the last buffer to wrap. +- */ ++ */ + bdp--; + bdp->cbd_sc |= BD_SC_WRAP; + + /* ...and the same for transmmit. +- */ ++ */ + bdp = fep->tx_bd_base; +- for (i=0; icbd_sc = 0; +- bdp->cbd_bufaddr = 0; ++ bdp->cbd_bufaddr = ~0; + bdp++; + } + + /* Set the last buffer to wrap. +- */ ++ */ + bdp--; + bdp->cbd_sc |= BD_SC_WRAP; + + /* Enable MII mode. +- */ ++ */ + if (duplex) { +- fecp->fec_r_cntrl = OPT_FRAME_SIZE | 0x04;/* MII enable */ +- fecp->fec_x_cntrl = 0x04; /* FD enable */ ++ tcr |= TCR_FDEN; /* FD enable */ + } else { +- /* MII enable|No Rcv on Xmit */ +- fecp->fec_r_cntrl = OPT_FRAME_SIZE | 0x06; +- fecp->fec_x_cntrl = 0x00; ++ rcr |= RCR_DRT; /* No Rcv on Xmit */ + } ++ fec_reg_write(fep, FEC_RCR, rcr); ++ fec_reg_write(fep, FEC_TCR, tcr); + fep->full_duplex = duplex; + + /* Set MII speed. +- */ +- fecp->fec_mii_speed = fep->phy_speed; ++ */ ++ fec_reg_write(fep, FEC_MSCR, fep->phy_speed); + + /* And last, enable the transmit and receive processing. +- */ +- fecp->fec_ecntrl = 2; +- fecp->fec_r_des_active = 0; ++ */ ++ fec_reg_write(fep, FEC_ECR, FEC_ECR_ETHER_EN); ++ fec_localhw_setup(dev); ++ fec_reg_write(fep, FEC_RDAR, DONT_CARE); + +- /* Enable interrupts we wish to service. +- */ +- fecp->fec_imask = (FEC_ENET_TXF | FEC_ENET_RXF | FEC_ENET_MII); ++ DBG(0, "%s: Starting netif queue\n", __FUNCTION__); ++ netif_start_queue(dev); + } + + static void + fec_stop(struct net_device *dev) + { +- volatile fec_t *fecp; +- struct fec_enet_private *fep; ++ struct fec_enet_private *fep = netdev_priv(dev); + +- fep = netdev_priv(dev); +- fecp = fep->hwp; ++ DBG(0, "%s: Stopping netif queue\n", __FUNCTION__); ++ netif_stop_queue(dev); + + /* +- ** We cannot expect a graceful transmit stop without link !!! +- */ +- if (fep->link) +- { +- fecp->fec_x_cntrl = 0x01; /* Graceful transmit stop */ ++ * We cannot expect a graceful transmit stop without link! ++ */ ++ if (fep->linkstatus) { ++ fec_reg_write(fep, FEC_TCR, 0x01); /* Graceful transmit stop */ + udelay(10); +- if (!(fecp->fec_ievent & FEC_ENET_GRA)) +- printk("fec_stop : Graceful transmit stop did not complete !\n"); +- } +- ++ if (!(fec_reg_read(fep, FEC_EIR) & FEC_ENET_GRA)) ++ dev_warn(&dev->dev, "Graceful transmit stop did not complete!\n"); ++ } ++#if 0 + /* Whack a reset. We should wait for this. +- */ +- fecp->fec_ecntrl = 1; ++ */ ++ fec_reg_write(fep, FEC_ECR, FEC_ECR_RESET); + udelay(10); +- +- /* Clear outstanding MII command interrupts. +- */ +- fecp->fec_ievent = FEC_ENET_MII; +- +- fecp->fec_imask = FEC_ENET_MII; +- fecp->fec_mii_speed = fep->phy_speed; ++ /* Mask and clear outstanding MII command interrupts. ++ */ ++ fec_reg_write(fep, FEC_EIMR, 0); ++ fec_reg_write(fep, FEC_EIR, FEC_ENET_MII); ++ fec_enable_phy_intr(fep); ++ fec_reg_write(fep, FEC_MSCR, fep->phy_speed); ++#endif + } + +-static int __devinit +-fec_probe(struct platform_device *pdev) ++static int __devinit fec_enet_probe(struct platform_device *pdev) + { ++ int ret; + struct fec_enet_private *fep; +- struct net_device *ndev; +- int i, irq, ret = 0; +- struct resource *r; +- +- r = platform_get_resource(pdev, IORESOURCE_MEM, 0); +- if (!r) +- return -ENXIO; ++ struct net_device *dev; ++ struct fec_enet_platform_data *pdata = pdev->dev.platform_data; ++ struct resource *res_mem1; ++ struct resource *res_mem2; ++ ++ res_mem1 = platform_get_resource(pdev, IORESOURCE_MEM, 0); ++ if (res_mem1 == NULL) { ++ return -ENODEV; ++ } + +- r = request_mem_region(r->start, resource_size(r), pdev->name); +- if (!r) ++ res_mem1 = request_mem_region(res_mem1->start, ++ resource_size(res_mem1), ++ DRV_NAME); ++ if (res_mem1 == NULL) { + return -EBUSY; ++ } ++ res_mem2 = platform_get_resource(pdev, IORESOURCE_MEM, 1); ++ if (res_mem2 != NULL) { ++ res_mem2 = request_mem_region(res_mem2->start, ++ resource_size(res_mem2), ++ DRV_NAME); ++ if (res_mem2 == NULL) { ++ ret = -EBUSY; ++ goto release1; ++ } ++ } + +- /* Init network device */ +- ndev = alloc_etherdev(sizeof(struct fec_enet_private)); +- if (!ndev) +- return -ENOMEM; +- +- SET_NETDEV_DEV(ndev, &pdev->dev); +- +- /* setup board info structure */ +- fep = netdev_priv(ndev); +- memset(fep, 0, sizeof(*fep)); ++ dev = alloc_etherdev(sizeof(struct fec_enet_private)); ++ if (dev == NULL) { ++ ret = -ENOMEM; ++ goto release2; ++ } ++ platform_set_drvdata(pdev, dev); ++ fep = netdev_priv(dev); ++ fep->res_mem1 = res_mem1; ++ fep->res_mem2 = res_mem2; ++ fep->dma_dev = &pdev->dev; ++ ++ fep->reg_base = ioremap(res_mem1->start, resource_size(res_mem1)); ++ if (fep->reg_base == NULL) { ++ printk("FEC: Mapping FEC registers failed\n"); ++ ret = -ENOMEM; ++ goto free_netdev; ++ } ++ DBG(0, "%s: FEC registers @ %08lx mapped to %p\n", __FUNCTION__, ++ (unsigned long)res_mem1->start, fep->reg_base); + +- ndev->base_addr = (unsigned long)ioremap(r->start, resource_size(r)); ++ fep->mib_base = ioremap(res_mem2->start, resource_size(res_mem2)); ++ if (fep->mib_base == NULL) { ++ printk("FEC: Mapping FEC registers failed\n"); ++ ret = -ENOMEM; ++ goto unmap1; ++ } ++ DBG(0, "%s: FEC registers @ %08lx mapped to %p\n", __FUNCTION__, ++ (unsigned long)res_mem2->start, fep->mib_base); + +- if (!ndev->base_addr) { ++ /* Allocate memory for buffer descriptors. */ ++ fep->cbd_mem_base = dma_alloc_coherent(&pdev->dev, CBD_BUF_SIZE, ++ &fep->cbd_phys_base, ++ GFP_KERNEL); ++ if (fep->cbd_mem_base == NULL) { ++ printk("FEC: allocate descriptor memory failed\n"); + ret = -ENOMEM; +- goto failed_ioremap; ++ goto unmap2; + } ++ DBG(0, "%s: Allocated %lu [(%u + %lu) * %d] byte for CBD buffer @ %p[%08lx]\n", ++ __FUNCTION__, CBD_BUF_SIZE, TX_RING_SIZE, RX_RING_SIZE, ++ sizeof(cbd_t), fep->cbd_mem_base, ++ (unsigned long)fep->cbd_phys_base); + +- platform_set_drvdata(pdev, ndev); ++ /* Set receive and transmit descriptor base. ++ */ ++ fep->rx_bd_base = fep->cbd_mem_base; ++ fep->tx_bd_base = fep->rx_bd_base + RX_RING_SIZE; + +- /* This device has up to three irqs on some platforms */ +- for (i = 0; i < 3; i++) { +- irq = platform_get_irq(pdev, i); +- if (i && irq < 0) +- break; +- ret = request_irq(irq, fec_enet_interrupt, IRQF_DISABLED, pdev->name, ndev); +- if (ret) { +- while (i >= 0) { +- irq = platform_get_irq(pdev, i); +- free_irq(irq, ndev); +- i--; +- } +- goto failed_irq; +- } ++ printk("FEC ENET Driver\n"); ++ ret = platform_func(pdata->arch_init, pdev); ++ if (ret != 0) { ++ dev_err(&pdev->dev, "platform init failed: %d\n", ret); ++ goto free_dma; + } + +- fep->clk = clk_get(&pdev->dev, "fec_clk"); +- if (IS_ERR(fep->clk)) { +- ret = PTR_ERR(fep->clk); +- goto failed_clk; ++ ret = fec_enet_init(pdev, dev); ++ if (ret != 0) { ++ goto fec_disable; + } +- clk_enable(fep->clk); + +- ret = fec_enet_init(ndev, 0); +- if (ret) +- goto failed_init; ++ /* Enable most messages by default */ ++ fep->msg_enable = (NETIF_MSG_IFUP << 1) - 1; ++ ret = register_netdev(dev); ++ if (ret != 0) { ++ /* XXX: missing cleanup here */ ++ goto free_buffers; ++ } + +- ret = register_netdev(ndev); +- if (ret) +- goto failed_register; ++ printk(KERN_INFO "%s: ethernet %02x:%02x:%02x:%02x:%02x:%02x\n", dev->name, ++ dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2], ++ dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5]); + + return 0; + +-failed_register: +-failed_init: +- clk_disable(fep->clk); +- clk_put(fep->clk); +-failed_clk: +- for (i = 0; i < 3; i++) { +- irq = platform_get_irq(pdev, i); +- if (irq > 0) +- free_irq(irq, ndev); +- } +-failed_irq: +- iounmap((void __iomem *)ndev->base_addr); +-failed_ioremap: +- free_netdev(ndev); ++ free_buffers: ++ fec_enet_free_buffers(fep); ++ ++ fec_disable: ++ platform_func(pdata->arch_exit, pdev); ++ ++ free_dma: ++ dma_free_coherent(&pdev->dev, CBD_BUF_SIZE, fep->cbd_mem_base, fep->cbd_phys_base); ++ ++ unmap2: ++ if (fep->mib_base) ++ iounmap(fep->mib_base); ++ ++ unmap1: ++ iounmap(fep->reg_base); ++ ++ free_netdev: ++ free_netdev(dev); ++ ++ release2: ++ if (res_mem2 != NULL) { ++ release_resource(res_mem2); ++ } ++ ++ release1: ++ release_resource(res_mem1); + + return ret; + } + +-static int __devexit +-fec_drv_remove(struct platform_device *pdev) ++static int __devexit fec_enet_remove(struct platform_device *pdev) + { +- struct net_device *ndev = platform_get_drvdata(pdev); +- struct fec_enet_private *fep = netdev_priv(ndev); ++ struct net_device *dev = platform_get_drvdata(pdev); ++ 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); ++ mdiobus_unregister(fep->mii); ++ } ++ mdiobus_free(fep->mii); ++#endif ++ fec_release_intrs(dev); ++ ++ DBG(0, "%s: Unmapping FEC registers %p\n", __FUNCTION__, fep->reg_base); ++ iounmap(fep->reg_base); ++ if (fep->mib_base) ++ iounmap(fep->mib_base); ++ ++ fec_enet_free_buffers(fep); + +- platform_set_drvdata(pdev, NULL); ++ DBG(0, "%s: Freeing CBD buffer area %p[%08lx]\n", __FUNCTION__, ++ fep->cbd_mem_base, (unsigned long)fep->cbd_phys_base); ++ dma_free_coherent(&pdev->dev, CBD_BUF_SIZE, fep->cbd_mem_base, fep->cbd_phys_base); + +- fec_stop(ndev); +- clk_disable(fep->clk); +- clk_put(fep->clk); +- iounmap((void __iomem *)ndev->base_addr); +- unregister_netdev(ndev); +- free_netdev(ndev); ++ release_resource(fep->res_mem1); ++ if (fep->res_mem2 != NULL) { ++ release_resource(fep->res_mem2); ++ } + return 0; + } + +-static int +-fec_suspend(struct platform_device *dev, pm_message_t state) ++static void fec_enet_shutdown(struct platform_device *pdev) + { +- struct net_device *ndev = platform_get_drvdata(dev); +- struct fec_enet_private *fep; ++ struct fec_enet_platform_data *pdata = pdev->dev.platform_data; ++ ++ DBG(0, "%s: Shutting down FEC Hardware\n", __FUNCTION__); ++ platform_func(pdata->arch_exit, pdev); ++} ++ ++#ifdef CONFIG_PM ++static int fec_enet_suspend(struct platform_device *pdev, pm_message_t state) ++{ ++ int ret; ++ struct fec_enet_platform_data *pdata = pdev->dev.platform_data; ++ struct net_device *ndev = platform_get_drvdata(pdev); ++ struct fec_enet_private *fep = netdev_priv(ndev); + +- if (ndev) { +- fep = netdev_priv(ndev); +- if (netif_running(ndev)) { +- netif_device_detach(ndev); +- fec_stop(ndev); ++ if (netif_running(ndev)) { ++ DBG(0, "%s: Detaching netif\n", __FUNCTION__); ++ netif_device_detach(ndev); ++#ifdef CONFIG_PHYLIB ++ DBG(0, "%s: Disconnecting PHY %p\n", __FUNCTION__, fep->phy); ++ phy_disconnect(fep->phy); ++ fep->phy = NULL; ++#endif ++ } ++#ifndef CONFIG_PHYLIB ++ if (fep->phy_timer) { ++ ret = del_timer_sync(fep->phy_timer); ++ if (ret != 0) { ++ DBG(0, "%s: Failed to delete PHY timer: %d\n", __FUNCTION__, ret); ++ return ret; + } + } +- return 0; ++#endif ++ DBG(0, "%s: Shutting down FEC Hardware %d\n", __FUNCTION__, ++ netif_running(ndev)); ++ ret = platform_func(pdata->suspend, pdev); ++ if (ret != 0 && netif_running(ndev)) { ++ DBG(0, "%s: Failed to suspend: %d\n", __FUNCTION__, ret); ++ /* Undo suspend */ ++#ifdef CONFIG_PHYLIB ++ DBG(0, "%s: Reconnecting PHY\n", __FUNCTION__); ++ if (fec_connect_phy(ndev, fep) != 0) { ++ DBG(0, "%s: Failed to connect to PHY\n", __FUNCTION__); ++ return ret; ++ } ++ phy_start(fep->phy); ++#endif ++ fec_link_change(ndev); ++ netif_device_attach(ndev); ++ } ++ return ret; + } + +-static int +-fec_resume(struct platform_device *dev) ++static int fec_enet_resume(struct platform_device *pdev) + { +- struct net_device *ndev = platform_get_drvdata(dev); ++ int ret; ++ struct fec_enet_platform_data *pdata = pdev->dev.platform_data; ++ struct net_device *ndev = platform_get_drvdata(pdev); + +- if (ndev) { +- if (netif_running(ndev)) { +- fec_enet_init(ndev, 0); +- netif_device_attach(ndev); ++ DBG(0, "%s: Powering up FEC Hardware %d\n", __FUNCTION__, ++ netif_running(ndev)); ++ ret = platform_func(pdata->resume, pdev); ++ if (ret != 0) { ++ DBG(0, "%s: Failed to resume: %d\n", __FUNCTION__, ret); ++ return ret; ++ } ++ if (netif_running(ndev)) { ++#ifdef CONFIG_PHYLIB ++ struct fec_enet_private *fep = netdev_priv(ndev); ++ ++ DBG(0, "%s: Reconnecting PHY\n", __FUNCTION__); ++ ret = fec_connect_phy(ndev, fep); ++ if (ret != 0) { ++ DBG(0, "%s: Failed to connect to PHY: %d\n", __FUNCTION__, ret); ++ return ret; + } ++ phy_start(fep->phy); ++#endif ++ fec_link_change(ndev); ++ netif_device_attach(ndev); + } + return 0; + } ++#else ++#define fec_enet_suspend NULL ++#define fec_enet_resume NULL ++#endif + +-static struct platform_driver fec_driver = { +- .driver = { +- .name = "fec", +- .owner = THIS_MODULE, ++static struct platform_driver fec_enet_driver = { ++ .driver = { ++ .name = DRV_NAME, + }, +- .probe = fec_probe, +- .remove = __devexit_p(fec_drv_remove), +- .suspend = fec_suspend, +- .resume = fec_resume, ++ .probe = fec_enet_probe, ++ .remove = __devexit_p(fec_enet_remove), ++ .shutdown = fec_enet_shutdown, ++ .suspend = fec_enet_suspend, ++ .resume = fec_enet_resume, + }; + +-static int __init +-fec_enet_module_init(void) ++static int __init fec_enet_module_init(void) + { +- printk(KERN_INFO "FEC Ethernet Driver\n"); ++ int ret; ++ ++ ret = platform_driver_register(&fec_enet_driver); + +- return platform_driver_register(&fec_driver); ++ return ret; + } ++module_init(fec_enet_module_init); + +-static void __exit +-fec_enet_cleanup(void) ++static void __exit fec_enet_module_cleanup(void) + { +- platform_driver_unregister(&fec_driver); ++ platform_driver_unregister(&fec_enet_driver); + } +- +-module_exit(fec_enet_cleanup); +-module_init(fec_enet_module_init); ++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 18:43:03.000000000 +0200 +@@ -13,6 +13,15 @@ + #define FEC_H + /****************************************************************************/ + ++/* ++ * dummy value to write into RDAR,TDAR. FEC hardware will scan the TX/RX ++ * descriptors in memory upon any write access to those registers. ++ * The actual value written to those registers does not matter. ++*/ ++#define DONT_CARE 0 ++#define RDAR_BUSY (1 << 24) ++#define TDAR_BUSY (1 << 24) ++ + #if defined(CONFIG_M523x) || defined(CONFIG_M527x) || defined(CONFIG_M528x) || \ + defined(CONFIG_M520x) || defined(CONFIG_M532x) || defined(CONFIG_ARCH_MXC) + /* +@@ -20,6 +29,36 @@ + * registers in the same peripheral device on different models + * of the ColdFire! + */ ++// relying on structure alignment for hardware register is just evil ++#ifndef GARBAGE ++#define FEC_EIR 0x004 ++#define FEC_EIMR 0x008 ++#define FEC_RDAR 0x010 ++#define FEC_TDAR 0x014 ++#define FEC_ECR 0x024 ++#define FEC_MMFR 0x040 ++#define FEC_MSCR 0x044 ++#define FEC_MIBC 0x064 ++#define FEC_RCR 0x084 ++#define FEC_TCR 0x0c4 ++#define FEC_PALR 0x0e4 ++#define FEC_PAUR 0x0e8 ++#define FEC_OPD 0x0ec ++#define FEC_IAUR 0x118 ++#define FEC_IALR 0x11c ++#define FEC_GAUR 0x120 ++#define FEC_GALR 0x124 ++#define FEC_TFWR 0x144 ++#define FEC_FRBR 0x14c ++#define FEC_FRSR 0x150 ++#define FEC_ERDSR 0x180 ++#define FEC_ETDSR 0x184 ++#define FEC_EMRBR 0x188 ++ ++#define FEC_ECR_RESET (1 << 0) ++#define FEC_ECR_ETHER_EN (1 << 1) ++#else ++ + typedef struct fec { + unsigned long fec_reserved0; + unsigned long fec_ievent; /* Interrupt event reg */ +@@ -57,6 +96,7 @@ typedef struct fec { + unsigned long fec_x_des_start; /* Transmit descriptor ring */ + unsigned long fec_r_buff_size; /* Maximum receive buff size */ + } fec_t; ++#endif + + #else + +@@ -88,8 +128,8 @@ typedef struct fec { + unsigned long fec_reserved7[158]; + unsigned long fec_addr_low; /* Low 32bits MAC address */ + unsigned long fec_addr_high; /* High 16bits MAC address */ +- unsigned long fec_grp_hash_table_high;/* High 32bits hash table */ +- unsigned long fec_grp_hash_table_low; /* Low 32bits hash table */ ++ unsigned long fec_hash_table_high; /* High 32bits hash table */ ++ unsigned long fec_hash_table_low; /* Low 32bits hash table */ + unsigned long fec_r_des_start; /* Receive descriptor ring */ + unsigned long fec_x_des_start; /* Transmit descriptor ring */ + unsigned long fec_r_buff_size; /* Maximum receive buff size */ +@@ -103,17 +143,20 @@ typedef struct fec { + /* + * Define the buffer descriptor structure. + */ +-#ifdef CONFIG_ARCH_MXC ++/* Please see "Receive Buffer Descriptor Field Definitions" in Specification. ++ * It's LE. ++ */ ++#if defined(CONFIG_ARCH_MXC) + typedef struct bufdesc { +- unsigned short cbd_datlen; /* Data length */ +- unsigned short cbd_sc; /* Control and status info */ +- unsigned long cbd_bufaddr; /* Buffer address */ ++ unsigned short cbd_datlen; /* Data length */ ++ unsigned short cbd_sc; /* Control and status info */ ++ dma_addr_t cbd_bufaddr; /* Buffer address as seen by FEC Hardware */ + } cbd_t; + #else + typedef struct bufdesc { + unsigned short cbd_sc; /* Control and status info */ + unsigned short cbd_datlen; /* Data length */ +- unsigned long cbd_bufaddr; /* Buffer address */ ++ dma_addr_t cbd_bufaddr; /* Buffer address */ + } cbd_t; + #endif + +@@ -121,7 +164,7 @@ typedef struct bufdesc { + * The following definitions courtesy of commproc.h, which where + * Copyright (c) 1997 Dan Malek (dmalek@jlc.net). + */ +-#define BD_SC_EMPTY ((ushort)0x8000) /* Recieve is empty */ ++#define BD_SC_EMPTY ((ushort)0x8000) /* Receive is empty */ + #define BD_SC_READY ((ushort)0x8000) /* Transmit is ready */ + #define BD_SC_WRAP ((ushort)0x2000) /* Last buffer descriptor */ + #define BD_SC_INTRPT ((ushort)0x1000) /* Interrupt on change */ +@@ -168,5 +211,22 @@ typedef struct bufdesc { + #define BD_ENET_TX_STATS ((ushort)0x03ff) /* All status bits */ + + ++#define RCR_LOOP (1 << 0) ++#define RCR_DRT (1 << 1) ++#define RCR_MII_MODE (1 << 2) ++#define RCR_PROM (1 << 3) ++#define RCR_BC_REJ (1 << 4) ++#define RCR_FCE (1 << 5) ++#define RCR_MAX_FL_SHIFT 16 ++#define RCR_MAX_FL_MASK (0x7ff << (RCR_MAX_FL_SHIFT)) ++#define RCR_MAX_FL_set(n) (((n) << (RCR_MAX_FL_SHIFT)) & (RCR_MAX_FL_MASK)) ++#define RCR_MAX_FL_get(n) (((n) & (RCR_MAX_FL_MASK)) >> (RCR_MAX_FL_SHIFT)) ++ ++#define TCR_GTS (1 << 0) ++#define TCR_HBC (1 << 1) ++#define TCR_FDEN (1 << 2) ++#define TCR_TFCPAUSE (1 << 3) ++#define TCR_RFCPAUSE (1 << 4) ++ + /****************************************************************************/ + #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 18:58:52.000000000 +0200 +@@ -570,7 +570,7 @@ static int imxfb_resume(struct platform_ + #define imxfb_resume NULL + #endif + +-static int __init imxfb_init_fbinfo(struct platform_device *pdev) ++static int __devinit imxfb_init_fbinfo(struct platform_device *pdev) + { + struct imx_fb_platform_data *pdata = pdev->dev.platform_data; + struct fb_info *info = dev_get_drvdata(&pdev->dev); +@@ -636,7 +636,7 @@ static int __init imxfb_init_fbinfo(stru + return 0; + } + +-static int __init imxfb_probe(struct platform_device *pdev) ++static int __devinit imxfb_probe(struct platform_device *pdev) + { + struct imxfb_info *fbi; + struct fb_info *info; +@@ -754,7 +754,7 @@ failed_map: + failed_getclock: + iounmap(fbi->regs); + failed_ioremap: +- release_mem_region(res->start, res->end - res->start); ++ release_mem_region(res->start, resource_size(res)); + failed_req: + kfree(info->pseudo_palette); + failed_init: +@@ -763,7 +763,7 @@ failed_init: + return ret; + } + +-static int __devexit imxfb_remove(struct platform_device *pdev) ++static int imxfb_remove(struct platform_device *pdev) + { + struct imx_fb_platform_data *pdata; + struct fb_info *info = platform_get_drvdata(pdev); +@@ -785,7 +785,7 @@ static int __devexit imxfb_remove(struct + framebuffer_release(info); + + iounmap(fbi->regs); +- release_mem_region(res->start, res->end - res->start + 1); ++ release_mem_region(res->start, resource_size(res)); + clk_disable(fbi->clk); + clk_put(fbi->clk); + +@@ -794,7 +794,7 @@ static int __devexit imxfb_remove(struct + return 0; + } + +-void imxfb_shutdown(struct platform_device * dev) ++void imxfb_shutdown(struct platform_device *dev) + { + struct fb_info *info = platform_get_drvdata(dev); + struct imxfb_info *fbi = info->par; +@@ -804,7 +804,8 @@ void imxfb_shutdown(struct platform_dev + static struct platform_driver imxfb_driver = { + .suspend = imxfb_suspend, + .resume = imxfb_resume, +- .remove = __devexit_p(imxfb_remove), ++// .remove = __devexit_p(imxfb_remove), ++ .remove = imxfb_remove, + .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-03-16 12:49:03.000000000 +0100 +@@ -0,0 +1,26 @@ ++/* ++ * Copyright (C) 2007 Lothar Wassmann ++ * ++ * platform_data definitions for fec_enet device ++ * ++ * 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 ++ */ ++ ++struct fec_enet_platform_data { ++ /* callback for platform specific initialization */ ++ int (*arch_init)(struct platform_device *dev); ++ void (*arch_exit)(struct platform_device *dev); ++ 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 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"; + static int recursion_bug; +-static int new_text_line = 1; ++ static int new_text_line = 1; + static char printk_buf[1024]; + ++#ifdef CONFIG_DEBUG_LL ++extern void asmlinkage printascii(const char *); ++#endif + asmlinkage int vprintk(const char *fmt, va_list args) + { + int printed_len = 0; +@@ -687,6 +690,9 @@ asmlinkage int vprintk(const char *fmt, + sizeof(printk_buf) - printed_len, fmt, args); + + ++#ifdef CONFIG_DEBUG_LL ++ printascii(printk_buf); ++#endif + /* + * Copy the output into log_buf. If the caller didn't provide + * appropriate log level tags, we insert them here 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..8a6599553c 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 @@ -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-karo.diff;patch=1" + -- cgit v1.2.3 From 9a6639419da0ba9ad60a8b91da476f18397ff3e4 Mon Sep 17 00:00:00 2001 From: Florian Boor Date: Wed, 1 Jul 2009 12:47:32 +0200 Subject: tx25.conf: Prefer a usable kernel --- conf/machine/tx25.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conf/machine/tx25.conf b/conf/machine/tx25.conf index abe1135dce..8ec67b0ce6 100644 --- a/conf/machine/tx25.conf +++ b/conf/machine/tx25.conf @@ -9,7 +9,7 @@ MACHINE_FEATURES = "kernel26 apm alsa ext2 pcmcia usbhost usbgadget screen camer GUI_MACHINE_CLASS = "bigscreen" PREFERRED_PROVIDER_virtual/kernel = "linux" -PREFERRED_VERSION_linux = "2.6.30-rc4" +PREFERRED_VERSION_linux = "2.6.29+2.6.30-rc4" PREFERRED_PROVIDER_virtual/xserver = "xserver-kdrive" XSERVER = "xserver-kdrive-fbdev" -- cgit v1.2.3 From 81531b3915b61faf3f449bc00f01e3f8e14b48b0 Mon Sep 17 00:00:00 2001 From: Florian Boor Date: Wed, 1 Jul 2009 12:48:11 +0200 Subject: linux: Delete misnamed recipe --- recipes/linux/linux_2.6.30-rc4.bb | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 recipes/linux/linux_2.6.30-rc4.bb diff --git a/recipes/linux/linux_2.6.30-rc4.bb b/recipes/linux/linux_2.6.30-rc4.bb deleted file mode 100644 index d4f7fdd8fe..0000000000 --- a/recipes/linux/linux_2.6.30-rc4.bb +++ /dev/null @@ -1,15 +0,0 @@ -require linux.inc - -PV = "2.6.29+2.6.30-rc4" - -S = "${WORKDIR}/linux-2.6.30-rc4" - -# Mark archs/machines that this kernel supports -DEFAULT_PREFERENCE = "-1" -DEFAULT_PREFERENCE_tx25 = "1" - -SRC_URI = "${KERNELORG_MIRROR}/pub/linux/kernel/v2.6/testing/linux-${PV}.tar.bz2 \ - file://defconfig" - -SRC_URI_append_tx25 = " linux-2.6.30-rc4-git.patch;patch=1 \ - file://linux-2.6.30-rc4-karo.diff;patch=1" -- cgit v1.2.3 From 645418b10be153f65ef42e0e2158f89d2618536f Mon Sep 17 00:00:00 2001 From: Elena Grandi Date: Wed, 1 Jul 2009 12:57:12 +0200 Subject: python-pygtksourceview 2.6.0: new recipe python bindings for gtksourceview --- conf/checksums.ini | 4 ++++ recipes/python/python-pygtksourceview_2.6.0.bb | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 recipes/python/python-pygtksourceview_2.6.0.bb diff --git a/conf/checksums.ini b/conf/checksums.ini index 6fc3c42211..53bbf64ddb 100644 --- a/conf/checksums.ini +++ b/conf/checksums.ini @@ -20290,6 +20290,10 @@ sha256=1cd8e9bb0a011317862aec90a03e562bebbbf7fcf865a8ff12992548cdda746d md5=c69c2e5e86a8f21a5773df20e265fc3a sha256=dee1ec46a43bf624f1ff796903bd2d49e65c1cc8396385f46bf1489817bd6e60 +[ftp://ftp.gnome.org/pub/gnome/sources/pygtksourceview/2.6/pygtksourceview-2.6.0.tar.bz2] +md5=5587a1865bd5c785c6f34095c57cc96b +sha256=77acb735fee997a1638c79256b9dcf592566d066b54a72eb4321909f98f66178 + [http://downloads.sourceforge.net/pyid3lib/pyid3lib-0.5.1.tar.bz2] md5=49818a591430e08057c27a11e4c40aef sha256=2a7bdd52c24ed0e70e4a2d82c697214c4ab5a70f94ea9e7934df15ca202d1169 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..0c2b335d1e --- /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 = "gtksourceview 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}/../" + -- cgit v1.2.3 From 851c0b4629ffcfbe4aacb91297c9cee80db9c2de Mon Sep 17 00:00:00 2001 From: Koen Kooi Date: Wed, 1 Jul 2009 13:31:32 +0200 Subject: icon-slicer-native: switch to pixbux-native --- recipes/icon-slicer/icon-slicer-native_0.3.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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}" -- cgit v1.2.3 From ae63c8ef498264dafb698bf328df8a666e6356cb Mon Sep 17 00:00:00 2001 From: Koen Kooi Date: Wed, 1 Jul 2009 13:35:23 +0200 Subject: loudmouth: add 1.4.3 --- conf/checksums.ini | 4 ++++ recipes/loudmouth/loudmouth_1.4.3.bb | 12 ++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 recipes/loudmouth/loudmouth_1.4.3.bb diff --git a/conf/checksums.ini b/conf/checksums.ini index 53bbf64ddb..4dae8d5f4f 100644 --- a/conf/checksums.ini +++ b/conf/checksums.ini @@ -15782,6 +15782,10 @@ sha256=361a2861a5cd5bc7bd3320b60165c3bede06056ade7d75ab370d13a6b203d629 md5=d9504bb4251d4e5b32cb379debda634d sha256=67cad76c18a138b9b55bf6ff88a5796128371cf9339b3761b36f79fb4e7459d7 +[http://ftp.imendio.com/pub/imendio/loudmouth/src/loudmouth-1.4.3.tar.gz] +md5=7ca8bf7c2313d7b7f27088c373d195e2 +sha256=db252747e974b6be3e31d1b11089dc6aec3780989083df9bd75d76ddae7fb613 + [http://www.bplan-gmbh.org/data/toshiba/topas/linux/2.6.26.5/lowlevel_topas910.tar.bz2] md5=3959ea1a2acaae196173b0283541c428 sha256=b1f136a1d89daa4b1b9711eb81ad120b53c9357d159f262021b84ef8c9d128be 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 +} -- cgit v1.2.3 From 6af86b4c9c0a684258180b914b49f32e2ea342c9 Mon Sep 17 00:00:00 2001 From: Koen Kooi Date: Wed, 1 Jul 2009 14:34:05 +0200 Subject: python-pygtksourceview: catch up with sourceview renaming --- recipes/python/python-pygtksourceview_2.6.0.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/python/python-pygtksourceview_2.6.0.bb b/recipes/python/python-pygtksourceview_2.6.0.bb index 0c2b335d1e..c91e52ac4c 100644 --- a/recipes/python/python-pygtksourceview_2.6.0.bb +++ b/recipes/python/python-pygtksourceview_2.6.0.bb @@ -2,7 +2,7 @@ DESCRIPTION = "Python gtksourceview Bindings" SECTION = "devel/python" HOMEPAGE = "http://projects.gnome.org/gtksourceview/pygtksourceview.html" PRIORITY = "optional" -DEPENDS = "gtksourceview python-pygtk" +DEPENDS = "gtksourceview2 python-pygtk" SRCNAME = "pygtksourceview" LICENSE = "LGPL" PR = "r0" -- cgit v1.2.3 From 486d524cfa02e2ba52219a76734f18967fbcf04a Mon Sep 17 00:00:00 2001 From: Florian Boor Date: Wed, 1 Jul 2009 20:58:42 +0200 Subject: checksums.init: add checksum for linux kernel patch-2.6.30-rc4.bz2 --- conf/checksums.ini | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/conf/checksums.ini b/conf/checksums.ini index 4dae8d5f4f..9da699d0f9 100644 --- a/conf/checksums.ini +++ b/conf/checksums.ini @@ -18950,6 +18950,10 @@ sha256=5ed217591fefb043f4deb7b66a9b6351195dfb9405c0d2f5ec0f4d43a30aa9b2 md5=cd69d16ea42bbf20d0a505690be45868 sha256=7d07783e7ba793c8e043a83a2aabcf23ef29174a1963643a407f3a02fcb4542b +[http://kernel.org/pub/linux/kernel/v2.6/testing/v2.6.30/patch-2.6.30-rc4.bz2] +md5=1672a3064a2bfe049715a1103f03561c +sha256=25a9aff47cc568e4bcaa4377cacbcae11ea454aeeea9519aa3a1b6dbffea713c + [http://kernel.org/pub/linux/kernel/v2.6/testing/patch-2.6.30-rc5.bz2] md5=2f399a5e286a9fe7cb40bfd3d42a7a3d sha256=79a9913a74e58af6431bb952aac2cf0a1f4422287f420844f24ca6bc5ed0fdc4 -- cgit v1.2.3 From 11ac596fc326167f02186b8b50026c401896a137 Mon Sep 17 00:00:00 2001 From: Stanislav Brabec Date: Wed, 1 Jul 2009 22:14:07 +0000 Subject: balsa: Updated to version 2.4.0. --- conf/checksums.ini | 4 ++ recipes/balsa/balsa-2.4.0/balsa-no-spell.patch | 53 +++++++++++++++++ recipes/balsa/balsa-2.4.0/balsa-touch.patch | 11 ++++ recipes/balsa/balsa_2.4.0.bb | 80 ++++++++++++++++++++++++++ 4 files changed, 148 insertions(+) create mode 100644 recipes/balsa/balsa-2.4.0/balsa-no-spell.patch create mode 100644 recipes/balsa/balsa-2.4.0/balsa-touch.patch create mode 100644 recipes/balsa/balsa_2.4.0.bb diff --git a/conf/checksums.ini b/conf/checksums.ini index 9da699d0f9..b2027d48e9 100644 --- a/conf/checksums.ini +++ b/conf/checksums.ini @@ -2210,6 +2210,10 @@ sha256=926688080fd75a8d6eab6c6ea1168dc03c591625c21af492ec0c13d816573516 md5=851db68728ed9adea615eb2f249fa1ee sha256=c450b49ce9903d97ed5e4aa788b388e014c0eddcfc038b000237f67cd4528a3b +[http://pawsa.fedorapeople.org/balsa/balsa-2.4.0.tar.bz2] +md5=47d68219a5ee768f1ebd2502a9c3c6f2 +sha256=f34f8eabb463815adbf18d78883e2e61c5ad0020e087152a4c7a604fcd5754ea + [ftp://ftp.debian.org/debian/pool/main/b/base-passwd/base-passwd_3.5.19.tar.gz] md5=5afcef5d6047f14cd5f65d2fdbd86fb2 sha256=43debdc36c9aed8a2ef366bf3e98c1440e643a5ae9e7e1423b6309ddee5ae25e 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 +} -- cgit v1.2.3 From 08e6f4644209958239e9bc745ada27a7eb2e4882 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Thu, 2 Jul 2009 00:08:40 +0200 Subject: util-linux-ng: Fix compile of 2.15 for uclibc Unconditionally include stdarg.h to introduce va_list to the compiler. uclibc has langinfo but not these kind of attributes. Guard the usage of these attribute similar to how the uclibc locale test program is doing it. --- recipes/util-linux-ng/files/uclibc-compile.patch | 25 ++++++++++++++++++++++++ recipes/util-linux-ng/util-linux-ng_2.15.bb | 1 + 2 files changed, 26 insertions(+) create mode 100644 recipes/util-linux-ng/files/uclibc-compile.patch 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 + #include ++#include + + #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.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" -- cgit v1.2.3 From a2f5d1f087f8d8dd529997b910ff2c46e51cd50b Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Thu, 2 Jul 2009 00:10:29 +0200 Subject: uclibc: Add x86/uClibc.machine for x86 uClibc config Currently each MACHINE needs a uClibc.machine config otherwise the uClibc compile will fail with weird error messages. Add a config for MACHINE="x86" and "suprisingly" it is almost the same as the qemux86 version. I sent an email asking for help to handle this duplication. Acked-By: Henning Heinold --- recipes/uclibc/uclibc-0.9.30.1/x86/uClibc.machine | 72 +++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 recipes/uclibc/uclibc-0.9.30.1/x86/uClibc.machine 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 -- cgit v1.2.3 From 9c3ffea91c078e92def02d7c3658b23fea12e608 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Thu, 2 Jul 2009 14:28:20 +0200 Subject: minimal-uclibc: Upgrade uclibc to 0.9.30.1 Catch up with micro-uclibc.conf by upgrading uclibc. I will spawn a discussion about the future of minimal(-uclibc) in the presence of micro(-uclibc). Acked-By: Phil Blundell --- conf/distro/minimal-uclibc.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/distro/minimal-uclibc.conf b/conf/distro/minimal-uclibc.conf index 34f92119b2..257d364292 100644 --- a/conf/distro/minimal-uclibc.conf +++ b/conf/distro/minimal-uclibc.conf @@ -31,7 +31,7 @@ USE_NLS_glib-2.0 = "yes" USE_NLS_glib-2.0-native = "yes" USE_NLS_gcc-cross = "no" -PREFERRED_VERSION_uclibc = "0.9.30" -PREFERRED_VERSION_uclibc-initial = "0.9.30" +PREFERRED_VERSION_uclibc = "0.9.30.1" +PREFERRED_VERSION_uclibc-initial = "0.9.30.1" require conf/distro/minimal.conf -- cgit v1.2.3 From 33e3a38aa15042126c6bfc50358800dac59d028b Mon Sep 17 00:00:00 2001 From: Marcin Juszkiewicz Date: Thu, 2 Jul 2009 14:02:00 +0200 Subject: classpath: depend on gmp (for libjavamath) and do not use system one --- recipes/classpath/classpath.inc | 2 +- recipes/classpath/classpath_0.98.bb | 3 ++- recipes/classpath/files/fix-gmp.patch | 19 +++++++++++++++++++ 3 files changed, 22 insertions(+), 2 deletions(-) create mode 100644 recipes/classpath/files/fix-gmp.patch diff --git a/recipes/classpath/classpath.inc b/recipes/classpath/classpath.inc index da3273bc97..bf630bf569 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" RPROVIDES = "" RDEPENDS_${PN} = "${PBN}-common (>= ${PV})" diff --git a/recipes/classpath/classpath_0.98.bb b/recipes/classpath/classpath_0.98.bb index 292c49ff1a..13f7a72b44 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 = "r1" 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) -- cgit v1.2.3 From 0514bb1d469b25b42871175da2757102a3d75118 Mon Sep 17 00:00:00 2001 From: Stanislav Brabec Date: Thu, 2 Jul 2009 19:12:51 +0000 Subject: epiphany: iso-codes is a runtime dependency. --- recipes/gnome/epiphany_2.21.92.bb | 4 ++-- recipes/gnome/epiphany_2.22.1.bb | 4 ++-- recipes/gnome/epiphany_2.24.0.bb | 3 ++- recipes/gnome/epiphany_2.24.2.bb | 4 ++-- recipes/gnome/epiphany_2.27.1.bb | 3 ++- recipes/gnome/epiphany_svn.bb | 4 ++-- 6 files changed, 12 insertions(+), 10 deletions(-) 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 -- cgit v1.2.3 From 8c2db6479de9bc12e548e80a92b33ab81837b953 Mon Sep 17 00:00:00 2001 From: Brian Bloniarz Date: Thu, 2 Jul 2009 22:10:36 -0400 Subject: initscripts: correct checkroot rootfs read-write check initscripts: correct checkroot rootfs read-write check Fixes a regexp typo when checking whether the rootfs needs to be remounted. Also alters the remount logic to not assume that the root will be mounted RW. Signed-off-by: Brian Bloniarz recipes/initscripts/initscripts-1.0/checkroot | 18 +++++++++--------- 1 files changed, 9 insertions(+), 9 deletions(-) --- recipes/initscripts/initscripts-1.0/checkroot | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) 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 -- cgit v1.2.3 From 2e23feebced982ef9a22d30ae2a4cfe453103c70 Mon Sep 17 00:00:00 2001 From: Stanislav Brabec Date: Fri, 3 Jul 2009 20:41:19 +0000 Subject: pidgin: Updated to version 2.5.8. --- conf/checksums.ini | 4 ++++ conf/distro/include/preferred-om-2008-versions.inc | 2 +- recipes/pidgin/pidgin/purple-OE-branding.patch | 14 -------------- recipes/pidgin/pidgin_2.5.3.bb | 17 ----------------- recipes/pidgin/pidgin_2.5.8.bb | 17 +++++++++++++++++ 5 files changed, 22 insertions(+), 32 deletions(-) delete mode 100644 recipes/pidgin/pidgin/purple-OE-branding.patch delete mode 100644 recipes/pidgin/pidgin_2.5.3.bb create mode 100644 recipes/pidgin/pidgin_2.5.8.bb diff --git a/conf/checksums.ini b/conf/checksums.ini index b2027d48e9..0677d6c63d 100644 --- a/conf/checksums.ini +++ b/conf/checksums.ini @@ -19254,6 +19254,10 @@ sha256=13e87a88b43804be72f8566402afa4c1c3756396aed4ef6b6b9d86d384e75b77 md5=4abc4ce9e1ad62bbf098f05f305147d7 sha256=912c934425fc40535fc79eb9082f6f823808d8ea8ecdd370d0b8ceec4b97ad82 +[http://downloads.sourceforge.net/pidgin/pidgin-2.5.8.tar.bz2] +md5=c207407dca71c6357c82135875e472f0 +sha256=2f79da1f127dd05f9404494ebc794f8cda919764fd2424f79df31f3b0f9dfd21 + [ftp://ftp.cac.washington.edu/pine/pine4.64.tar.Z] md5=75af127948cc0c701d424d22d621f792 sha256=62c7b97695cb486e420afbbbe21bef853dd68a71665d867ffef50cb34dfba5f4 diff --git a/conf/distro/include/preferred-om-2008-versions.inc b/conf/distro/include/preferred-om-2008-versions.inc index 65676ec969..b81f0b17e1 100644 --- a/conf/distro/include/preferred-om-2008-versions.inc +++ b/conf/distro/include/preferred-om-2008-versions.inc @@ -1429,7 +1429,7 @@ PREFERRED_VERSION_phoneserver ?= "1.0" PREFERRED_VERSION_php ?= "5.2.0" PREFERRED_VERSION_php-native ?= "5.2.0" PREFERRED_VERSION_picocom ?= "1.4" -PREFERRED_VERSION_pidgin ?= "2.5.3" +PREFERRED_VERSION_pidgin ?= "2.5.8" PREFERRED_VERSION_pine ?= "4.64" PREFERRED_VERSION_pipeman ?= "1.0.0" PREFERRED_VERSION_pipepanic ?= "0.1.1" 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.3.bb deleted file mode 100644 index 17d0270456..0000000000 --- a/recipes/pidgin/pidgin_2.5.3.bb +++ /dev/null @@ -1,17 +0,0 @@ -require pidgin.inc - -SRC_URI = "\ - ${SOURCEFORGE_MIRROR}/pidgin/pidgin-${PV}.tar.bz2 \ - file://sanitize-configure.ac.patch;patch=1 \ - file://gconf-no-errors.patch;patch=1 \ - file://pidgin.desktop-set-icon.patch;patch=1 \ - file://purple-OE-branding-25.patch;patch=1 \ - file://pidgin-cross-python.patch;patch=1 \ -" - -EXTRA_OECONF += "\ - --disable-gtkspell \ - --disable-meanwhile \ - --disable-nm \ - --disable-screensaver \ -" diff --git a/recipes/pidgin/pidgin_2.5.8.bb b/recipes/pidgin/pidgin_2.5.8.bb new file mode 100644 index 0000000000..17d0270456 --- /dev/null +++ b/recipes/pidgin/pidgin_2.5.8.bb @@ -0,0 +1,17 @@ +require pidgin.inc + +SRC_URI = "\ + ${SOURCEFORGE_MIRROR}/pidgin/pidgin-${PV}.tar.bz2 \ + file://sanitize-configure.ac.patch;patch=1 \ + file://gconf-no-errors.patch;patch=1 \ + file://pidgin.desktop-set-icon.patch;patch=1 \ + file://purple-OE-branding-25.patch;patch=1 \ + file://pidgin-cross-python.patch;patch=1 \ +" + +EXTRA_OECONF += "\ + --disable-gtkspell \ + --disable-meanwhile \ + --disable-nm \ + --disable-screensaver \ +" -- cgit v1.2.3