summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-04-05 16:29:25 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-04-05 16:29:25 -0700
commit820729eb1fb0e75dd6908134fbd31bcc6bd6c345 (patch)
tree41542f9da2f68cf26ab93b0bb568439fd38adae5
parent36a9cafd9b36eab01f8d0717bcf987d2425c2cd3 (diff)
downloadlinux-3.10-820729eb1fb0e75dd6908134fbd31bcc6bd6c345.tar.gz
linux-3.10-820729eb1fb0e75dd6908134fbd31bcc6bd6c345.tar.bz2
linux-3.10-820729eb1fb0e75dd6908134fbd31bcc6bd6c345.zip
add gadget fixes and update to kernel version 3.4.39
-rw-r--r--KERNEL_VERSION2
-rw-r--r--patches.at91/0124-video-atmel_lcdfb-add-support-for-AT91SAM9x5.patch81
-rw-r--r--patches.at91/0125-video-atmel_lcdfb-The-output-bpp-should-not-change-a.patch11
-rw-r--r--patches.at91/0126-video-atmelfb-initially-split-atmelfb-into-a-driver-.patch72
-rw-r--r--patches.at91/0132-video-atmelfb-refactor-LUT.patch23
-rw-r--r--patches.at91/0134-arm-at91-refactor-lcdc-includes.patch2240
-rw-r--r--patches.at91/0215-tty-atmel_serial-add-pinctrl-support.patch11
-rw-r--r--patches.dma-mapping/cma-fix-migration-mode.patch9
-rw-r--r--patches.dma-mapping/mm-clean-up-__count_immobile_pages.patch15
-rw-r--r--patches.dma-mapping/mm-cma-don-t-replace-lowmem-pages-with-highmem.patch9
-rw-r--r--patches.dma-mapping/mm-factor-out-memory-isolate-functions.patch35
-rw-r--r--patches.dma-mapping/mm-mmzone-migrate_cma-migration-type-added.patch49
-rw-r--r--patches.dma-mapping/mm-page_alloc-introduce-alloc_contig_range.patch15
-rw-r--r--patches.dma-mapping/mm-page_alloc-remove-trailing-whitespace.patch11
-rw-r--r--patches.dma-mapping/mm-page_isolation-migrate_cma-isolation-functions-added.patch12
-rw-r--r--patches.dma-mapping/mm-serialize-access-to-min_free_kbytes.patch11
-rw-r--r--patches.dma-mapping/mm-trigger-page-reclaim-in-alloc_contig_range-to-stabilise-watermarks.patch17
-rw-r--r--patches.fixes/usb-gadget-acm_ms-need-to-set-max_speed.patch33
-rw-r--r--patches.fixes/usb-gadget-composite-fix-ep-maxburst-initialization.patch65
-rw-r--r--patches.fixes/usb-gadget-f_mass_storage-change-default-value-of-the-removable-parameter.patch50
-rw-r--r--patches.fixes/usb-gadget-mass_storage-add-documentation.patch349
-rw-r--r--patches.fixes/usb-gadget-mass_storage-fail-fsg_store_file-early-if-colud-not-open-file.patch139
-rw-r--r--patches.fixes/usb-gadget-mass_storage-make-file-and-ro-read-only-in-some-cases.patch98
-rw-r--r--patches.fixes/usb-gadget-mass_storage-remove-unused-options.patch118
-rw-r--r--patches.fixes/usb-gadget-storage_common-remove-fsg_buffhd_static_buffer-support.patch52
-rw-r--r--patches.ltsi/ltsi-makefile-addition.patch2
-rw-r--r--series8
27 files changed, 3028 insertions, 509 deletions
diff --git a/KERNEL_VERSION b/KERNEL_VERSION
index 51335e1c81b..1ded3663d3e 100644
--- a/KERNEL_VERSION
+++ b/KERNEL_VERSION
@@ -1 +1 @@
-3.4.31
+3.4.39
diff --git a/patches.at91/0124-video-atmel_lcdfb-add-support-for-AT91SAM9x5.patch b/patches.at91/0124-video-atmel_lcdfb-add-support-for-AT91SAM9x5.patch
index 91e93551533..ffafb211edd 100644
--- a/patches.at91/0124-video-atmel_lcdfb-add-support-for-AT91SAM9x5.patch
+++ b/patches.at91/0124-video-atmel_lcdfb-add-support-for-AT91SAM9x5.patch
@@ -16,15 +16,12 @@ Conflicts:
drivers/video/atmel_lcdfb.c
---
- arch/arm/mach-at91/include/mach/atmel_hlcdfb.h | 865 +++++++++++++++++++++++++
- drivers/video/atmel_lcdfb.c | 668 ++++++++++++++-----
- include/video/atmel_lcdc.h | 15 +
- 3 files changed, 1389 insertions(+), 159 deletions(-)
+ arch/arm/mach-at91/include/mach/atmel_hlcdfb.h | 865 +++++++++++++++++++++++++
+ drivers/video/atmel_lcdfb.c | 670 ++++++++++++++-----
+ include/video/atmel_lcdc.h | 15
+ 3 files changed, 1390 insertions(+), 160 deletions(-)
create mode 100644 arch/arm/mach-at91/include/mach/atmel_hlcdfb.h
-diff --git a/arch/arm/mach-at91/include/mach/atmel_hlcdfb.h b/arch/arm/mach-at91/include/mach/atmel_hlcdfb.h
-new file mode 100644
-index 0000000..a57b79b
--- /dev/null
+++ b/arch/arm/mach-at91/include/mach/atmel_hlcdfb.h
@@ -0,0 +1,865 @@
@@ -893,8 +890,6 @@ index 0000000..a57b79b
+
+
+#endif /* __ATMEL_HLCDC4_H__ */
-diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
-index d99505b..c35f5c7 100644
--- a/drivers/video/atmel_lcdfb.c
+++ b/drivers/video/atmel_lcdfb.c
@@ -1,7 +1,7 @@
@@ -914,7 +909,7 @@ index d99505b..c35f5c7 100644
#define lcdc_readl(sinfo, reg) __raw_readl((sinfo)->mmio+(reg))
#define lcdc_writel(sinfo, reg, val) __raw_writel((val), (sinfo)->mmio+(reg))
-@@ -76,6 +77,9 @@ static u32 contrast_ctr = ATMEL_LCDC_PS_DIV8
+@@ -76,6 +77,9 @@ static u32 contrast_ctr = ATMEL_LCDC_PS_
| ATMEL_LCDC_POL_POSITIVE
| ATMEL_LCDC_ENA_PWMENABLE;
@@ -924,7 +919,7 @@ index d99505b..c35f5c7 100644
#ifdef CONFIG_BACKLIGHT_ATMEL_LCDC
/* some bl->props field just changed */
-@@ -84,6 +88,7 @@ static int atmel_bl_update_status(struct backlight_device *bl)
+@@ -84,6 +88,7 @@ static int atmel_bl_update_status(struct
struct atmel_lcdfb_info *sinfo = bl_get_data(bl);
int power = sinfo->bl_power;
int brightness = bl->props.brightness;
@@ -932,7 +927,7 @@ index d99505b..c35f5c7 100644
/* REVISIT there may be a meaningful difference between
* fb_blank and power ... there seem to be some cases
-@@ -94,17 +99,28 @@ static int atmel_bl_update_status(struct backlight_device *bl)
+@@ -94,17 +99,28 @@ static int atmel_bl_update_status(struct
else if (bl->props.power != sinfo->bl_power)
power = bl->props.power;
@@ -970,7 +965,7 @@ index d99505b..c35f5c7 100644
bl->props.fb_blank = bl->props.power = sinfo->bl_power = power;
-@@ -115,7 +131,10 @@ static int atmel_bl_get_brightness(struct backlight_device *bl)
+@@ -115,7 +131,10 @@ static int atmel_bl_get_brightness(struc
{
struct atmel_lcdfb_info *sinfo = bl_get_data(bl);
@@ -982,7 +977,7 @@ index d99505b..c35f5c7 100644
}
static const struct backlight_ops atmel_lcdc_bl_ops = {
-@@ -171,14 +190,17 @@ static void exit_backlight(struct atmel_lcdfb_info *sinfo)
+@@ -171,14 +190,17 @@ static void exit_backlight(struct atmel_
static void init_contrast(struct atmel_lcdfb_info *sinfo)
{
@@ -1008,13 +1003,17 @@ index d99505b..c35f5c7 100644
if (sinfo->lcdcon_is_backlight)
init_backlight(sinfo);
}
-@@ -220,32 +242,78 @@ static unsigned long compute_hozval(unsigned long xres, unsigned long lcdcon2)
+@@ -220,32 +242,78 @@ static unsigned long compute_hozval(unsi
static void atmel_lcdfb_stop_nowait(struct atmel_lcdfb_info *sinfo)
{
- /* Turn off the LCD controller and the DMA controller */
- lcdc_writel(sinfo, ATMEL_LCDC_PWRCON,
- sinfo->guard_time << ATMEL_LCDC_GUARDT_OFFSET);
+-
+- /* Wait for the LCDC core to become idle */
+- while (lcdc_readl(sinfo, ATMEL_LCDC_PWRCON) & ATMEL_LCDC_BUSY)
+- msleep(10);
+ if (cpu_is_at91sam9x5()) {
+ /* Disable DISP signal */
+ lcdc_writel(sinfo, ATMEL_LCDC_LCDDIS, LCDC_LCDDIS_DISPDIS);
@@ -1036,10 +1035,7 @@ index d99505b..c35f5c7 100644
+ /* Turn off the LCD controller and the DMA controller */
+ lcdc_writel(sinfo, ATMEL_LCDC_PWRCON,
+ sinfo->guard_time << ATMEL_LCDC_GUARDT_OFFSET);
-
-- /* Wait for the LCDC core to become idle */
-- while (lcdc_readl(sinfo, ATMEL_LCDC_PWRCON) & ATMEL_LCDC_BUSY)
-- msleep(10);
++
+ /* Wait for the LCDC core to become idle */
+ while (lcdc_readl(sinfo, ATMEL_LCDC_PWRCON) & ATMEL_LCDC_BUSY)
+ msleep(10);
@@ -1101,7 +1097,7 @@ index d99505b..c35f5c7 100644
}
static void atmel_lcdfb_update_dma(struct fb_info *info,
-@@ -254,14 +322,31 @@ static void atmel_lcdfb_update_dma(struct fb_info *info,
+@@ -254,14 +322,31 @@ static void atmel_lcdfb_update_dma(struc
struct atmel_lcdfb_info *sinfo = info->par;
struct fb_fix_screeninfo *fix = &info->fix;
unsigned long dma_addr;
@@ -1135,7 +1131,7 @@ index d99505b..c35f5c7 100644
atmel_lcdfb_update_dma2d(sinfo, var, info);
}
-@@ -272,12 +357,18 @@ static inline void atmel_lcdfb_free_video_memory(struct atmel_lcdfb_info *sinfo)
+@@ -272,12 +357,18 @@ static inline void atmel_lcdfb_free_vide
dma_free_writecombine(info->device, info->fix.smem_len,
info->screen_base, info->fix.smem_start);
@@ -1155,7 +1151,7 @@ index d99505b..c35f5c7 100644
* This function is called only from the atmel_lcdfb_probe()
* so no locking by fb_info->mm_lock around smem_len setting is needed.
*/
-@@ -300,6 +391,19 @@ static int atmel_lcdfb_alloc_video_memory(struct atmel_lcdfb_info *sinfo)
+@@ -300,6 +391,19 @@ static int atmel_lcdfb_alloc_video_memor
memset(info->screen_base, 0, info->fix.smem_len);
@@ -1175,7 +1171,7 @@ index d99505b..c35f5c7 100644
return 0;
}
-@@ -393,18 +497,33 @@ static int atmel_lcdfb_check_var(struct fb_var_screeninfo *var,
+@@ -393,18 +497,33 @@ static int atmel_lcdfb_check_var(struct
}
/* Saturate vertical and horizontal timings at maximum values */
@@ -1221,7 +1217,7 @@ index d99505b..c35f5c7 100644
/* Some parameters can't be zero */
var->vsync_len = max_t(u32, var->vsync_len, 1);
-@@ -419,9 +538,53 @@ static int atmel_lcdfb_check_var(struct fb_var_screeninfo *var,
+@@ -419,9 +538,53 @@ static int atmel_lcdfb_check_var(struct
case 8:
var->red.offset = var->green.offset = var->blue.offset = 0;
var->red.length = var->green.length = var->blue.length
@@ -1273,10 +1269,10 @@ index d99505b..c35f5c7 100644
+ }
+ break;
+ }
- if (sinfo->lcd_wiring_mode == ATMEL_LCDC_WIRING_RGB) {
- /* RGB:565 mode */
- var->red.offset = 11;
-@@ -436,6 +599,7 @@ static int atmel_lcdfb_check_var(struct fb_var_screeninfo *var,
+ /* Older SOCs use IBGR:555 rather than BGR:565. */
+ if (sinfo->have_intensity_bit)
+ var->green.length = 5;
+@@ -441,6 +604,7 @@ static int atmel_lcdfb_check_var(struct
var->red.length = var->blue.length = 5;
break;
case 32:
@@ -1284,7 +1280,7 @@ index d99505b..c35f5c7 100644
var->transp.offset = 24;
var->transp.length = 8;
/* fall through */
-@@ -472,6 +636,252 @@ static void atmel_lcdfb_reset(struct atmel_lcdfb_info *sinfo)
+@@ -477,6 +641,252 @@ static void atmel_lcdfb_reset(struct atm
atmel_lcdfb_start(sinfo);
}
@@ -1537,7 +1533,7 @@ index d99505b..c35f5c7 100644
/**
* atmel_lcdfb_set_par - Alters the hardware state.
* @info: frame buffer structure that represents a single frame buffer
-@@ -489,11 +899,7 @@ static void atmel_lcdfb_reset(struct atmel_lcdfb_info *sinfo)
+@@ -494,11 +904,7 @@ static void atmel_lcdfb_reset(struct atm
static int atmel_lcdfb_set_par(struct fb_info *info)
{
struct atmel_lcdfb_info *sinfo = info->par;
@@ -1549,7 +1545,7 @@ index d99505b..c35f5c7 100644
might_sleep();
-@@ -518,98 +924,8 @@ static int atmel_lcdfb_set_par(struct fb_info *info)
+@@ -523,98 +929,8 @@ static int atmel_lcdfb_set_par(struct fb
dev_dbg(info->device, " * update DMA engine\n");
atmel_lcdfb_update_dma(info, &info->var);
@@ -1649,7 +1645,7 @@ index d99505b..c35f5c7 100644
atmel_lcdfb_start(sinfo);
-@@ -772,14 +1088,32 @@ static irqreturn_t atmel_lcdfb_interrupt(int irq, void *dev_id)
+@@ -776,14 +1092,32 @@ static irqreturn_t atmel_lcdfb_interrupt
struct fb_info *info = dev_id;
struct atmel_lcdfb_info *sinfo = info->par;
u32 status;
@@ -1688,7 +1684,7 @@ index d99505b..c35f5c7 100644
return IRQ_HANDLED;
}
-@@ -920,6 +1254,8 @@ static int __init atmel_lcdfb_probe(struct platform_device *pdev)
+@@ -928,6 +1262,8 @@ static int __init atmel_lcdfb_probe(stru
/* Initialize video memory */
map = platform_get_resource(pdev, IORESOURCE_MEM, 1);
@@ -1697,7 +1693,7 @@ index d99505b..c35f5c7 100644
if (map) {
/* use a pre-allocated memory buffer */
info->fix.smem_start = map->start;
-@@ -1030,7 +1366,7 @@ unmap_mmio:
+@@ -1038,7 +1374,7 @@ unmap_mmio:
exit_backlight(sinfo);
iounmap(sinfo->mmio);
release_mem:
@@ -1706,7 +1702,7 @@ index d99505b..c35f5c7 100644
free_fb:
if (map)
iounmap(info->screen_base);
-@@ -1075,7 +1411,7 @@ static int __exit atmel_lcdfb_remove(struct platform_device *pdev)
+@@ -1083,7 +1419,7 @@ static int __exit atmel_lcdfb_remove(str
fb_dealloc_cmap(&info->cmap);
free_irq(sinfo->irq_base, info);
iounmap(sinfo->mmio);
@@ -1715,7 +1711,7 @@ index d99505b..c35f5c7 100644
if (platform_get_resource(pdev, IORESOURCE_MEM, 1)) {
iounmap(info->screen_base);
release_mem_region(info->fix.smem_start, info->fix.smem_len);
-@@ -1100,10 +1436,17 @@ static int atmel_lcdfb_suspend(struct platform_device *pdev, pm_message_t mesg)
+@@ -1108,10 +1444,17 @@ static int atmel_lcdfb_suspend(struct pl
* We don't want to handle interrupts while the clock is
* stopped. It may take forever.
*/
@@ -1736,7 +1732,7 @@ index d99505b..c35f5c7 100644
if (sinfo->atmel_lcdfb_power_control)
sinfo->atmel_lcdfb_power_control(0);
-@@ -1122,11 +1465,18 @@ static int atmel_lcdfb_resume(struct platform_device *pdev)
+@@ -1130,11 +1473,18 @@ static int atmel_lcdfb_resume(struct pla
atmel_lcdfb_start(sinfo);
if (sinfo->atmel_lcdfb_power_control)
sinfo->atmel_lcdfb_power_control(1);
@@ -1759,8 +1755,6 @@ index d99505b..c35f5c7 100644
return 0;
}
-diff --git a/include/video/atmel_lcdc.h b/include/video/atmel_lcdc.h
-index 28447f1..5183ab7 100644
--- a/include/video/atmel_lcdc.h
+++ b/include/video/atmel_lcdc.h
@@ -47,12 +47,16 @@ struct atmel_lcdfb_info {
@@ -1780,8 +1774,8 @@ index 28447f1..5183ab7 100644
u8 saved_lcdcon;
u8 default_bpp;
-@@ -64,6 +68,12 @@ struct atmel_lcdfb_info {
- u32 pseudo_palette[16];
+@@ -65,6 +69,12 @@ struct atmel_lcdfb_info {
+ bool have_intensity_bit;
};
+struct lcd_dma_desc {
@@ -1793,7 +1787,7 @@ index 28447f1..5183ab7 100644
#define ATMEL_LCDC_DMABADDR1 0x00
#define ATMEL_LCDC_DMABADDR2 0x04
#define ATMEL_LCDC_DMAFRMPT1 0x08
-@@ -214,6 +224,11 @@ struct atmel_lcdfb_info {
+@@ -215,6 +225,11 @@ struct atmel_lcdfb_info {
#define ATMEL_LCDC_OWRI (1 << 5)
#define ATMEL_LCDC_MERI (1 << 6)
@@ -1805,6 +1799,3 @@ index 28447f1..5183ab7 100644
+#endif
#endif /* __ATMEL_LCDC_H__ */
---
-1.8.0.197.g5a90748
-
diff --git a/patches.at91/0125-video-atmel_lcdfb-The-output-bpp-should-not-change-a.patch b/patches.at91/0125-video-atmel_lcdfb-The-output-bpp-should-not-change-a.patch
index 5dcc36c412e..d3086416950 100644
--- a/patches.at91/0125-video-atmel_lcdfb-The-output-bpp-should-not-change-a.patch
+++ b/patches.at91/0125-video-atmel_lcdfb-The-output-bpp-should-not-change-a.patch
@@ -15,14 +15,12 @@ XXX: these are two different changes?
Signed-off-by: Josh Wu <josh.wu@atmel.com>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
- drivers/video/atmel_lcdfb.c | 25 +++----------------------
+ drivers/video/atmel_lcdfb.c | 25 +++----------------------
1 file changed, 3 insertions(+), 22 deletions(-)
-diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
-index c35f5c7..ae0e8e9 100644
--- a/drivers/video/atmel_lcdfb.c
+++ b/drivers/video/atmel_lcdfb.c
-@@ -666,7 +666,9 @@ static int atmel_lcdfb_setup_9x5_core(struct fb_info *info)
+@@ -671,7 +671,9 @@ static int atmel_lcdfb_setup_9x5_core(st
}
/* Initialize control register 5 */
@@ -33,7 +31,7 @@ index c35f5c7..ae0e8e9 100644
| LCDC_LCDCFG5_DISPDLY
| LCDC_LCDCFG5_VSPDLYS;
-@@ -675,27 +677,6 @@ static int atmel_lcdfb_setup_9x5_core(struct fb_info *info)
+@@ -680,27 +682,6 @@ static int atmel_lcdfb_setup_9x5_core(st
if (!(info->var.sync & FB_SYNC_VERT_HIGH_ACT))
value |= LCDC_LCDCFG5_VSPOL;
@@ -61,6 +59,3 @@ index c35f5c7..ae0e8e9 100644
dev_dbg(info->device, " * LCDC_LCDCFG5 = %08lx\n", value);
lcdc_writel(sinfo, ATMEL_LCDC_LCDCFG5, value);
---
-1.8.0.197.g5a90748
-
diff --git a/patches.at91/0126-video-atmelfb-initially-split-atmelfb-into-a-driver-.patch b/patches.at91/0126-video-atmelfb-initially-split-atmelfb-into-a-driver-.patch
index 90ddaf22bba..dedf2695444 100644
--- a/patches.at91/0126-video-atmelfb-initially-split-atmelfb-into-a-driver-.patch
+++ b/patches.at91/0126-video-atmelfb-initially-split-atmelfb-into-a-driver-.patch
@@ -14,18 +14,16 @@ Conflicts:
drivers/video/atmel_lcdfb.c
---
- drivers/video/Makefile | 2 +-
- drivers/video/atmel_lcdfb.c | 1427 +-------------------------------------
- drivers/video/atmel_lcdfb_core.c | 1077 ++++++++++++++++++++++++++++
- include/video/atmel_lcdc.h | 17 +-
- 4 files changed, 1104 insertions(+), 1419 deletions(-)
+ drivers/video/Makefile | 2
+ drivers/video/atmel_lcdfb.c | 1439 ---------------------------------------
+ drivers/video/atmel_lcdfb_core.c | 1077 +++++++++++++++++++++++++++++
+ include/video/atmel_lcdc.h | 17
+ 4 files changed, 1106 insertions(+), 1429 deletions(-)
create mode 100644 drivers/video/atmel_lcdfb_core.c
-diff --git a/drivers/video/Makefile b/drivers/video/Makefile
-index 9356add..37c5625 100644
--- a/drivers/video/Makefile
+++ b/drivers/video/Makefile
-@@ -95,7 +95,7 @@ obj-$(CONFIG_FB_EP93XX) += ep93xx-fb.o
+@@ -95,7 +95,7 @@ obj-$(CONFIG_FB_EP93XX) += ep93xx-fb.
obj-$(CONFIG_FB_SA1100) += sa1100fb.o
obj-$(CONFIG_FB_HIT) += hitfb.o
obj-$(CONFIG_FB_EPSON1355) += epson1355fb.o
@@ -34,11 +32,9 @@ index 9356add..37c5625 100644
obj-$(CONFIG_FB_PVR2) += pvr2fb.o
obj-$(CONFIG_FB_VOODOO1) += sstfb.o
obj-$(CONFIG_FB_ARMCLCD) += amba-clcd.o
-diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
-index ae0e8e9..4e1454c 100644
--- a/drivers/video/atmel_lcdfb.c
+++ b/drivers/video/atmel_lcdfb.c
-@@ -10,1401 +10,12 @@
+@@ -10,1409 +10,12 @@
#include <linux/kernel.h>
#include <linux/platform_device.h>
@@ -617,17 +613,22 @@ index ae0e8e9..4e1454c 100644
- }
- break;
- }
+- /* Older SOCs use IBGR:555 rather than BGR:565. */
+- if (sinfo->have_intensity_bit)
+- var->green.length = 5;
+- else
+- var->green.length = 6;
+-
- if (sinfo->lcd_wiring_mode == ATMEL_LCDC_WIRING_RGB) {
-- /* RGB:565 mode */
-- var->red.offset = 11;
+- /* RGB:5X5 mode */
+- var->red.offset = var->green.length + 5;
- var->blue.offset = 0;
- } else {
-- /* BGR:565 mode */
+- /* BGR:5X5 mode */
- var->red.offset = 0;
-- var->blue.offset = 11;
+- var->blue.offset = var->green.length + 5;
- }
- var->green.offset = 5;
-- var->green.length = 6;
- var->red.length = var->blue.length = 5;
- break;
- case 32:
@@ -1008,8 +1009,7 @@ index ae0e8e9..4e1454c 100644
-
- case FB_VISUAL_PSEUDOCOLOR:
- if (regno < 256) {
-- if (cpu_is_at91sam9261() || cpu_is_at91sam9263()
-- || cpu_is_at91sam9rl()) {
+- if (sinfo->have_intensity_bit) {
- /* old style I+BGR:555 */
- val = ((red >> 11) & 0x001f);
- val |= ((green >> 6) & 0x03e0);
@@ -1217,6 +1217,10 @@ index ae0e8e9..4e1454c 100644
- }
- sinfo->info = info;
- sinfo->pdev = pdev;
+- if (cpu_is_at91sam9261() || cpu_is_at91sam9263() ||
+- cpu_is_at91sam9rl()) {
+- sinfo->have_intensity_bit = true;
+- }
-
- strcpy(info->fix.id, sinfo->pdev->name);
- info->flags = ATMEL_LCDFB_FBINFO_DEFAULT;
@@ -1440,7 +1444,7 @@ index ae0e8e9..4e1454c 100644
#ifdef CONFIG_PM
-@@ -1417,16 +28,10 @@ static int atmel_lcdfb_suspend(struct platform_device *pdev, pm_message_t mesg)
+@@ -1425,16 +28,10 @@ static int atmel_lcdfb_suspend(struct pl
* We don't want to handle interrupts while the clock is
* stopped. It may take forever.
*/
@@ -1450,17 +1454,18 @@ index ae0e8e9..4e1454c 100644
- lcdc_writel(sinfo, ATMEL_LCDC_BASEIDR, ~0UL);
- } else {
- lcdc_writel(sinfo, ATMEL_LCDC_IDR, ~0UL);
-+ lcdc_writel(sinfo, ATMEL_LCDC_IDR, ~0UL);
-
+-
- sinfo->saved_lcdcon = lcdc_readl(sinfo, ATMEL_LCDC_CONTRAST_VAL);
- lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_CTR, 0);
- }
++ lcdc_writel(sinfo, ATMEL_LCDC_IDR, ~0UL);
++
+ sinfo->saved_lcdcon = lcdc_readl(sinfo, ATMEL_LCDC_CONTRAST_VAL);
+ lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_CTR, 0);
if (sinfo->atmel_lcdfb_power_control)
sinfo->atmel_lcdfb_power_control(0);
-@@ -1447,17 +52,11 @@ static int atmel_lcdfb_resume(struct platform_device *pdev)
+@@ -1455,17 +52,11 @@ static int atmel_lcdfb_resume(struct pla
if (sinfo->atmel_lcdfb_power_control)
sinfo->atmel_lcdfb_power_control(1);
@@ -1470,19 +1475,20 @@ index ae0e8e9..4e1454c 100644
- lcdc_writel(sinfo, ATMEL_LCDC_LCDIER, LCDC_LCDIER_FIFOERRIE | LCDC_LCDIER_BASEIE);
- } else {
- lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_CTR, sinfo->saved_lcdcon);
-+ lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_CTR, sinfo->saved_lcdcon);
-
+-
- /* Enable FIFO & DMA errors */
- lcdc_writel(sinfo, ATMEL_LCDC_IER, ATMEL_LCDC_UFLWI
- | ATMEL_LCDC_OWRI | ATMEL_LCDC_MERI);
- }
++ lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_CTR, sinfo->saved_lcdcon);
++
+ /* Enable FIFO & DMA errors */
+ lcdc_writel(sinfo, ATMEL_LCDC_IER, ATMEL_LCDC_UFLWI
+ | ATMEL_LCDC_OWRI | ATMEL_LCDC_MERI);
return 0;
}
-@@ -1467,6 +66,15 @@ static int atmel_lcdfb_resume(struct platform_device *pdev)
+@@ -1475,6 +66,15 @@ static int atmel_lcdfb_resume(struct pla
#define atmel_lcdfb_resume NULL
#endif
@@ -1498,7 +1504,7 @@ index ae0e8e9..4e1454c 100644
static struct platform_driver atmel_lcdfb_driver = {
.remove = __exit_p(atmel_lcdfb_remove),
.suspend = atmel_lcdfb_suspend,
-@@ -1482,13 +90,12 @@ static int __init atmel_lcdfb_init(void)
+@@ -1490,13 +90,12 @@ static int __init atmel_lcdfb_init(void)
{
return platform_driver_probe(&atmel_lcdfb_driver, atmel_lcdfb_probe);
}
@@ -1513,9 +1519,6 @@ index ae0e8e9..4e1454c 100644
module_exit(atmel_lcdfb_exit);
MODULE_DESCRIPTION("AT91/AT32 LCD Controller framebuffer driver");
-diff --git a/drivers/video/atmel_lcdfb_core.c b/drivers/video/atmel_lcdfb_core.c
-new file mode 100644
-index 0000000..54bdbcb
--- /dev/null
+++ b/drivers/video/atmel_lcdfb_core.c
@@ -0,0 +1,1077 @@
@@ -1790,7 +1793,7 @@ index 0000000..54bdbcb
+/**
+ * atmel_lcdfb_alloc_video_memory - Allocate framebuffer memory
+ * @sinfo: the frame buffer to allocate memory for
-+ *
++ *
+ * This function is called only from the atmel_lcdfb_probe()
+ * so no locking by fb_info->mm_lock around smem_len setting is needed.
+ */
@@ -2596,8 +2599,6 @@ index 0000000..54bdbcb
+ return 0;
+}
+EXPORT_SYMBOL_GPL(__atmel_lcdfb_remove);
-diff --git a/include/video/atmel_lcdc.h b/include/video/atmel_lcdc.h
-index 5183ab7..4fa084b 100644
--- a/include/video/atmel_lcdc.h
+++ b/include/video/atmel_lcdc.h
@@ -32,6 +32,13 @@
@@ -2624,8 +2625,8 @@ index 5183ab7..4fa084b 100644
#ifdef CONFIG_BACKLIGHT_ATMEL_LCDC
struct backlight_device *backlight;
u8 bl_power;
-@@ -68,11 +72,8 @@ struct atmel_lcdfb_info {
- u32 pseudo_palette[16];
+@@ -69,11 +73,8 @@ struct atmel_lcdfb_info {
+ bool have_intensity_bit;
};
-struct lcd_dma_desc {
@@ -2638,6 +2639,3 @@ index 5183ab7..4fa084b 100644
#define ATMEL_LCDC_DMABADDR1 0x00
#define ATMEL_LCDC_DMABADDR2 0x04
---
-1.8.0.197.g5a90748
-
diff --git a/patches.at91/0132-video-atmelfb-refactor-LUT.patch b/patches.at91/0132-video-atmelfb-refactor-LUT.patch
index 068ad1ebebb..23bb412de38 100644
--- a/patches.at91/0132-video-atmelfb-refactor-LUT.patch
+++ b/patches.at91/0132-video-atmelfb-refactor-LUT.patch
@@ -9,16 +9,14 @@ Content-Transfer-Encoding: 8bit
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
- drivers/video/atmel_lcdfb.c | 1 +
- drivers/video/atmel_lcdfb_core.c | 6 ++++--
- include/video/atmel_lcdc.h | 8 ++------
+ drivers/video/atmel_lcdfb.c | 1 +
+ drivers/video/atmel_lcdfb_core.c | 6 ++++--
+ include/video/atmel_lcdc.h | 8 ++------
3 files changed, 7 insertions(+), 8 deletions(-)
-diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
-index cd6d22e..f8993cd 100644
--- a/drivers/video/atmel_lcdfb.c
+++ b/drivers/video/atmel_lcdfb.c
-@@ -380,6 +380,7 @@ static struct atmel_lcdfb_devdata dev_data = {
+@@ -380,6 +380,7 @@ static struct atmel_lcdfb_devdata dev_da
.bl_ops = &atmel_lcdc_bl_ops,
.init_contrast = atmel_lcdfb_init_contrast,
.fbinfo_flags = ATMEL_LCDFB_FBINFO_DEFAULT,
@@ -26,11 +24,9 @@ index cd6d22e..f8993cd 100644
};
static int __init atmel_lcdfb_probe(struct platform_device *pdev)
-diff --git a/drivers/video/atmel_lcdfb_core.c b/drivers/video/atmel_lcdfb_core.c
-index 4146e9b..0edafb6 100644
--- a/drivers/video/atmel_lcdfb_core.c
+++ b/drivers/video/atmel_lcdfb_core.c
-@@ -422,7 +422,8 @@ static int atmel_lcdfb_setcolreg(unsigned int regno, unsigned int red,
+@@ -422,7 +422,8 @@ static int atmel_lcdfb_setcolreg(unsigne
* ~(red[10] ^ green[10] ^ blue[10]) & 1
*/
@@ -40,7 +36,7 @@ index 4146e9b..0edafb6 100644
ret = 0;
}
break;
-@@ -430,7 +431,8 @@ static int atmel_lcdfb_setcolreg(unsigned int regno, unsigned int red,
+@@ -430,7 +431,8 @@ static int atmel_lcdfb_setcolreg(unsigne
case FB_VISUAL_MONO01:
if (regno < 2) {
val = (regno == 0) ? 0x00 : 0x1F;
@@ -50,8 +46,6 @@ index 4146e9b..0edafb6 100644
ret = 0;
}
break;
-diff --git a/include/video/atmel_lcdc.h b/include/video/atmel_lcdc.h
-index 866ab47..6c470c4 100644
--- a/include/video/atmel_lcdc.h
+++ b/include/video/atmel_lcdc.h
@@ -53,6 +53,7 @@ struct atmel_lcdfb_devdata {
@@ -62,7 +56,7 @@ index 866ab47..6c470c4 100644
};
/* LCD Controller info data structure, stored in device platform_data */
-@@ -241,11 +242,6 @@ struct atmel_lcdfb_info {
+@@ -242,11 +243,6 @@ struct atmel_lcdfb_info {
#define ATMEL_LCDC_OWRI (1 << 5)
#define ATMEL_LCDC_MERI (1 << 6)
@@ -75,6 +69,3 @@ index 866ab47..6c470c4 100644
+#define ATMEL_LCDC_LUT 0x0c00
#endif /* __ATMEL_LCDC_H__ */
---
-1.8.0.197.g5a90748
-
diff --git a/patches.at91/0134-arm-at91-refactor-lcdc-includes.patch b/patches.at91/0134-arm-at91-refactor-lcdc-includes.patch
index 0bf5cd46e59..2380d32f275 100644
--- a/patches.at91/0134-arm-at91-refactor-lcdc-includes.patch
+++ b/patches.at91/0134-arm-at91-refactor-lcdc-includes.patch
@@ -18,29 +18,29 @@ Conflicts:
arch/arm/mach-at91/board-sam9m10g45ek.c
arch/arm/mach-at91/board-sam9rlek.c
---
- arch/arm/mach-at91/at91sam9261_devices.c | 4 +-
- arch/arm/mach-at91/at91sam9263_devices.c | 4 +-
- arch/arm/mach-at91/at91sam9g45_devices.c | 4 +-
- arch/arm/mach-at91/at91sam9rl_devices.c | 4 +-
- arch/arm/mach-at91/board-neocore926.c | 4 +-
- arch/arm/mach-at91/board-sam9261ek.c | 4 +-
- arch/arm/mach-at91/board-sam9263ek.c | 4 +-
- arch/arm/mach-at91/board-sam9m10g45ek.c | 4 +-
- arch/arm/mach-at91/board-sam9rlek.c | 4 +-
- .../include/mach/{atmel_hlcdfb.h => atmel_hlcdc.h} | 157 +--------------------
- arch/arm/mach-at91/include/mach/atmel_hlcdc_ovl.h | 156 ++++++++++++++++++++
- .../arm/mach-at91/include/mach}/atmel_lcdc.h | 77 +---------
- drivers/video/atmel_lcdfb.c | 3 +-
- drivers/video/atmel_lcdfb_core.c | 2 +-
- include/video/atmel_lcdfb.h | 100 +++++++++++++
- 15 files changed, 294 insertions(+), 237 deletions(-)
+ arch/arm/mach-at91/at91sam9261_devices.c | 4
+ arch/arm/mach-at91/at91sam9263_devices.c | 4
+ arch/arm/mach-at91/at91sam9g45_devices.c | 4
+ arch/arm/mach-at91/at91sam9rl_devices.c | 4
+ arch/arm/mach-at91/board-neocore926.c | 4
+ arch/arm/mach-at91/board-sam9261ek.c | 4
+ arch/arm/mach-at91/board-sam9263ek.c | 4
+ arch/arm/mach-at91/board-sam9m10g45ek.c | 4
+ arch/arm/mach-at91/board-sam9rlek.c | 4
+ arch/arm/mach-at91/include/mach/atmel_hlcdc.h | 718 ++++++++++++++++++
+ arch/arm/mach-at91/include/mach/atmel_hlcdc_ovl.h | 156 +++
+ arch/arm/mach-at91/include/mach/atmel_hlcdfb.h | 865 ----------------------
+ arch/arm/mach-at91/include/mach/atmel_lcdc.h | 177 ++++
+ drivers/video/atmel_lcdfb.c | 3
+ drivers/video/atmel_lcdfb_core.c | 2
+ include/video/atmel_lcdc.h | 249 ------
+ include/video/atmel_lcdfb.h | 100 ++
+ 17 files changed, 1181 insertions(+), 1125 deletions(-)
rename arch/arm/mach-at91/include/mach/{atmel_hlcdfb.h => atmel_hlcdc.h} (82%)
create mode 100644 arch/arm/mach-at91/include/mach/atmel_hlcdc_ovl.h
rename {include/video => arch/arm/mach-at91/include/mach}/atmel_lcdc.h (73%)
create mode 100644 include/video/atmel_lcdfb.h
-diff --git a/arch/arm/mach-at91/at91sam9261_devices.c b/arch/arm/mach-at91/at91sam9261_devices.c
-index 8df5c1b..1eecff8 100644
--- a/arch/arm/mach-at91/at91sam9261_devices.c
+++ b/arch/arm/mach-at91/at91sam9261_devices.c
@@ -19,9 +19,11 @@
@@ -56,8 +56,6 @@ index 8df5c1b..1eecff8 100644
#include <mach/at91sam9261.h>
#include <mach/at91sam9261_matrix.h>
#include <mach/at91_matrix.h>
-diff --git a/arch/arm/mach-at91/at91sam9263_devices.c b/arch/arm/mach-at91/at91sam9263_devices.c
-index eb6bbf8..f0318e9 100644
--- a/arch/arm/mach-at91/at91sam9263_devices.c
+++ b/arch/arm/mach-at91/at91sam9263_devices.c
@@ -18,9 +18,11 @@
@@ -73,8 +71,6 @@ index eb6bbf8..f0318e9 100644
#include <mach/at91sam9263.h>
#include <mach/at91sam9263_matrix.h>
#include <mach/at91_matrix.h>
-diff --git a/arch/arm/mach-at91/at91sam9g45_devices.c b/arch/arm/mach-at91/at91sam9g45_devices.c
-index 7ab7e06..73eb743 100644
--- a/arch/arm/mach-at91/at91sam9g45_devices.c
+++ b/arch/arm/mach-at91/at91sam9g45_devices.c
@@ -20,9 +20,11 @@
@@ -90,8 +86,6 @@ index 7ab7e06..73eb743 100644
#include <mach/at91sam9g45.h>
#include <mach/at91sam9g45_matrix.h>
#include <mach/at91_matrix.h>
-diff --git a/arch/arm/mach-at91/at91sam9rl_devices.c b/arch/arm/mach-at91/at91sam9rl_devices.c
-index f09fff9..0d1b76f 100644
--- a/arch/arm/mach-at91/at91sam9rl_devices.c
+++ b/arch/arm/mach-at91/at91sam9rl_devices.c
@@ -15,9 +15,11 @@
@@ -107,8 +101,6 @@ index f09fff9..0d1b76f 100644
#include <mach/at91sam9rl.h>
#include <mach/at91sam9rl_matrix.h>
#include <mach/at91_matrix.h>
-diff --git a/arch/arm/mach-at91/board-neocore926.c b/arch/arm/mach-at91/board-neocore926.c
-index 18103c5d..5d3b4d6 100644
--- a/arch/arm/mach-at91/board-neocore926.c
+++ b/arch/arm/mach-at91/board-neocore926.c
@@ -32,7 +32,7 @@
@@ -129,8 +121,6 @@ index 18103c5d..5d3b4d6 100644
#include <mach/at91sam9_smc.h>
#include "sam9_smc.h"
-diff --git a/arch/arm/mach-at91/board-sam9261ek.c b/arch/arm/mach-at91/board-sam9261ek.c
-index 2269be5..2e1c9c5 100644
--- a/arch/arm/mach-at91/board-sam9261ek.c
+++ b/arch/arm/mach-at91/board-sam9261ek.c
@@ -34,7 +34,7 @@
@@ -151,8 +141,6 @@ index 2269be5..2e1c9c5 100644
#include <mach/at91sam9_smc.h>
#include <mach/at91_shdwc.h>
#include <mach/system_rev.h>
-diff --git a/arch/arm/mach-at91/board-sam9263ek.c b/arch/arm/mach-at91/board-sam9263ek.c
-index 82adf58..7c34908 100644
--- a/arch/arm/mach-at91/board-sam9263ek.c
+++ b/arch/arm/mach-at91/board-sam9263ek.c
@@ -33,7 +33,7 @@
@@ -173,8 +161,6 @@ index 82adf58..7c34908 100644
#include <mach/at91sam9_smc.h>
#include <mach/at91_shdwc.h>
#include <mach/system_rev.h>
-diff --git a/arch/arm/mach-at91/board-sam9m10g45ek.c b/arch/arm/mach-at91/board-sam9m10g45ek.c
-index d1882d5..78210f6 100644
--- a/arch/arm/mach-at91/board-sam9m10g45ek.c
+++ b/arch/arm/mach-at91/board-sam9m10g45ek.c
@@ -28,7 +28,7 @@
@@ -195,8 +181,6 @@ index d1882d5..78210f6 100644
#include <mach/at91sam9_smc.h>
#include <mach/at91_shdwc.h>
#include <mach/system_rev.h>
-diff --git a/arch/arm/mach-at91/board-sam9rlek.c b/arch/arm/mach-at91/board-sam9rlek.c
-index e7dc3ea..81d82be 100644
--- a/arch/arm/mach-at91/board-sam9rlek.c
+++ b/arch/arm/mach-at91/board-sam9rlek.c
@@ -19,7 +19,7 @@
@@ -217,37 +201,1143 @@ index e7dc3ea..81d82be 100644
#include <mach/at91sam9_smc.h>
#include <mach/at91_shdwc.h>
-diff --git a/arch/arm/mach-at91/include/mach/atmel_hlcdfb.h b/arch/arm/mach-at91/include/mach/atmel_hlcdc.h
-similarity index 82%
-rename from arch/arm/mach-at91/include/mach/atmel_hlcdfb.h
-rename to arch/arm/mach-at91/include/mach/atmel_hlcdc.h
-index a57b79b..9ed7e6e 100644
---- a/arch/arm/mach-at91/include/mach/atmel_hlcdfb.h
+--- /dev/null
+++ b/arch/arm/mach-at91/include/mach/atmel_hlcdc.h
-@@ -19,8 +19,8 @@
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
--#ifndef __ATMEL_HLCD_H__
--#define __ATMEL_HLCD_H__
+@@ -0,0 +1,718 @@
++/*
++ * Header file for AT91 High end LCD Controller
++ *
++ * Data structure and register user interface
++ *
++ * Copyright (C) 2010 Atmel Corporation
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2 of the License, or
++ * (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PUROFFSETE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public 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 __MACH_ATMEL_HLCD_H__
+#define __MACH_ATMEL_HLCD_H__
-
- /* Lcdc hardware registers */
- #define ATMEL_LCDC_LCDCFG0 0x0000
-@@ -145,7 +145,7 @@
- #define LCDC_LCDISR_FIFOERR (0x1 << 4)
- #define LCDC_LCDISR_BASE (0x1 << 8)
- #define LCDC_LCDISR_OVR1 (0x1 << 9)
--#define LCDC_LCDISR_HEO (0x1 << 11)
++
++/* Lcdc hardware registers */
++#define ATMEL_LCDC_LCDCFG0 0x0000
++#define LCDC_LCDCFG0_CLKPOL (0x1 << 0)
++#define LCDC_LCDCFG0_CLKSEL (0x1 << 2)
++#define LCDC_LCDCFG0_CLKPWMSEL (0x1 << 3)
++#define LCDC_LCDCFG0_CGDISBASE (0x1 << 8)
++#define LCDC_LCDCFG0_CGDISOVR1 (0x1 << 9)
++#define LCDC_LCDCFG0_CGDISHEO (0x1 << 11)
++#define LCDC_LCDCFG0_CGDISHCR (0x1 << 12)
++#define LCDC_LCDCFG0_CLKDIV_OFFSET 16
++#define LCDC_LCDCFG0_CLKDIV (0xff << LCDC_LCDCFG0_CLKDIV_OFFSET)
++
++#define ATMEL_LCDC_LCDCFG1 0x0004
++#define LCDC_LCDCFG1_HSPW_OFFSET 0
++#define LCDC_LCDCFG1_HSPW (0x3f << LCDC_LCDCFG1_HSPW_OFFSET)
++#define LCDC_LCDCFG1_VSPW_OFFSET 16
++#define LCDC_LCDCFG1_VSPW (0x3f << LCDC_LCDCFG1_VSPW_OFFSET)
++
++#define ATMEL_LCDC_LCDCFG2 0x0008
++#define LCDC_LCDCFG2_VFPW_OFFSET 0
++#define LCDC_LCDCFG2_VFPW (0x3f << LCDC_LCDCFG2_VFPW_OFFSET)
++#define LCDC_LCDCFG2_VBPW_OFFSET 16
++#define LCDC_LCDCFG2_VBPW (0x3f << LCDC_LCDCFG2_VBPW_OFFSET)
++
++#define ATMEL_LCDC_LCDCFG3 0x000C
++#define LCDC_LCDCFG3_HFPW_OFFSET 0
++#define LCDC_LCDCFG3_HFPW (0xff << LCDC_LCDCFG3_HFPW_OFFSET)
++#define LCDC_LCDCFG3_HBPW_OFFSET 16
++#define LCDC_LCDCFG3_HBPW (0xff << LCDC_LCDCFG3_HBPW_OFFSET)
++
++#define ATMEL_LCDC_LCDCFG4 0x0010
++#define LCDC_LCDCFG4_PPL_OFFSET 0
++#define LCDC_LCDCFG4_PPL (0x7ff << LCDC_LCDCFG4_PPL_OFFSET)
++#define LCDC_LCDCFG4_RPF_OFFSET 16
++#define LCDC_LCDCFG4_RPF (0x7ff << LCDC_LCDCFG4_RPF_OFFSET)
++
++#define ATMEL_LCDC_LCDCFG5 0x0014
++#define LCDC_LCDCFG5_HSPOL (0x1 << 0)
++#define LCDC_LCDCFG5_VSPOL (0x1 << 1)
++#define LCDC_LCDCFG5_VSPDLYS (0x1 << 2)
++#define LCDC_LCDCFG5_VSPDLYE (0x1 << 3)
++#define LCDC_LCDCFG5_DISPPOL (0x1 << 4)
++#define LCDC_LCDCFG5_SERIAL (0x1 << 5)
++#define LCDC_LCDCFG5_DITHER (0x1 << 6)
++#define LCDC_LCDCFG5_DISPDLY (0x1 << 7)
++#define LCDC_LCDCFG5_MODE_OFFSET 8
++#define LCDC_LCDCFG5_MODE (0x3 << LCDC_LCDCFG5_MODE_OFFSET)
++#define LCDC_LCDCFG5_MODE_OUTPUT_12BPP (0x0 << 8)
++#define LCDC_LCDCFG5_MODE_OUTPUT_16BPP (0x1 << 8)
++#define LCDC_LCDCFG5_MODE_OUTPUT_18BPP (0x2 << 8)
++#define LCDC_LCDCFG5_MODE_OUTPUT_24BPP (0x3 << 8)
++#define LCDC_LCDCFG5_VSPSU (0x1 << 12)
++#define LCDC_LCDCFG5_VSPHO (0x1 << 13)
++#define LCDC_LCDCFG5_GUARDTIME_OFFSET 16
++#define LCDC_LCDCFG5_GUARDTIME (0x1f << LCDC_LCDCFG5_GUARDTIME_OFFSET)
++
++#define ATMEL_LCDC_LCDCFG6 0x0018
++#define LCDC_LCDCFG6_PWMPS_OFFSET 0
++#define LCDC_LCDCFG6_PWMPS (0x7 << LCDC_LCDCFG6_PWMPS_OFFSET)
++#define LCDC_LCDCFG6_PWMPOL (0x1 << 4)
++#define LCDC_LCDCFG6_PWMCVAL_OFFSET 8
++#define LCDC_LCDCFG6_PWMCVAL (0xff << LCDC_LCDCFG6_PWMCVAL_OFFSET)
++
++#define ATMEL_LCDC_LCDEN 0x0020
++#define LCDC_LCDEN_CLKEN (0x1 << 0)
++#define LCDC_LCDEN_SYNCEN (0x1 << 1)
++#define LCDC_LCDEN_DISPEN (0x1 << 2)
++#define LCDC_LCDEN_PWMEN (0x1 << 3)
++
++#define ATMEL_LCDC_LCDDIS 0x0024
++#define LCDC_LCDDIS_CLKDIS (0x1 << 0)
++#define LCDC_LCDDIS_SYNCDIS (0x1 << 1)
++#define LCDC_LCDDIS_DISPDIS (0x1 << 2)
++#define LCDC_LCDDIS_PWMDIS (0x1 << 3)
++#define LCDC_LCDDIS_CLKRST (0x1 << 8)
++#define LCDC_LCDDIS_SYNCRST (0x1 << 9)
++#define LCDC_LCDDIS_DISPRST (0x1 << 10)
++#define LCDC_LCDDIS_PWMRST (0x1 << 11)
++
++#define ATMEL_LCDC_LCDSR 0x0028
++#define LCDC_LCDSR_CLKSTS (0x1 << 0)
++#define LCDC_LCDSR_LCDSTS (0x1 << 1)
++#define LCDC_LCDSR_DISPSTS (0x1 << 2)
++#define LCDC_LCDSR_PWMSTS (0x1 << 3)
++#define LCDC_LCDSR_SIPSTS (0x1 << 4)
++
++#define ATMEL_LCDC_LCDIER 0x002C
++#define LCDC_LCDIER_SOFIE (0x1 << 0)
++#define LCDC_LCDIER_DISIE (0x1 << 1)
++#define LCDC_LCDIER_DISPIE (0x1 << 2)
++#define LCDC_LCDIER_FIFOERRIE (0x1 << 4)
++#define LCDC_LCDIER_BASEIE (0x1 << 8)
++#define LCDC_LCDIER_OVR1IE (0x1 << 9)
++#define LCDC_LCDIER_HEOIE (0x1 << 11)
++#define LCDC_LCDIER_HCRIE (0x1 << 12)
++
++#define ATMEL_LCDC_LCDIDR 0x0030
++#define LCDC_LCDIDR_SOFID (0x1 << 0)
++#define LCDC_LCDIDR_DISID (0x1 << 1)
++#define LCDC_LCDIDR_DISPID (0x1 << 2)
++#define LCDC_LCDIDR_FIFOERRID (0x1 << 4)
++#define LCDC_LCDIDR_BASEID (0x1 << 8)
++#define LCDC_LCDIDR_OVR1ID (0x1 << 9)
++#define LCDC_LCDIDR_HEOID (0x1 << 11)
++#define LCDC_LCDIDR_HCRID (0x1 << 12)
++
++#define ATMEL_LCDC_LCDIMR 0x0034
++#define LCDC_LCDIMR_SOFIM (0x1 << 0)
++#define LCDC_LCDIMR_DISIM (0x1 << 1)
++#define LCDC_LCDIMR_DISPIM (0x1 << 2)
++#define LCDC_LCDIMR_FIFOERRIM (0x1 << 4)
++#define LCDC_LCDIMR_BASEIM (0x1 << 8)
++#define LCDC_LCDIMR_OVR1IM (0x1 << 9)
++#define LCDC_LCDIMR_HEOIM (0x1 << 11)
++#define LCDC_LCDIMR_HCRIM (0x1 << 12)
++
++#define ATMEL_LCDC_LCDISR 0x0038
++#define LCDC_LCDISR_SOF (0x1 << 0)
++#define LCDC_LCDISR_DIS (0x1 << 1)
++#define LCDC_LCDISR_DISP (0x1 << 2)
++#define LCDC_LCDISR_FIFOERR (0x1 << 4)
++#define LCDC_LCDISR_BASE (0x1 << 8)
++#define LCDC_LCDISR_OVR1 (0x1 << 9)
+#define LCDC_LCDISR_HEO (0x1 << 10)
- #define LCDC_LCDISR_HCR (0x1 << 12)
-
- #define ATMEL_LCDC_BASECHER 0x0040
-@@ -252,153 +252,6 @@
- #define LCDC_BASECFG4_DMA (0x1 << 8)
- #define LCDC_BASECFG4_REP (0x1 << 9)
-
++#define LCDC_LCDISR_HCR (0x1 << 12)
++
++#define ATMEL_LCDC_BASECHER 0x0040
++#define LCDC_BASECHER_CHEN (0x1 << 0)
++#define LCDC_BASECHER_UPDATEEN (0x1 << 1)
++#define LCDC_BASECHER_A2QEN (0x1 << 2)
++
++#define ATMEL_LCDC_BASECHDR 0x0044
++#define LCDC_BASECHDR_CHDIS (0x1 << 0)
++#define LCDC_BASECHDR_CHRST (0x1 << 8)
++
++#define ATMEL_LCDC_BASECHSR 0x0048
++#define LCDC_BASECHSR_CHSR (0x1 << 0)
++#define LCDC_BASECHSR_UPDATESR (0x1 << 1)
++#define LCDC_BASECHSR_A2QSR (0x1 << 2)
++
++#define ATMEL_LCDC_BASEIER 0x004C
++#define LCDC_BASEIER_DMA (0x1 << 2)
++#define LCDC_BASEIER_DSCR (0x1 << 3)
++#define LCDC_BASEIER_ADD (0x1 << 4)
++#define LCDC_BASEIER_DONE (0x1 << 5)
++#define LCDC_BASEIER_OVR (0x1 << 6)
++
++#define ATMEL_LCDC_BASEIDR 0x0050
++#define LCDC_BASEIDR_DMA (0x1 << 2)
++#define LCDC_BASEIDR_DSCR (0x1 << 3)
++#define LCDC_BASEIDR_ADD (0x1 << 4)
++#define LCDC_BASEIDR_DONE (0x1 << 5)
++#define LCDC_BASEIDR_OVR (0x1 << 6)
++
++#define ATMEL_LCDC_BASEIMR 0x0054
++#define LCDC_BASEIMR_DMA (0x1 << 2)
++#define LCDC_BASEIMR_DSCR (0x1 << 3)
++#define LCDC_BASEIMR_ADD (0x1 << 4)
++#define LCDC_BASEIMR_DONE (0x1 << 5)
++#define LCDC_BASEIMR_OVR (0x1 << 6)
++
++#define ATMEL_LCDC_BASEISR 0x0058
++#define LCDC_BASEISR_DMA (0x1 << 2)
++#define LCDC_BASEISR_DSCR (0x1 << 3)
++#define LCDC_BASEISR_ADD (0x1 << 4)
++#define LCDC_BASEISR_DONE (0x1 << 5)
++#define LCDC_BASEISR_OVR (0x1 << 6)
++
++#define ATMEL_LCDC_BASEHEAD 0x005C
++
++#define ATMEL_LCDC_BASEADDR 0x0060
++
++#define ATMEL_LCDC_BASECTRL 0x0064
++#define LCDC_BASECTRL_DFETCH (0x1 << 0)
++#define LCDC_BASECTRL_LFETCH (0x1 << 1)
++#define LCDC_BASECTRL_DMAIEN (0x1 << 2)
++#define LCDC_BASECTRL_DSCRIEN (0x1 << 3)
++#define LCDC_BASECTRL_ADDIEN (0x1 << 4)
++#define LCDC_BASECTRL_DONEIEN (0x1 << 5)
++
++#define ATMEL_LCDC_BASENEXT 0x0068
++
++#define ATMEL_LCDC_BASECFG0 0x006C
++#define LCDC_BASECFG0_BLEN_OFFSET 4
++#define LCDC_BASECFG0_BLEN (0x3 << LCDC_BASECFG0_BLEN_OFFSET)
++#define LCDC_BASECFG0_BLEN_AHB_SINGLE (0x0 << 4)
++#define LCDC_BASECFG0_BLEN_AHB_INCR4 (0x1 << 4)
++#define LCDC_BASECFG0_BLEN_AHB_INCR8 (0x2 << 4)
++#define LCDC_BASECFG0_BLEN_AHB_INCR16 (0x3 << 4)
++#define LCDC_BASECFG0_DLBO (0x1 << 8)
++
++#define ATMEL_LCDC_BASECFG1 0x0070
++#define LCDC_BASECFG1_CLUTEN (0x1 << 0)
++#define LCDC_BASECFG1_RGBMODE_OFFSET 4
++#define LCDC_BASECFG1_RGBMODE (0xf << LCDC_BASECFG1_RGBMODE_OFFSET)
++#define LCDC_BASECFG1_RGBMODE_12BPP_RGB_444 (0x0 << 4)
++#define LCDC_BASECFG1_RGBMODE_16BPP_ARGB_4444 (0x1 << 4)
++#define LCDC_BASECFG1_RGBMODE_16BPP_RGBA_4444 (0x2 << 4)
++#define LCDC_BASECFG1_RGBMODE_16BPP_RGB_565 (0x3 << 4)
++#define LCDC_BASECFG1_RGBMODE_16BPP_TRGB_1555 (0x4 << 4)
++#define LCDC_BASECFG1_RGBMODE_18BPP_RGB_666 (0x5 << 4)
++#define LCDC_BASECFG1_RGBMODE_18BPP_RGB_666_PACKED (0x6 << 4)
++#define LCDC_BASECFG1_RGBMODE_19BPP_TRGB_1666 (0x7 << 4)
++#define LCDC_BASECFG1_RGBMODE_19BPP_TRGB_PACKED (0x8 << 4)
++#define LCDC_BASECFG1_RGBMODE_24BPP_RGB_888 (0x9 << 4)
++#define LCDC_BASECFG1_RGBMODE_24BPP_RGB_888_PACKED (0xA << 4)
++#define LCDC_BASECFG1_RGBMODE_25BPP_TRGB_1888 (0xB << 4)
++#define LCDC_BASECFG1_RGBMODE_32BPP_ARGB_8888 (0xC << 4)
++#define LCDC_BASECFG1_RGBMODE_32BPP_RGBA_8888 (0xD << 4)
++#define LCDC_BASECFG1_CLUTMODE_OFFSET 8
++#define LCDC_BASECFG1_CLUTMODE (0x3 << LCDC_BASECFG1_CLUTMODE_OFFSET)
++#define LCDC_BASECFG1_CLUTMODE_1BPP (0x0 << 8)
++#define LCDC_BASECFG1_CLUTMODE_2BPP (0x1 << 8)
++#define LCDC_BASECFG1_CLUTMODE_4BPP (0x2 << 8)
++#define LCDC_BASECFG1_CLUTMODE_8BPP (0x3 << 8)
++
++#define ATMEL_LCDC_BASECFG2 0x0074
++
++#define ATMEL_LCDC_BASECFG3 0x0078
++#define LCDC_BASECFG3_BDEF_OFFSET 0
++#define LCDC_BASECFG3_BDEF (0xff << LCDC_BASECFG3_BDEF_OFFSET)
++#define LCDC_BASECFG3_GDEF_OFFSET 8
++#define LCDC_BASECFG3_GDEF (0xff << LCDC_BASECFG3_GDEF_OFFSET)
++#define LCDC_BASECFG3_RDEF_OFFSET 16
++#define LCDC_BASECFG3_RDEF (0xff << LCDC_BASECFG3_RDEF_OFFSET)
++
++#define ATMEL_LCDC_BASECFG4 0x007C
++#define LCDC_BASECFG4_DMA (0x1 << 8)
++#define LCDC_BASECFG4_REP (0x1 << 9)
++
++#define ATMEL_LCDC_HEOCHER 0x0280
++#define LCDC_HEOCHER_CHEN (0x1 << 0)
++#define LCDC_HEOCHER_UPDATEEN (0x1 << 1)
++#define LCDC_HEOCHER_A2QEN (0x1 << 2)
++
++#define ATMEL_LCDC_HEOCHDR 0x0284
++#define LCDC_HEOCHDR_CHDIS (0x1 << 0)
++#define LCDC_HEOCHDR_CHRST (0x1 << 8)
++
++#define ATMEL_LCDC_HEOCHSR 0x0288
++#define LCDC_HEOCHSR_CHSR (0x1 << 0)
++#define LCDC_HEOCHSR_UPDATESR (0x1 << 1)
++#define LCDC_HEOCHSR_A2QSR (0x1 << 2)
++
++#define ATMEL_LCDC_HEOIER 0x028C
++#define LCDC_HEOIER_DMA (0x1 << 2)
++#define LCDC_HEOIER_DSCR (0x1 << 3)
++#define LCDC_HEOIER_ADD (0x1 << 4)
++#define LCDC_HEOIER_DONE (0x1 << 5)
++#define LCDC_HEOIER_OVR (0x1 << 6)
++#define LCDC_HEOIER_UDMA (0x1 << 10)
++#define LCDC_HEOIER_UDSCR (0x1 << 11)
++#define LCDC_HEOIER_UADD (0x1 << 12)
++#define LCDC_HEOIER_UDONE (0x1 << 13)
++#define LCDC_HEOIER_UOVR (0x1 << 14)
++#define LCDC_HEOIER_VDMA (0x1 << 18)
++#define LCDC_HEOIER_VDSCR (0x1 << 19)
++#define LCDC_HEOIER_VADD (0x1 << 20)
++#define LCDC_HEOIER_VDONE (0x1 << 21)
++#define LCDC_HEOIER_VOVR (0x1 << 22)
++
++#define ATMEL_LCDC_HEOIDR 0x0290
++#define LCDC_HEOIDR_DMA (0x1 << 2)
++#define LCDC_HEOIDR_DSCR (0x1 << 3)
++#define LCDC_HEOIDR_ADD (0x1 << 4)
++#define LCDC_HEOIDR_DONE (0x1 << 5)
++#define LCDC_HEOIDR_OVR (0x1 << 6)
++#define LCDC_HEOIDR_UDMA (0x1 << 10)
++#define LCDC_HEOIDR_UDSCR (0x1 << 11)
++#define LCDC_HEOIDR_UADD (0x1 << 12)
++#define LCDC_HEOIDR_UDONE (0x1 << 13)
++#define LCDC_HEOIDR_UOVR (0x1 << 14)
++#define LCDC_HEOIDR_VDMA (0x1 << 18)
++#define LCDC_HEOIDR_VDSCR (0x1 << 19)
++#define LCDC_HEOIDR_VADD (0x1 << 20)
++#define LCDC_HEOIDR_VDONE (0x1 << 21)
++#define LCDC_HEOIDR_VOVR (0x1 << 22)
++
++#define ATMEL_LCDC_HEOIMR 0x0294
++#define LCDC_HEOIMR_DMA (0x1 << 2)
++#define LCDC_HEOIMR_DSCR (0x1 << 3)
++#define LCDC_HEOIMR_ADD (0x1 << 4)
++#define LCDC_HEOIMR_DONE (0x1 << 5)
++#define LCDC_HEOIMR_OVR (0x1 << 6)
++#define LCDC_HEOIMR_UDMA (0x1 << 10)
++#define LCDC_HEOIMR_UDSCR (0x1 << 11)
++#define LCDC_HEOIMR_UADD (0x1 << 12)
++#define LCDC_HEOIMR_UDONE (0x1 << 13)
++#define LCDC_HEOIMR_UOVR (0x1 << 14)
++#define LCDC_HEOIMR_VDMA (0x1 << 18)
++#define LCDC_HEOIMR_VDSCR (0x1 << 19)
++#define LCDC_HEOIMR_VADD (0x1 << 20)
++#define LCDC_HEOIMR_VDONE (0x1 << 21)
++#define LCDC_HEOIMR_VOVR (0x1 << 22)
++
++#define ATMEL_LCDC_HEOISR 0x0298
++#define LCDC_HEOISR_DMA (0x1 << 2)
++#define LCDC_HEOISR_DSCR (0x1 << 3)
++#define LCDC_HEOISR_ADD (0x1 << 4)
++#define LCDC_HEOISR_DONE (0x1 << 5)
++#define LCDC_HEOISR_OVR (0x1 << 6)
++#define LCDC_HEOISR_UDMA (0x1 << 10)
++#define LCDC_HEOISR_UDSCR (0x1 << 11)
++#define LCDC_HEOISR_UADD (0x1 << 12)
++#define LCDC_HEOISR_UDONE (0x1 << 13)
++#define LCDC_HEOISR_UOVR (0x1 << 14)
++#define LCDC_HEOISR_VDMA (0x1 << 18)
++#define LCDC_HEOISR_VDSCR (0x1 << 19)
++#define LCDC_HEOISR_VADD (0x1 << 20)
++#define LCDC_HEOISR_VDONE (0x1 << 21)
++#define LCDC_HEOISR_VOVR (0x1 << 22)
++
++#define ATMEL_LCDC_HEOHEAD 0x029C
++
++#define ATMEL_LCDC_HEOADDR 0x02A0
++
++#define ATMEL_LCDC_HEOCTRL 0x02A4
++#define LCDC_HEOCTRL_DFETCH (0x1 << 0)
++#define LCDC_HEOCTRL_LFETCH (0x1 << 1)
++#define LCDC_HEOCTRL_DMAIEN (0x1 << 2)
++#define LCDC_HEOCTRL_DSCRIEN (0x1 << 3)
++#define LCDC_HEOCTRL_ADDIEN (0x1 << 4)
++#define LCDC_HEOCTRL_DONEIEN (0x1 << 5)
++
++#define ATMEL_LCDC_HEONEXT 0x02A8
++
++#define ATMEL_LCDC_HEOUHEAD 0x02AC
++
++#define ATMEL_LCDC_HEOUADDR 0x02B0
++
++#define ATMEL_LCDC_HEOUCTRL 0x02B4
++#define LCDC_HEOUCTRL_UDFETCH (0x1 << 0)
++#define LCDC_HEOUCTRL_UDMAIEN (0x1 << 2)
++#define LCDC_HEOUCTRL_UDSCRIEN (0x1 << 3)
++#define LCDC_HEOUCTRL_UADDIEN (0x1 << 4)
++#define LCDC_HEOUCTRL_UDONEIEN (0x1 << 5)
++
++#define ATMEL_LCDC_HEOUNEXT 0x02B8
++
++#define ATMEL_LCDC_HEOVHEAD 0x02BC
++
++#define ATMEL_LCDC_HEOVADDR 0x02C0
++
++#define ATMEL_LCDC_HEOVCTRL 0x02C4
++#define LCDC_HEOVCTRL_VDFETCH (0x1 << 0)
++#define LCDC_HEOVCTRL_VDMAIEN (0x1 << 2)
++#define LCDC_HEOVCTRL_VDSCRIEN (0x1 << 3)
++#define LCDC_HEOVCTRL_VADDIEN (0x1 << 4)
++#define LCDC_HEOVCTRL_VDONEIEN (0x1 << 5)
++
++#define ATMEL_LCDC_HEOVNEXT 0x02C8
++
++#define ATMEL_LCDC_HEOCFG0 0x02CC
++#define LCDC_HEOCFG0_BLEN_OFFSET 4
++#define LCDC_HEOCFG0_BLEN (0x3 << LCDC_HEOCFG0_BLEN_OFFSET)
++#define LCDC_HEOCFG0_BLEN_AHB_SINGLE (0x0 << 4)
++#define LCDC_HEOCFG0_BLEN_AHB_INCR4 (0x1 << 4)
++#define LCDC_HEOCFG0_BLEN_AHB_INCR8 (0x2 << 4)
++#define LCDC_HEOCFG0_BLEN_AHB_INCR16 (0x3 << 4)
++#define LCDC_HEOCFG0_BLENUV_OFFSET 6
++#define LCDC_HEOCFG0_BLENUV (0x3 << LCDC_HEOCFG0_BLENUV_OFFSET)
++#define LCDC_HEOCFG0_BLENUV_AHB_SINGLE (0x0 << 6)
++#define LCDC_HEOCFG0_BLENUV_AHB_INCR4 (0x1 << 6)
++#define LCDC_HEOCFG0_BLENUV_AHB_INCR8 (0x2 << 6)
++#define LCDC_HEOCFG0_BLENUV_AHB_INCR16 (0x3 << 6)
++#define LCDC_HEOCFG0_DLBO (0x1 << 8)
++#define LCDC_HEOCFG0_ROTDIS (0x1 << 12)
++#define LCDC_HEOCFG0_LOCKDIS (0x1 << 13)
++
++#define ATMEL_LCDC_HEOCFG1 0x02D0
++#define LCDC_HEOCFG1_CLUTEN (0x1 << 0)
++#define LCDC_HEOCFG1_YUVEN (0x1 << 1)
++#define LCDC_HEOCFG1_RGBMODE_OFFSET 4
++#define LCDC_HEOCFG1_RGBMODE (0xf << LCDC_HEOCFG1_RGBMODE_OFFSET)
++#define LCDC_HEOCFG1_RGBMODE_12BPP_RGB_444 (0x0 << 4)
++#define LCDC_HEOCFG1_RGBMODE_16BPP_ARGB_4444 (0x1 << 4)
++#define LCDC_HEOCFG1_RGBMODE_16BPP_RGBA_4444 (0x2 << 4)
++#define LCDC_HEOCFG1_RGBMODE_16BPP_RGB_565 (0x3 << 4)
++#define LCDC_HEOCFG1_RGBMODE_16BPP_TRGB_1555 (0x4 << 4)
++#define LCDC_HEOCFG1_RGBMODE_18BPP_RGB_666 (0x5 << 4)
++#define LCDC_HEOCFG1_RGBMODE_18BPP_RGB_666_PACKED (0x6 << 4)
++#define LCDC_HEOCFG1_RGBMODE_19BPP_TRGB_1666 (0x7 << 4)
++#define LCDC_HEOCFG1_RGBMODE_19BPP_TRGB_PACKED (0x8 << 4)
++#define LCDC_HEOCFG1_RGBMODE_24BPP_RGB_888 (0x9 << 4)
++#define LCDC_HEOCFG1_RGBMODE_24BPP_RGB_888_PACKED (0xA << 4)
++#define LCDC_HEOCFG1_RGBMODE_25BPP_TRGB_1888 (0xB << 4)
++#define LCDC_HEOCFG1_RGBMODE_32BPP_ARGB_8888 (0xC << 4)
++#define LCDC_HEOCFG1_RGBMODE_32BPP_RGBA_8888 (0xD << 4)
++#define LCDC_HEOCFG1_CLUTMODE_OFFSET 8
++#define LCDC_HEOCFG1_CLUTMODE (0x3 << LCDC_HEOCFG1_CLUTMODE_OFFSET)
++#define LCDC_HEOCFG1_CLUTMODE_1BPP (0x0 << 8)
++#define LCDC_HEOCFG1_CLUTMODE_2BPP (0x1 << 8)
++#define LCDC_HEOCFG1_CLUTMODE_4BPP (0x2 << 8)
++#define LCDC_HEOCFG1_CLUTMODE_8BPP (0x3 << 8)
++#define LCDC_HEOCFG1_YUVMODE_OFFSET 12
++#define LCDC_HEOCFG1_YUVMODE (0xf << LCDC_HEOCFG1_YUVMODE_OFFSET)
++#define LCDC_HEOCFG1_YUVMODE_32BPP_AYCBCR (0x0 << 12)
++#define LCDC_HEOCFG1_YUVMODE_16BPP_YCBCR_MODE0 (0x1 << 12)
++#define LCDC_HEOCFG1_YUVMODE_16BPP_YCBCR_MODE1 (0x2 << 12)
++#define LCDC_HEOCFG1_YUVMODE_16BPP_YCBCR_MODE2 (0x3 << 12)
++#define LCDC_HEOCFG1_YUVMODE_16BPP_YCBCR_MODE3 (0x4 << 12)
++#define LCDC_HEOCFG1_YUVMODE_16BPP_YCBCR_SEMIPLANAR (0x5 << 12)
++#define LCDC_HEOCFG1_YUVMODE_16BPP_YCBCR_PLANAR (0x6 << 12)
++#define LCDC_HEOCFG1_YUVMODE_12BPP_YCBCR_SEMIPLANAR (0x7 << 12)
++#define LCDC_HEOCFG1_YUVMODE_12BPP_YCBCR_PLANAR (0x8 << 12)
++#define LCDC_HEOCFG1_YUV422ROT (0x1 << 16)
++#define LCDC_HEOCFG1_YUV422SWP (0x1 << 17)
++
++#define ATMEL_LCDC_HEOCFG2 0x02D4
++#define LCDC_HEOCFG2_XOFFSET_OFFSET 0
++#define LCDC_HEOCFG2_XOFFSET (0x7ff << LCDC_HEOCFG2_XOFFSET_OFFSET)
++#define LCDC_HEOCFG2_YOFFSET_OFFSET 16
++#define LCDC_HEOCFG2_YOFFSET (0x7ff << LCDC_HEOCFG2_YOFFSET_OFFSET)
++
++#define ATMEL_LCDC_HEOCFG3 0x02D8
++#define LCDC_HEOCFG3_XSIZE_OFFSET 0
++#define LCDC_HEOCFG3_XSIZE (0x7ff << LCDC_HEOCFG3_XSIZE_OFFSET)
++#define LCDC_HEOCFG3_YSIZE_OFFSET 16
++#define LCDC_HEOCFG3_YSIZE (0x7ff << LCDC_HEOCFG3_YSIZE_OFFSET)
++
++#define ATMEL_LCDC_HEOCFG4 0x02DC
++#define LCDC_HEOCFG4_XMEM_SIZE_OFFSET 0
++#define LCDC_HEOCFG4_XMEM_SIZE (0x7ff << LCDC_HEOCFG4_XMEM_SIZE_OFFSET)
++#define LCDC_HEOCFG4_YMEM_SIZE_OFFSET 16
++#define LCDC_HEOCFG4_YMEM_SIZE (0x7ff << LCDC_HEOCFG4_YMEM_SIZE_OFFSET)
++
++#define ATMEL_LCDC_HEOCFG5 0x02E0
++
++#define ATMEL_LCDC_HEOCFG6 0x02E4
++
++#define ATMEL_LCDC_HEOCFG7 0x02E8
++
++#define ATMEL_LCDC_HEOCFG8 0x02EC
++
++#define ATMEL_LCDC_HEOCFG9 0x02F0
++#define LCDC_HEOCFG9_BDEF_OFFSET 0
++#define LCDC_HEOCFG9_BDEF (0xff << LCDC_HEOCFG9_BDEF_OFFSET)
++#define LCDC_HEOCFG9_GDEF_OFFSET 8
++#define LCDC_HEOCFG9_GDEF (0xff << LCDC_HEOCFG9_GDEF_OFFSET)
++#define LCDC_HEOCFG9_RDEF_OFFSET 16
++#define LCDC_HEOCFG9_RDEF (0xff << LCDC_HEOCFG9_RDEF_OFFSET)
++
++#define ATMEL_LCDC_HEOCFG10 0x02F4
++#define LCDC_HEOCFG10_BKEY_OFFSET 0
++#define LCDC_HEOCFG10_BKEY (0xff << LCDC_HEOCFG10_BKEY_OFFSET)
++#define LCDC_HEOCFG10_GKEY_OFFSET 8
++#define LCDC_HEOCFG10_GKEY (0xff << LCDC_HEOCFG10_GKEY_OFFSET)
++#define LCDC_HEOCFG10_RKEY_OFFSET 16
++#define LCDC_HEOCFG10_RKEY (0xff << LCDC_HEOCFG10_RKEY_OFFSET)
++
++#define ATMEL_LCDC_HEOCFG11 0x02F8
++#define LCDC_HEOCFG11_BMASK_OFFSET 0
++#define LCDC_HEOCFG11_BMASK (0xff << LCDC_HEOCFG11_BMASK_OFFSET)
++#define LCDC_HEOCFG11_GMASK_OFFSET 8
++#define LCDC_HEOCFG11_GMASK (0xff << LCDC_HEOCFG11_GMASK_OFFSET)
++#define LCDC_HEOCFG11_RMASK_OFFSET 16
++#define LCDC_HEOCFG11_RMASK (0xff << LCDC_HEOCFG11_RMASK_OFFSET)
++
++#define ATMEL_LCDC_HEOCFG12 0x02FC
++#define LCDC_HEOCFG12_CRKEY (0x1 << 0)
++#define LCDC_HEOCFG12_INV (0x1 << 1)
++#define LCDC_HEOCFG12_ITER2BL (0x1 << 2)
++#define LCDC_HEOCFG12_ITER (0x1 << 3)
++#define LCDC_HEOCFG12_REVALPHA (0x1 << 4)
++#define LCDC_HEOCFG12_GAEN (0x1 << 5)
++#define LCDC_HEOCFG12_LAEN (0x1 << 6)
++#define LCDC_HEOCFG12_OVR (0x1 << 7)
++#define LCDC_HEOCFG12_DMA (0x1 << 8)
++#define LCDC_HEOCFG12_REP (0x1 << 9)
++#define LCDC_HEOCFG12_DSTKEY (0x1 << 10)
++#define LCDC_HEOCFG12_VIDPRI (0x1 << 12)
++#define LCDC_HEOCFG12_GA_OFFSET 16
++#define LCDC_HEOCFG12_GA (0xff << LCDC_HEOCFG12_GA_OFFSET)
++
++#define ATMEL_LCDC_HEOCFG13 0x0300
++#define LCDC_HEOCFG13_XFACTOR_OFFSET 0
++#define LCDC_HEOCFG13_XFACTOR (0x1fff << LCDC_HEOCFG13_XFACTOR_OFFSET)
++#define LCDC_HEOCFG13_YFACTOR_OFFSET 16
++#define LCDC_HEOCFG13_YFACTOR (0x1fff << LCDC_HEOCFG13_YFACTOR_OFFSET)
++#define LCDC_HEOCFG13_SCALEN (0x1 << 31)
++
++#define ATMEL_LCDC_HEOCFG14 0x0304
++#define LCDC_HEOCFG14_CSCRY_OFFSET 0
++#define LCDC_HEOCFG14_CSCRY (0x3ff << LCDC_HEOCFG14_CSCRY_OFFSET)
++#define LCDC_HEOCFG14_CSCRU_OFFSET 10
++#define LCDC_HEOCFG14_CSCRU (0x3ff << LCDC_HEOCFG14_CSCRU_OFFSET)
++#define LCDC_HEOCFG14_CSCRV_OFFSET 20
++#define LCDC_HEOCFG14_CSCRV (0x3ff << LCDC_HEOCFG14_CSCRV_OFFSET)
++#define LCDC_HEOCFG14_CSCYOFF (0x1 << 30)
++
++#define ATMEL_LCDC_HEOCFG15 0x0308
++#define LCDC_HEOCFG15_CSCGY_OFFSET 0
++#define LCDC_HEOCFG15_CSCGY (0x3ff << LCDC_HEOCFG15_CSCGY_OFFSET)
++#define LCDC_HEOCFG15_CSCGU_OFFSET 10
++#define LCDC_HEOCFG15_CSCGU (0x3ff << LCDC_HEOCFG15_CSCGU_OFFSET)
++#define LCDC_HEOCFG15_CSCGV_OFFSET 20
++#define LCDC_HEOCFG15_CSCGV (0x3ff << LCDC_HEOCFG15_CSCGV_OFFSET)
++#define LCDC_HEOCFG15_CSCUOFF (0x1 << 30)
++
++#define ATMEL_LCDC_HEOCFG16 0x030C
++#define LCDC_HEOCFG16_CSCBY_OFFSET 0
++#define LCDC_HEOCFG16_CSCBY (0x3ff << LCDC_HEOCFG16_CSCBY_OFFSET)
++#define LCDC_HEOCFG16_CSCBU_OFFSET 10
++#define LCDC_HEOCFG16_CSCBU (0x3ff << LCDC_HEOCFG16_CSCBU_OFFSET)
++#define LCDC_HEOCFG16_CSCBV_OFFSET 20
++#define LCDC_HEOCFG16_CSCBV (0x3ff << LCDC_HEOCFG16_CSCBV_OFFSET)
++#define LCDC_HEOCFG16_CSCVOFF (0x1 << 30)
++
++#define ATMEL_LCDC_HCRCHER 0x0340
++#define LCDC_HCRCHER_CHEN (0x1 << 0)
++#define LCDC_HCRCHER_UPDATEEN (0x1 << 1)
++#define LCDC_HCRCHER_A2QEN (0x1 << 2)
++
++#define ATMEL_LCDC_HCRCHDR 0x0344
++#define LCDC_HCRCHDR_CHDIS (0x1 << 0)
++#define LCDC_HCRCHDR_CHRST (0x1 << 8)
++
++#define ATMEL_LCDC_HCRCHSR 0x0348
++#define LCDC_HCRCHSR_CHSR (0x1 << 0)
++#define LCDC_HCRCHSR_UPDATESR (0x1 << 1)
++#define LCDC_HCRCHSR_A2QSR (0x1 << 2)
++
++#define ATMEL_LCDC_HCRIER 0x034C
++#define LCDC_HCRIER_DMA (0x1 << 2)
++#define LCDC_HCRIER_DSCR (0x1 << 3)
++#define LCDC_HCRIER_ADD (0x1 << 4)
++#define LCDC_HCRIER_DONE (0x1 << 5)
++#define LCDC_HCRIER_OVR (0x1 << 6)
++
++#define ATMEL_LCDC_HCRIDR 0x0350
++#define LCDC_HCRIDR_DMA (0x1 << 2)
++#define LCDC_HCRIDR_DSCR (0x1 << 3)
++#define LCDC_HCRIDR_ADD (0x1 << 4)
++#define LCDC_HCRIDR_DONE (0x1 << 5)
++#define LCDC_HCRIDR_OVR (0x1 << 6)
++
++#define ATMEL_LCDC_HCRIMR 0x0354
++#define LCDC_HCRIMR_DMA (0x1 << 2)
++#define LCDC_HCRIMR_DSCR (0x1 << 3)
++#define LCDC_HCRIMR_ADD (0x1 << 4)
++#define LCDC_HCRIMR_DONE (0x1 << 5)
++#define LCDC_HCRIMR_OVR (0x1 << 6)
++
++#define ATMEL_LCDC_HCRISR 0x0358
++#define LCDC_HCRISR_DMA (0x1 << 2)
++#define LCDC_HCRISR_DSCR (0x1 << 3)
++#define LCDC_HCRISR_ADD (0x1 << 4)
++#define LCDC_HCRISR_DONE (0x1 << 5)
++#define LCDC_HCRISR_OVR (0x1 << 6)
++
++#define ATMEL_LCDC_HCRHEAD 0x035C
++
++#define ATMEL_LCDC_HCRADDR 0x0360
++
++#define ATMEL_LCDC_HCRCTRL 0x0364
++#define LCDC_HCRCTRL_DFETCH (0x1 << 0)
++#define LCDC_HCRCTRL_LFETCH (0x1 << 1)
++#define LCDC_HCRCTRL_DMAIEN (0x1 << 2)
++#define LCDC_HCRCTRL_DSCRIEN (0x1 << 3)
++#define LCDC_HCRCTRL_ADDIEN (0x1 << 4)
++#define LCDC_HCRCTRL_DONEIEN (0x1 << 5)
++
++#define ATMEL_LCDC_HCRNEXT 0x0368
++
++#define ATMEL_LCDC_HCRCFG0 0x036C
++#define LCDC_HCRCFG0_BLEN_OFFSET 4
++#define LCDC_HCRCFG0_BLEN (0x3 << LCDC_HCRCFG0_BLEN_OFFSET)
++#define LCDC_HCRCFG0_BLEN_AHB_SINGLE (0x0 << 4)
++#define LCDC_HCRCFG0_BLEN_AHB_INCR4 (0x1 << 4)
++#define LCDC_HCRCFG0_BLEN_AHB_INCR8 (0x2 << 4)
++#define LCDC_HCRCFG0_BLEN_AHB_INCR16 (0x3 << 4)
++#define LCDC_HCRCFG0_DLBO (0x1 << 8)
++
++#define ATMEL_LCDC_HCRCFG1 0x0370
++#define LCDC_HCRCFG1_CLUTEN (0x1 << 0)
++#define LCDC_HCRCFG1_RGBMODE_OFFSET 4
++#define LCDC_HCRCFG1_RGBMODE (0xf << LCDC_HCRCFG1_RGBMODE_OFFSET)
++#define LCDC_HCRCFG1_RGBMODE_12BPP_RGB_444 (0x0 << 4)
++#define LCDC_HCRCFG1_RGBMODE_16BPP_ARGB_4444 (0x1 << 4)
++#define LCDC_HCRCFG1_RGBMODE_16BPP_RGBA_4444 (0x2 << 4)
++#define LCDC_HCRCFG1_RGBMODE_16BPP_RGB_565 (0x3 << 4)
++#define LCDC_HCRCFG1_RGBMODE_16BPP_TRGB_1555 (0x4 << 4)
++#define LCDC_HCRCFG1_RGBMODE_18BPP_RGB_666 (0x5 << 4)
++#define LCDC_HCRCFG1_RGBMODE_18BPP_RGB_666_PACKED (0x6 << 4)
++#define LCDC_HCRCFG1_RGBMODE_19BPP_TRGB_1666 (0x7 << 4)
++#define LCDC_HCRCFG1_RGBMODE_19BPP_TRGB_PACKED (0x8 << 4)
++#define LCDC_HCRCFG1_RGBMODE_24BPP_RGB_888 (0x9 << 4)
++#define LCDC_HCRCFG1_RGBMODE_24BPP_RGB_888_PACKED (0xA << 4)
++#define LCDC_HCRCFG1_RGBMODE_25BPP_TRGB_1888 (0xB << 4)
++#define LCDC_HCRCFG1_RGBMODE_32BPP_ARGB_8888 (0xC << 4)
++#define LCDC_HCRCFG1_RGBMODE_32BPP_RGBA_8888 (0xD << 4)
++#define LCDC_HCRCFG1_CLUTMODE_OFFSET 8
++#define LCDC_HCRCFG1_CLUTMODE (0x3 << LCDC_HCRCFG1_CLUTMODE_OFFSET)
++#define LCDC_HCRCFG1_CLUTMODE_1BPP (0x0 << 8)
++#define LCDC_HCRCFG1_CLUTMODE_2BPP (0x1 << 8)
++#define LCDC_HCRCFG1_CLUTMODE_4BPP (0x2 << 8)
++#define LCDC_HCRCFG1_CLUTMODE_8BPP (0x3 << 8)
++
++#define ATMEL_LCDC_HCRCFG2 0x0374
++#define LCDC_HCRCFG2_XOFFSET_OFFSET 0
++#define LCDC_HCRCFG2_XOFFSET (0x7ff << LCDC_HCRCFG2_XOFFSET_OFFSET)
++#define LCDC_HCRCFG2_YOFFSET_OFFSET 16
++#define LCDC_HCRCFG2_YOFFSET (0x7ff << LCDC_HCRCFG2_YOFFSET_OFFSET)
++
++#define ATMEL_LCDC_HCRCFG3 0x0378
++#define LCDC_HCRCFG3_XSIZE_OFFSET 0
++#define LCDC_HCRCFG3_XSIZE (0x7f << LCDC_HCRCFG3_XSIZE_OFFSET)
++#define LCDC_HCRCFG3_YSIZE_OFFSET 16
++#define LCDC_HCRCFG3_YSIZE (0x7f << LCDC_HCRCFG3_YSIZE_OFFSET)
++
++#define ATMEL_LCDC_HCRCFG4 0x037C
++
++#define ATMEL_LCDC_HCRCFG6 0x0384
++#define LCDC_HCRCFG6_BDEF_OFFSET 0
++#define LCDC_HCRCFG6_BDEF (0xff << LCDC_HCRCFG6_BDEF_OFFSET)
++#define LCDC_HCRCFG6_GDEF_OFFSET 8
++#define LCDC_HCRCFG6_GDEF (0xff << LCDC_HCRCFG6_GDEF_OFFSET)
++#define LCDC_HCRCFG6_RDEF_OFFSET 16
++#define LCDC_HCRCFG6_RDEF (0xff << LCDC_HCRCFG6_RDEF_OFFSET)
++
++#define ATMEL_LCDC_HCRCFG7 0x0388
++#define LCDC_HCRCFG7_BKEY_OFFSET 0
++#define LCDC_HCRCFG7_BKEY (0xff << LCDC_HCRCFG7_BKEY_OFFSET)
++#define LCDC_HCRCFG7_GKEY_OFFSET 8
++#define LCDC_HCRCFG7_GKEY (0xff << LCDC_HCRCFG7_GKEY_OFFSET)
++#define LCDC_HCRCFG7_RKEY_OFFSET 16
++#define LCDC_HCRCFG7_RKEY (0xff << LCDC_HCRCFG7_RKEY_OFFSET)
++
++#define ATMEL_LCDC_HCRCFG8 0x038C
++#define LCDC_HCRCFG8_BMASK_OFFSET 0
++#define LCDC_HCRCFG8_BMASK (0xff << LCDC_HCRCFG8_BMASK_OFFSET)
++#define LCDC_HCRCFG8_GMASK_OFFSET 8
++#define LCDC_HCRCFG8_GMASK (0xff << LCDC_HCRCFG8_GMASK_OFFSET)
++#define LCDC_HCRCFG8_RMASK_OFFSET 16
++#define LCDC_HCRCFG8_RMASK (0xff << LCDC_HCRCFG8_RMASK_OFFSET)
++
++#define ATMEL_LCDC_HCRCFG9 0x0390
++#define LCDC_HCRCFG9_CRKEY (0x1 << 0)
++#define LCDC_HCRCFG9_INV (0x1 << 1)
++#define LCDC_HCRCFG9_ITER2BL (0x1 << 2)
++#define LCDC_HCRCFG9_ITER (0x1 << 3)
++#define LCDC_HCRCFG9_REVALPHA (0x1 << 4)
++#define LCDC_HCRCFG9_GAEN (0x1 << 5)
++#define LCDC_HCRCFG9_LAEN (0x1 << 6)
++#define LCDC_HCRCFG9_OVR (0x1 << 7)
++#define LCDC_HCRCFG9_DMA (0x1 << 8)
++#define LCDC_HCRCFG9_REP (0x1 << 9)
++#define LCDC_HCRCFG9_DSTKEY (0x1 << 10)
++#define LCDC_HCRCFG9_GA_OFFSET 16
++#define LCDC_HCRCFG9_GA_Msk (0xff << LCDC_HCRCFG9_GA_OFFSET)
++
++#define ATMEL_LCDC_BASECLUT 0x400
++#define LCDC_BASECLUT_BCLUT_OFFSET 0
++#define LCDC_BASECLUT_BCLUT (0xff << LCDC_BASECLUT_BCLUT_OFFSET)
++#define LCDC_BASECLUT_GCLUT_OFFSET 8
++#define LCDC_BASECLUT_GCLUT (0xff << LCDC_BASECLUT_GCLUT_OFFSET)
++#define LCDC_BASECLUT_RCLUT_OFFSET 16
++#define LCDC_BASECLUT_RCLUT (0xff << LCDC_BASECLUT_RCLUT_OFFSET)
++
++#define ATMEL_LCDC_OVR1CLUT 0x800
++#define LCDC_OVR1CLUT_BCLUT_OFFSET 0
++#define LCDC_OVR1CLUT_BCLUT (0xff << LCDC_OVR1CLUT_BCLUT_OFFSET)
++#define LCDC_OVR1CLUT_GCLUT_OFFSET 8
++#define LCDC_OVR1CLUT_GCLUT (0xff << LCDC_OVR1CLUT_GCLUT_OFFSET)
++#define LCDC_OVR1CLUT_RCLUT_OFFSET 16
++#define LCDC_OVR1CLUT_RCLUT (0xff << LCDC_OVR1CLUT_RCLUT_OFFSET)
++#define LCDC_OVR1CLUT_ACLUT_OFFSET 24
++#define LCDC_OVR1CLUT_ACLUT (0xff << LCDC_OVR1CLUT_ACLUT_OFFSET)
++
++#define ATMEL_LCDC_HEOCLUT 0x1000
++#define LCDC_HEOCLUT_BCLUT_OFFSET 0
++#define LCDC_HEOCLUT_BCLUT (0xff << LCDC_HEOCLUT_BCLUT_OFFSET)
++#define LCDC_HEOCLUT_GCLUT_OFFSET 8
++#define LCDC_HEOCLUT_GCLUT (0xff << LCDC_HEOCLUT_GCLUT_OFFSET)
++#define LCDC_HEOCLUT_RCLUT_OFFSET 16
++#define LCDC_HEOCLUT_RCLUT (0xff << LCDC_HEOCLUT_RCLUT_OFFSET)
++#define LCDC_HEOCLUT_ACLUT_OFFSET 24
++#define LCDC_HEOCLUT_ACLUT (0xff << LCDC_HEOCLUT_ACLUT_OFFSET)
++
++#define ATMEL_LCDC_HCRCLUT 0x1400
++#define LCDC_HCRCLUT_BCLUT_OFFSET 0
++#define LCDC_HCRCLUT_BCLUT (0xff << LCDC_HCRCLUT_BCLUT_OFFSET)
++#define LCDC_HCRCLUT_GCLUT_OFFSET 8
++#define LCDC_HCRCLUT_GCLUT (0xff << LCDC_HCRCLUT_GCLUT_OFFSET)
++#define LCDC_HCRCLUT_RCLUT_OFFSET 16
++#define LCDC_HCRCLUT_RCLUT (0xff << LCDC_HCRCLUT_RCLUT_OFFSET)
++#define LCDC_HCRCLUT_ACLUT_OFFSET 24
++#define LCDC_HCRCLUT_ACLUT (0xff << LCDC_HCRCLUT_ACLUT_OFFSET)
++
++/* Base layer CLUT */
++#define ATMEL_HLCDC_LUT 0x0400
++
++
++#endif /* __MACH_ATMEL_HLCDC4_H__ */
+--- /dev/null
++++ b/arch/arm/mach-at91/include/mach/atmel_hlcdc_ovl.h
+@@ -0,0 +1,156 @@
++#ifndef __MACH_ATMEL_HLCD_OVL_H__
++#define __MACH_ATMEL_HLCD_OVL_H__
++
++/*
++ * OVL has a seperate resource which already starts at offset 0x100.
++ * So, these defines start at 0x0. The manual will list them at 0x100.
++ */
++
++#define ATMEL_LCDC_OVRCHER1 0x0000
++#define LCDC_OVRCHER1_CHEN (0x1 << 0)
++#define LCDC_OVRCHER1_UPDATEEN (0x1 << 1)
++#define LCDC_OVRCHER1_A2QEN (0x1 << 2)
++
++#define ATMEL_LCDC_OVRCHDR1 0x0004
++#define LCDC_OVRCHDR1_CHDIS (0x1 << 0)
++#define LCDC_OVRCHDR1_CHRST (0x1 << 8)
++
++#define ATMEL_LCDC_OVRCHSR1 0x0008
++#define LCDC_OVRCHSR1_CHSR (0x1 << 0)
++#define LCDC_OVRCHSR1_UPDATESR (0x1 << 1)
++#define LCDC_OVRCHSR1_A2QSR (0x1 << 2)
++
++#define ATMEL_LCDC_OVRIER1 0x000C
++#define LCDC_OVRIER1_DMA (0x1 << 2)
++#define LCDC_OVRIER1_DSCR (0x1 << 3)
++#define LCDC_OVRIER1_ADD (0x1 << 4)
++#define LCDC_OVRIER1_DONE (0x1 << 5)
++#define LCDC_OVRIER1_OVR (0x1 << 6)
++
++#define ATMEL_LCDC_OVRIDR1 0x0010
++#define LCDC_OVRIDR1_DMA (0x1 << 2)
++#define LCDC_OVRIDR1_DSCR (0x1 << 3)
++#define LCDC_OVRIDR1_ADD (0x1 << 4)
++#define LCDC_OVRIDR1_DONE (0x1 << 5)
++#define LCDC_OVRIDR1_OVR (0x1 << 6)
++
++#define ATMEL_LCDC_OVRIMR1 0x0014
++#define LCDC_OVRIMR1_DMA (0x1 << 2)
++#define LCDC_OVRIMR1_DSCR (0x1 << 3)
++#define LCDC_OVRIMR1_ADD (0x1 << 4)
++#define LCDC_OVRIMR1_DONE (0x1 << 5)
++#define LCDC_OVRIMR1_OVR (0x1 << 6)
++
++#define ATMEL_LCDC_OVRISR1 0x0018
++#define LCDC_OVRISR1_DMA (0x1 << 2)
++#define LCDC_OVRISR1_DSCR (0x1 << 3)
++#define LCDC_OVRISR1_ADD (0x1 << 4)
++#define LCDC_OVRISR1_DONE (0x1 << 5)
++#define LCDC_OVRISR1_OVR (0x1 << 6)
++
++#define ATMEL_LCDC_OVRHEAD1 0x001C
++
++#define ATMEL_LCDC_OVRADDR1 0x0020
++
++#define ATMEL_LCDC_OVRCTRL1 0x0024
++#define LCDC_OVRCTRL1_DFETCH (0x1 << 0)
++#define LCDC_OVRCTRL1_LFETCH (0x1 << 1)
++#define LCDC_OVRCTRL1_DMAIEN (0x1 << 2)
++#define LCDC_OVRCTRL1_DSCRIEN (0x1 << 3)
++#define LCDC_OVRCTRL1_ADDIEN (0x1 << 4)
++#define LCDC_OVRCTRL1_DONEIEN (0x1 << 5)
++
++#define ATMEL_LCDC_OVRNEXT1 0x0028
++
++#define ATMEL_LCDC_OVR1CFG0 0x002C
++#define LCDC_OVR1CFG0_BLEN_OFFSET 4
++#define LCDC_OVR1CFG0_BLEN (0x3 << LCDC_OVR1CFG0_BLEN_OFFSET)
++#define LCDC_OVR1CFG0_BLEN_AHB_SINGLE (0x0 << 4)
++#define LCDC_OVR1CFG0_BLEN_AHB_INCR4 (0x1 << 4)
++#define LCDC_OVR1CFG0_BLEN_AHB_INCR8 (0x2 << 4)
++#define LCDC_OVR1CFG0_BLEN_AHB_INCR16 (0x3 << 4)
++#define LCDC_OVR1CFG0_DLBO (0x1 << 8)
++#define LCDC_OVR1CFG0_ROTDIS (0x1 << 12)
++#define LCDC_OVR1CFG0_LOCKDIS (0x1 << 13)
++
++#define ATMEL_LCDC_OVR1CFG1 0x0030
++#define LCDC_OVR1CFG1_CLUTEN (0x1 << 0)
++#define LCDC_OVR1CFG1_RGBMODE_OFFSET 4
++#define LCDC_OVR1CFG1_RGBMODE (0xf << LCDC_OVR1CFG1_RGBMODE_OFFSET)
++#define LCDC_OVR1CFG1_RGBMODE_12BPP_RGB_444 (0x0 << 4)
++#define LCDC_OVR1CFG1_RGBMODE_16BPP_ARGB_4444 (0x1 << 4)
++#define LCDC_OVR1CFG1_RGBMODE_16BPP_RGBA_4444 (0x2 << 4)
++#define LCDC_OVR1CFG1_RGBMODE_16BPP_RGB_565 (0x3 << 4)
++#define LCDC_OVR1CFG1_RGBMODE_16BPP_TRGB_1555 (0x4 << 4)
++#define LCDC_OVR1CFG1_RGBMODE_18BPP_RGB_666 (0x5 << 4)
++#define LCDC_OVR1CFG1_RGBMODE_18BPP_RGB_666_PACKED (0x6 << 4)
++#define LCDC_OVR1CFG1_RGBMODE_19BPP_TRGB_1666 (0x7 << 4)
++#define LCDC_OVR1CFG1_RGBMODE_19BPP_TRGB_PACKED (0x8 << 4)
++#define LCDC_OVR1CFG1_RGBMODE_24BPP_RGB_888 (0x9 << 4)
++#define LCDC_OVR1CFG1_RGBMODE_24BPP_RGB_888_PACKED (0xA << 4)
++#define LCDC_OVR1CFG1_RGBMODE_25BPP_TRGB_1888 (0xB << 4)
++#define LCDC_OVR1CFG1_RGBMODE_32BPP_ARGB_8888 (0xC << 4)
++#define LCDC_OVR1CFG1_RGBMODE_32BPP_RGBA_8888 (0xD << 4)
++#define LCDC_OVR1CFG1_CLUTMODE_OFFSET 8
++#define LCDC_OVR1CFG1_CLUTMODE (0x3 << LCDC_OVR1CFG1_CLUTMODE_OFFSET)
++#define LCDC_OVR1CFG1_CLUTMODE_1BPP (0x0 << 8)
++#define LCDC_OVR1CFG1_CLUTMODE_2BPP (0x1 << 8)
++#define LCDC_OVR1CFG1_CLUTMODE_4BPP (0x2 << 8)
++#define LCDC_OVR1CFG1_CLUTMODE_8BPP (0x3 << 8)
++
++#define ATMEL_LCDC_OVR1CFG2 0x0034
++#define LCDC_OVR1CFG2_XOFFSET_OFFSET 0
++#define LCDC_OVR1CFG2_XOFFSET (0x7ff << LCDC_OVR1CFG2_XOFFSET_OFFSET)
++#define LCDC_OVR1CFG2_YOFFSET_OFFSET 16
++#define LCDC_OVR1CFG2_YOFFSET (0x7ff << LCDC_OVR1CFG2_YOFFSET_OFFSET)
++
++#define ATMEL_LCDC_OVR1CFG3 0x0038
++#define LCDC_OVR1CFG3_XSIZE_OFFSET 0
++#define LCDC_OVR1CFG3_XSIZE (0x7ff << LCDC_OVR1CFG3_XSIZE_OFFSET)
++#define LCDC_OVR1CFG3_YSIZE_OFFSET 16
++#define LCDC_OVR1CFG3_YSIZE (0x7ff << LCDC_OVR1CFG3_YSIZE_OFFSET)
++
++#define ATMEL_LCDC_OVR1CFG4 0x003C
++
++#define ATMEL_LCDC_OVR1CFG5 0x0040
++
++#define ATMEL_LCDC_OVR1CFG6 0x0044
++#define LCDC_OVR1CFG6_BDEF_OFFSET 0
++#define LCDC_OVR1CFG6_BDEF (0xff << LCDC_OVR1CFG6_BDEF_OFFSET)
++#define LCDC_OVR1CFG6_GDEF_OFFSET 8
++#define LCDC_OVR1CFG6_GDEF (0xff << LCDC_OVR1CFG6_GDEF_OFFSET)
++#define LCDC_OVR1CFG6_RDEF_OFFSET 16
++#define LCDC_OVR1CFG6_RDEF (0xff << LCDC_OVR1CFG6_RDEF_OFFSET)
++
++#define ATMEL_LCDC_OVR1CFG7 0x0048
++#define LCDC_OVR1CFG7_BKEY_OFFSET 0
++#define LCDC_OVR1CFG7_BKEY (0xff << LCDC_OVR1CFG7_BKEY_OFFSET)
++#define LCDC_OVR1CFG7_GKEY_OFFSET 8
++#define LCDC_OVR1CFG7_GKEY (0xff << LCDC_OVR1CFG7_GKEY_OFFST)
++#define LCDC_OVR1CFG7_RKEY_OFFSET 16
++#define LCDC_OVR1CFG7_RKEY (0xff << LCDC_OVR1CFG7_RKEY_OFFSET)
++
++#define ATMEL_LCDC_OVR1CFG8 0x004C
++#define LCDC_OVR1CFG8_BMASK_OFFSET 0
++#define LCDC_OVR1CFG8_BMASK (0xff << LCDC_OVR1CFG8_BMASK_OFFSET)
++#define LCDC_OVR1CFG8_GMASK_OFFSET 8
++#define LCDC_OVR1CFG8_GMASK (0xff << LCDC_OVR1CFG8_GMASK_OFFSET)
++#define LCDC_OVR1CFG8_RMASK_OFFSET 16
++#define LCDC_OVR1CFG8_RMASK (0xff << LCDC_OVR1CFG8_RMASK_OFFSET)
++
++#define ATMEL_LCDC_OVR1CFG9 0x0050
++#define LCDC_OVR1CFG9_CRKEY (0x1 << 0)
++#define LCDC_OVR1CFG9_INV (0x1 << 1)
++#define LCDC_OVR1CFG9_ITER2BL (0x1 << 2)
++#define LCDC_OVR1CFG9_ITER (0x1 << 3)
++#define LCDC_OVR1CFG9_REVALPHA (0x1 << 4)
++#define LCDC_OVR1CFG9_GAEN (0x1 << 5)
++#define LCDC_OVR1CFG9_LAEN (0x1 << 6)
++#define LCDC_OVR1CFG9_OVR (0x1 << 7)
++#define LCDC_OVR1CFG9_DMA (0x1 << 8)
++#define LCDC_OVR1CFG9_REP (0x1 << 9)
++#define LCDC_OVR1CFG9_DSTKEY (0x1 << 10)
++#define LCDC_OVR1CFG9_GA_OFFSET 16
++#define LCDC_OVR1CFG9_GA (0xff << LCDC_OVR1CFG9_GA_OFFSET)
++
++#endif /* __MACH_ATMEL_HLCD_OVL_H__ */
+--- a/arch/arm/mach-at91/include/mach/atmel_hlcdfb.h
++++ /dev/null
+@@ -1,865 +0,0 @@
+-/*
+- * Header file for AT91 High end LCD Controller
+- *
+- * Data structure and register user interface
+- *
+- * Copyright (C) 2010 Atmel Corporation
+- *
+- * This program is free software; you can redistribute it and/or modify
+- * it under the terms of the GNU General Public License as published by
+- * the Free Software Foundation; either version 2 of the License, or
+- * (at your option) any later version.
+- *
+- * This program is distributed in the hope that it will be useful,
+- * but WITHOUT ANY WARRANTY; without even the implied warranty of
+- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PUROFFSETE. See the
+- * GNU General Public License for more details.
+- *
+- * You should have received a copy of the GNU General Public 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 __ATMEL_HLCD_H__
+-#define __ATMEL_HLCD_H__
+-
+-/* Lcdc hardware registers */
+-#define ATMEL_LCDC_LCDCFG0 0x0000
+-#define LCDC_LCDCFG0_CLKPOL (0x1 << 0)
+-#define LCDC_LCDCFG0_CLKSEL (0x1 << 2)
+-#define LCDC_LCDCFG0_CLKPWMSEL (0x1 << 3)
+-#define LCDC_LCDCFG0_CGDISBASE (0x1 << 8)
+-#define LCDC_LCDCFG0_CGDISOVR1 (0x1 << 9)
+-#define LCDC_LCDCFG0_CGDISHEO (0x1 << 11)
+-#define LCDC_LCDCFG0_CGDISHCR (0x1 << 12)
+-#define LCDC_LCDCFG0_CLKDIV_OFFSET 16
+-#define LCDC_LCDCFG0_CLKDIV (0xff << LCDC_LCDCFG0_CLKDIV_OFFSET)
+-
+-#define ATMEL_LCDC_LCDCFG1 0x0004
+-#define LCDC_LCDCFG1_HSPW_OFFSET 0
+-#define LCDC_LCDCFG1_HSPW (0x3f << LCDC_LCDCFG1_HSPW_OFFSET)
+-#define LCDC_LCDCFG1_VSPW_OFFSET 16
+-#define LCDC_LCDCFG1_VSPW (0x3f << LCDC_LCDCFG1_VSPW_OFFSET)
+-
+-#define ATMEL_LCDC_LCDCFG2 0x0008
+-#define LCDC_LCDCFG2_VFPW_OFFSET 0
+-#define LCDC_LCDCFG2_VFPW (0x3f << LCDC_LCDCFG2_VFPW_OFFSET)
+-#define LCDC_LCDCFG2_VBPW_OFFSET 16
+-#define LCDC_LCDCFG2_VBPW (0x3f << LCDC_LCDCFG2_VBPW_OFFSET)
+-
+-#define ATMEL_LCDC_LCDCFG3 0x000C
+-#define LCDC_LCDCFG3_HFPW_OFFSET 0
+-#define LCDC_LCDCFG3_HFPW (0xff << LCDC_LCDCFG3_HFPW_OFFSET)
+-#define LCDC_LCDCFG3_HBPW_OFFSET 16
+-#define LCDC_LCDCFG3_HBPW (0xff << LCDC_LCDCFG3_HBPW_OFFSET)
+-
+-#define ATMEL_LCDC_LCDCFG4 0x0010
+-#define LCDC_LCDCFG4_PPL_OFFSET 0
+-#define LCDC_LCDCFG4_PPL (0x7ff << LCDC_LCDCFG4_PPL_OFFSET)
+-#define LCDC_LCDCFG4_RPF_OFFSET 16
+-#define LCDC_LCDCFG4_RPF (0x7ff << LCDC_LCDCFG4_RPF_OFFSET)
+-
+-#define ATMEL_LCDC_LCDCFG5 0x0014
+-#define LCDC_LCDCFG5_HSPOL (0x1 << 0)
+-#define LCDC_LCDCFG5_VSPOL (0x1 << 1)
+-#define LCDC_LCDCFG5_VSPDLYS (0x1 << 2)
+-#define LCDC_LCDCFG5_VSPDLYE (0x1 << 3)
+-#define LCDC_LCDCFG5_DISPPOL (0x1 << 4)
+-#define LCDC_LCDCFG5_SERIAL (0x1 << 5)
+-#define LCDC_LCDCFG5_DITHER (0x1 << 6)
+-#define LCDC_LCDCFG5_DISPDLY (0x1 << 7)
+-#define LCDC_LCDCFG5_MODE_OFFSET 8
+-#define LCDC_LCDCFG5_MODE (0x3 << LCDC_LCDCFG5_MODE_OFFSET)
+-#define LCDC_LCDCFG5_MODE_OUTPUT_12BPP (0x0 << 8)
+-#define LCDC_LCDCFG5_MODE_OUTPUT_16BPP (0x1 << 8)
+-#define LCDC_LCDCFG5_MODE_OUTPUT_18BPP (0x2 << 8)
+-#define LCDC_LCDCFG5_MODE_OUTPUT_24BPP (0x3 << 8)
+-#define LCDC_LCDCFG5_VSPSU (0x1 << 12)
+-#define LCDC_LCDCFG5_VSPHO (0x1 << 13)
+-#define LCDC_LCDCFG5_GUARDTIME_OFFSET 16
+-#define LCDC_LCDCFG5_GUARDTIME (0x1f << LCDC_LCDCFG5_GUARDTIME_OFFSET)
+-
+-#define ATMEL_LCDC_LCDCFG6 0x0018
+-#define LCDC_LCDCFG6_PWMPS_OFFSET 0
+-#define LCDC_LCDCFG6_PWMPS (0x7 << LCDC_LCDCFG6_PWMPS_OFFSET)
+-#define LCDC_LCDCFG6_PWMPOL (0x1 << 4)
+-#define LCDC_LCDCFG6_PWMCVAL_OFFSET 8
+-#define LCDC_LCDCFG6_PWMCVAL (0xff << LCDC_LCDCFG6_PWMCVAL_OFFSET)
+-
+-#define ATMEL_LCDC_LCDEN 0x0020
+-#define LCDC_LCDEN_CLKEN (0x1 << 0)
+-#define LCDC_LCDEN_SYNCEN (0x1 << 1)
+-#define LCDC_LCDEN_DISPEN (0x1 << 2)
+-#define LCDC_LCDEN_PWMEN (0x1 << 3)
+-
+-#define ATMEL_LCDC_LCDDIS 0x0024
+-#define LCDC_LCDDIS_CLKDIS (0x1 << 0)
+-#define LCDC_LCDDIS_SYNCDIS (0x1 << 1)
+-#define LCDC_LCDDIS_DISPDIS (0x1 << 2)
+-#define LCDC_LCDDIS_PWMDIS (0x1 << 3)
+-#define LCDC_LCDDIS_CLKRST (0x1 << 8)
+-#define LCDC_LCDDIS_SYNCRST (0x1 << 9)
+-#define LCDC_LCDDIS_DISPRST (0x1 << 10)
+-#define LCDC_LCDDIS_PWMRST (0x1 << 11)
+-
+-#define ATMEL_LCDC_LCDSR 0x0028
+-#define LCDC_LCDSR_CLKSTS (0x1 << 0)
+-#define LCDC_LCDSR_LCDSTS (0x1 << 1)
+-#define LCDC_LCDSR_DISPSTS (0x1 << 2)
+-#define LCDC_LCDSR_PWMSTS (0x1 << 3)
+-#define LCDC_LCDSR_SIPSTS (0x1 << 4)
+-
+-#define ATMEL_LCDC_LCDIER 0x002C
+-#define LCDC_LCDIER_SOFIE (0x1 << 0)
+-#define LCDC_LCDIER_DISIE (0x1 << 1)
+-#define LCDC_LCDIER_DISPIE (0x1 << 2)
+-#define LCDC_LCDIER_FIFOERRIE (0x1 << 4)
+-#define LCDC_LCDIER_BASEIE (0x1 << 8)
+-#define LCDC_LCDIER_OVR1IE (0x1 << 9)
+-#define LCDC_LCDIER_HEOIE (0x1 << 11)
+-#define LCDC_LCDIER_HCRIE (0x1 << 12)
+-
+-#define ATMEL_LCDC_LCDIDR 0x0030
+-#define LCDC_LCDIDR_SOFID (0x1 << 0)
+-#define LCDC_LCDIDR_DISID (0x1 << 1)
+-#define LCDC_LCDIDR_DISPID (0x1 << 2)
+-#define LCDC_LCDIDR_FIFOERRID (0x1 << 4)
+-#define LCDC_LCDIDR_BASEID (0x1 << 8)
+-#define LCDC_LCDIDR_OVR1ID (0x1 << 9)
+-#define LCDC_LCDIDR_HEOID (0x1 << 11)
+-#define LCDC_LCDIDR_HCRID (0x1 << 12)
+-
+-#define ATMEL_LCDC_LCDIMR 0x0034
+-#define LCDC_LCDIMR_SOFIM (0x1 << 0)
+-#define LCDC_LCDIMR_DISIM (0x1 << 1)
+-#define LCDC_LCDIMR_DISPIM (0x1 << 2)
+-#define LCDC_LCDIMR_FIFOERRIM (0x1 << 4)
+-#define LCDC_LCDIMR_BASEIM (0x1 << 8)
+-#define LCDC_LCDIMR_OVR1IM (0x1 << 9)
+-#define LCDC_LCDIMR_HEOIM (0x1 << 11)
+-#define LCDC_LCDIMR_HCRIM (0x1 << 12)
+-
+-#define ATMEL_LCDC_LCDISR 0x0038
+-#define LCDC_LCDISR_SOF (0x1 << 0)
+-#define LCDC_LCDISR_DIS (0x1 << 1)
+-#define LCDC_LCDISR_DISP (0x1 << 2)
+-#define LCDC_LCDISR_FIFOERR (0x1 << 4)
+-#define LCDC_LCDISR_BASE (0x1 << 8)
+-#define LCDC_LCDISR_OVR1 (0x1 << 9)
+-#define LCDC_LCDISR_HEO (0x1 << 11)
+-#define LCDC_LCDISR_HCR (0x1 << 12)
+-
+-#define ATMEL_LCDC_BASECHER 0x0040
+-#define LCDC_BASECHER_CHEN (0x1 << 0)
+-#define LCDC_BASECHER_UPDATEEN (0x1 << 1)
+-#define LCDC_BASECHER_A2QEN (0x1 << 2)
+-
+-#define ATMEL_LCDC_BASECHDR 0x0044
+-#define LCDC_BASECHDR_CHDIS (0x1 << 0)
+-#define LCDC_BASECHDR_CHRST (0x1 << 8)
+-
+-#define ATMEL_LCDC_BASECHSR 0x0048
+-#define LCDC_BASECHSR_CHSR (0x1 << 0)
+-#define LCDC_BASECHSR_UPDATESR (0x1 << 1)
+-#define LCDC_BASECHSR_A2QSR (0x1 << 2)
+-
+-#define ATMEL_LCDC_BASEIER 0x004C
+-#define LCDC_BASEIER_DMA (0x1 << 2)
+-#define LCDC_BASEIER_DSCR (0x1 << 3)
+-#define LCDC_BASEIER_ADD (0x1 << 4)
+-#define LCDC_BASEIER_DONE (0x1 << 5)
+-#define LCDC_BASEIER_OVR (0x1 << 6)
+-
+-#define ATMEL_LCDC_BASEIDR 0x0050
+-#define LCDC_BASEIDR_DMA (0x1 << 2)
+-#define LCDC_BASEIDR_DSCR (0x1 << 3)
+-#define LCDC_BASEIDR_ADD (0x1 << 4)
+-#define LCDC_BASEIDR_DONE (0x1 << 5)
+-#define LCDC_BASEIDR_OVR (0x1 << 6)
+-
+-#define ATMEL_LCDC_BASEIMR 0x0054
+-#define LCDC_BASEIMR_DMA (0x1 << 2)
+-#define LCDC_BASEIMR_DSCR (0x1 << 3)
+-#define LCDC_BASEIMR_ADD (0x1 << 4)
+-#define LCDC_BASEIMR_DONE (0x1 << 5)
+-#define LCDC_BASEIMR_OVR (0x1 << 6)
+-
+-#define ATMEL_LCDC_BASEISR 0x0058
+-#define LCDC_BASEISR_DMA (0x1 << 2)
+-#define LCDC_BASEISR_DSCR (0x1 << 3)
+-#define LCDC_BASEISR_ADD (0x1 << 4)
+-#define LCDC_BASEISR_DONE (0x1 << 5)
+-#define LCDC_BASEISR_OVR (0x1 << 6)
+-
+-#define ATMEL_LCDC_BASEHEAD 0x005C
+-
+-#define ATMEL_LCDC_BASEADDR 0x0060
+-
+-#define ATMEL_LCDC_BASECTRL 0x0064
+-#define LCDC_BASECTRL_DFETCH (0x1 << 0)
+-#define LCDC_BASECTRL_LFETCH (0x1 << 1)
+-#define LCDC_BASECTRL_DMAIEN (0x1 << 2)
+-#define LCDC_BASECTRL_DSCRIEN (0x1 << 3)
+-#define LCDC_BASECTRL_ADDIEN (0x1 << 4)
+-#define LCDC_BASECTRL_DONEIEN (0x1 << 5)
+-
+-#define ATMEL_LCDC_BASENEXT 0x0068
+-
+-#define ATMEL_LCDC_BASECFG0 0x006C
+-#define LCDC_BASECFG0_BLEN_OFFSET 4
+-#define LCDC_BASECFG0_BLEN (0x3 << LCDC_BASECFG0_BLEN_OFFSET)
+-#define LCDC_BASECFG0_BLEN_AHB_SINGLE (0x0 << 4)
+-#define LCDC_BASECFG0_BLEN_AHB_INCR4 (0x1 << 4)
+-#define LCDC_BASECFG0_BLEN_AHB_INCR8 (0x2 << 4)
+-#define LCDC_BASECFG0_BLEN_AHB_INCR16 (0x3 << 4)
+-#define LCDC_BASECFG0_DLBO (0x1 << 8)
+-
+-#define ATMEL_LCDC_BASECFG1 0x0070
+-#define LCDC_BASECFG1_CLUTEN (0x1 << 0)
+-#define LCDC_BASECFG1_RGBMODE_OFFSET 4
+-#define LCDC_BASECFG1_RGBMODE (0xf << LCDC_BASECFG1_RGBMODE_OFFSET)
+-#define LCDC_BASECFG1_RGBMODE_12BPP_RGB_444 (0x0 << 4)
+-#define LCDC_BASECFG1_RGBMODE_16BPP_ARGB_4444 (0x1 << 4)
+-#define LCDC_BASECFG1_RGBMODE_16BPP_RGBA_4444 (0x2 << 4)
+-#define LCDC_BASECFG1_RGBMODE_16BPP_RGB_565 (0x3 << 4)
+-#define LCDC_BASECFG1_RGBMODE_16BPP_TRGB_1555 (0x4 << 4)
+-#define LCDC_BASECFG1_RGBMODE_18BPP_RGB_666 (0x5 << 4)
+-#define LCDC_BASECFG1_RGBMODE_18BPP_RGB_666_PACKED (0x6 << 4)
+-#define LCDC_BASECFG1_RGBMODE_19BPP_TRGB_1666 (0x7 << 4)
+-#define LCDC_BASECFG1_RGBMODE_19BPP_TRGB_PACKED (0x8 << 4)
+-#define LCDC_BASECFG1_RGBMODE_24BPP_RGB_888 (0x9 << 4)
+-#define LCDC_BASECFG1_RGBMODE_24BPP_RGB_888_PACKED (0xA << 4)
+-#define LCDC_BASECFG1_RGBMODE_25BPP_TRGB_1888 (0xB << 4)
+-#define LCDC_BASECFG1_RGBMODE_32BPP_ARGB_8888 (0xC << 4)
+-#define LCDC_BASECFG1_RGBMODE_32BPP_RGBA_8888 (0xD << 4)
+-#define LCDC_BASECFG1_CLUTMODE_OFFSET 8
+-#define LCDC_BASECFG1_CLUTMODE (0x3 << LCDC_BASECFG1_CLUTMODE_OFFSET)
+-#define LCDC_BASECFG1_CLUTMODE_1BPP (0x0 << 8)
+-#define LCDC_BASECFG1_CLUTMODE_2BPP (0x1 << 8)
+-#define LCDC_BASECFG1_CLUTMODE_4BPP (0x2 << 8)
+-#define LCDC_BASECFG1_CLUTMODE_8BPP (0x3 << 8)
+-
+-#define ATMEL_LCDC_BASECFG2 0x0074
+-
+-#define ATMEL_LCDC_BASECFG3 0x0078
+-#define LCDC_BASECFG3_BDEF_OFFSET 0
+-#define LCDC_BASECFG3_BDEF (0xff << LCDC_BASECFG3_BDEF_OFFSET)
+-#define LCDC_BASECFG3_GDEF_OFFSET 8
+-#define LCDC_BASECFG3_GDEF (0xff << LCDC_BASECFG3_GDEF_OFFSET)
+-#define LCDC_BASECFG3_RDEF_OFFSET 16
+-#define LCDC_BASECFG3_RDEF (0xff << LCDC_BASECFG3_RDEF_OFFSET)
+-
+-#define ATMEL_LCDC_BASECFG4 0x007C
+-#define LCDC_BASECFG4_DMA (0x1 << 8)
+-#define LCDC_BASECFG4_REP (0x1 << 9)
+-
-#define ATMEL_LCDC_OVRCHER1 0x0100
-#define LCDC_OVRCHER1_CHEN (0x1 << 0)
-#define LCDC_OVRCHER1_UPDATEEN (0x1 << 1)
@@ -395,192 +1485,698 @@ index a57b79b..9ed7e6e 100644
-#define LCDC_OVR1CFG9_GA_OFFSET 16
-#define LCDC_OVR1CFG9_GA (0xff << LCDC_OVR1CFG9_GA_OFFSET)
-
- #define ATMEL_LCDC_HEOCHER 0x0280
- #define LCDC_HEOCHER_CHEN (0x1 << 0)
- #define LCDC_HEOCHER_UPDATEEN (0x1 << 1)
-@@ -859,7 +712,7 @@
- #define LCDC_HCRCLUT_ACLUT (0xff << LCDC_HCRCLUT_ACLUT_OFFSET)
-
- /* Base layer CLUT */
+-#define ATMEL_LCDC_HEOCHER 0x0280
+-#define LCDC_HEOCHER_CHEN (0x1 << 0)
+-#define LCDC_HEOCHER_UPDATEEN (0x1 << 1)
+-#define LCDC_HEOCHER_A2QEN (0x1 << 2)
+-
+-#define ATMEL_LCDC_HEOCHDR 0x0284
+-#define LCDC_HEOCHDR_CHDIS (0x1 << 0)
+-#define LCDC_HEOCHDR_CHRST (0x1 << 8)
+-
+-#define ATMEL_LCDC_HEOCHSR 0x0288
+-#define LCDC_HEOCHSR_CHSR (0x1 << 0)
+-#define LCDC_HEOCHSR_UPDATESR (0x1 << 1)
+-#define LCDC_HEOCHSR_A2QSR (0x1 << 2)
+-
+-#define ATMEL_LCDC_HEOIER 0x028C
+-#define LCDC_HEOIER_DMA (0x1 << 2)
+-#define LCDC_HEOIER_DSCR (0x1 << 3)
+-#define LCDC_HEOIER_ADD (0x1 << 4)
+-#define LCDC_HEOIER_DONE (0x1 << 5)
+-#define LCDC_HEOIER_OVR (0x1 << 6)
+-#define LCDC_HEOIER_UDMA (0x1 << 10)
+-#define LCDC_HEOIER_UDSCR (0x1 << 11)
+-#define LCDC_HEOIER_UADD (0x1 << 12)
+-#define LCDC_HEOIER_UDONE (0x1 << 13)
+-#define LCDC_HEOIER_UOVR (0x1 << 14)
+-#define LCDC_HEOIER_VDMA (0x1 << 18)
+-#define LCDC_HEOIER_VDSCR (0x1 << 19)
+-#define LCDC_HEOIER_VADD (0x1 << 20)
+-#define LCDC_HEOIER_VDONE (0x1 << 21)
+-#define LCDC_HEOIER_VOVR (0x1 << 22)
+-
+-#define ATMEL_LCDC_HEOIDR 0x0290
+-#define LCDC_HEOIDR_DMA (0x1 << 2)
+-#define LCDC_HEOIDR_DSCR (0x1 << 3)
+-#define LCDC_HEOIDR_ADD (0x1 << 4)
+-#define LCDC_HEOIDR_DONE (0x1 << 5)
+-#define LCDC_HEOIDR_OVR (0x1 << 6)
+-#define LCDC_HEOIDR_UDMA (0x1 << 10)
+-#define LCDC_HEOIDR_UDSCR (0x1 << 11)
+-#define LCDC_HEOIDR_UADD (0x1 << 12)
+-#define LCDC_HEOIDR_UDONE (0x1 << 13)
+-#define LCDC_HEOIDR_UOVR (0x1 << 14)
+-#define LCDC_HEOIDR_VDMA (0x1 << 18)
+-#define LCDC_HEOIDR_VDSCR (0x1 << 19)
+-#define LCDC_HEOIDR_VADD (0x1 << 20)
+-#define LCDC_HEOIDR_VDONE (0x1 << 21)
+-#define LCDC_HEOIDR_VOVR (0x1 << 22)
+-
+-#define ATMEL_LCDC_HEOIMR 0x0294
+-#define LCDC_HEOIMR_DMA (0x1 << 2)
+-#define LCDC_HEOIMR_DSCR (0x1 << 3)
+-#define LCDC_HEOIMR_ADD (0x1 << 4)
+-#define LCDC_HEOIMR_DONE (0x1 << 5)
+-#define LCDC_HEOIMR_OVR (0x1 << 6)
+-#define LCDC_HEOIMR_UDMA (0x1 << 10)
+-#define LCDC_HEOIMR_UDSCR (0x1 << 11)
+-#define LCDC_HEOIMR_UADD (0x1 << 12)
+-#define LCDC_HEOIMR_UDONE (0x1 << 13)
+-#define LCDC_HEOIMR_UOVR (0x1 << 14)
+-#define LCDC_HEOIMR_VDMA (0x1 << 18)
+-#define LCDC_HEOIMR_VDSCR (0x1 << 19)
+-#define LCDC_HEOIMR_VADD (0x1 << 20)
+-#define LCDC_HEOIMR_VDONE (0x1 << 21)
+-#define LCDC_HEOIMR_VOVR (0x1 << 22)
+-
+-#define ATMEL_LCDC_HEOISR 0x0298
+-#define LCDC_HEOISR_DMA (0x1 << 2)
+-#define LCDC_HEOISR_DSCR (0x1 << 3)
+-#define LCDC_HEOISR_ADD (0x1 << 4)
+-#define LCDC_HEOISR_DONE (0x1 << 5)
+-#define LCDC_HEOISR_OVR (0x1 << 6)
+-#define LCDC_HEOISR_UDMA (0x1 << 10)
+-#define LCDC_HEOISR_UDSCR (0x1 << 11)
+-#define LCDC_HEOISR_UADD (0x1 << 12)
+-#define LCDC_HEOISR_UDONE (0x1 << 13)
+-#define LCDC_HEOISR_UOVR (0x1 << 14)
+-#define LCDC_HEOISR_VDMA (0x1 << 18)
+-#define LCDC_HEOISR_VDSCR (0x1 << 19)
+-#define LCDC_HEOISR_VADD (0x1 << 20)
+-#define LCDC_HEOISR_VDONE (0x1 << 21)
+-#define LCDC_HEOISR_VOVR (0x1 << 22)
+-
+-#define ATMEL_LCDC_HEOHEAD 0x029C
+-
+-#define ATMEL_LCDC_HEOADDR 0x02A0
+-
+-#define ATMEL_LCDC_HEOCTRL 0x02A4
+-#define LCDC_HEOCTRL_DFETCH (0x1 << 0)
+-#define LCDC_HEOCTRL_LFETCH (0x1 << 1)
+-#define LCDC_HEOCTRL_DMAIEN (0x1 << 2)
+-#define LCDC_HEOCTRL_DSCRIEN (0x1 << 3)
+-#define LCDC_HEOCTRL_ADDIEN (0x1 << 4)
+-#define LCDC_HEOCTRL_DONEIEN (0x1 << 5)
+-
+-#define ATMEL_LCDC_HEONEXT 0x02A8
+-
+-#define ATMEL_LCDC_HEOUHEAD 0x02AC
+-
+-#define ATMEL_LCDC_HEOUADDR 0x02B0
+-
+-#define ATMEL_LCDC_HEOUCTRL 0x02B4
+-#define LCDC_HEOUCTRL_UDFETCH (0x1 << 0)
+-#define LCDC_HEOUCTRL_UDMAIEN (0x1 << 2)
+-#define LCDC_HEOUCTRL_UDSCRIEN (0x1 << 3)
+-#define LCDC_HEOUCTRL_UADDIEN (0x1 << 4)
+-#define LCDC_HEOUCTRL_UDONEIEN (0x1 << 5)
+-
+-#define ATMEL_LCDC_HEOUNEXT 0x02B8
+-
+-#define ATMEL_LCDC_HEOVHEAD 0x02BC
+-
+-#define ATMEL_LCDC_HEOVADDR 0x02C0
+-
+-#define ATMEL_LCDC_HEOVCTRL 0x02C4
+-#define LCDC_HEOVCTRL_VDFETCH (0x1 << 0)
+-#define LCDC_HEOVCTRL_VDMAIEN (0x1 << 2)
+-#define LCDC_HEOVCTRL_VDSCRIEN (0x1 << 3)
+-#define LCDC_HEOVCTRL_VADDIEN (0x1 << 4)
+-#define LCDC_HEOVCTRL_VDONEIEN (0x1 << 5)
+-
+-#define ATMEL_LCDC_HEOVNEXT 0x02C8
+-
+-#define ATMEL_LCDC_HEOCFG0 0x02CC
+-#define LCDC_HEOCFG0_BLEN_OFFSET 4
+-#define LCDC_HEOCFG0_BLEN (0x3 << LCDC_HEOCFG0_BLEN_OFFSET)
+-#define LCDC_HEOCFG0_BLEN_AHB_SINGLE (0x0 << 4)
+-#define LCDC_HEOCFG0_BLEN_AHB_INCR4 (0x1 << 4)
+-#define LCDC_HEOCFG0_BLEN_AHB_INCR8 (0x2 << 4)
+-#define LCDC_HEOCFG0_BLEN_AHB_INCR16 (0x3 << 4)
+-#define LCDC_HEOCFG0_BLENUV_OFFSET 6
+-#define LCDC_HEOCFG0_BLENUV (0x3 << LCDC_HEOCFG0_BLENUV_OFFSET)
+-#define LCDC_HEOCFG0_BLENUV_AHB_SINGLE (0x0 << 6)
+-#define LCDC_HEOCFG0_BLENUV_AHB_INCR4 (0x1 << 6)
+-#define LCDC_HEOCFG0_BLENUV_AHB_INCR8 (0x2 << 6)
+-#define LCDC_HEOCFG0_BLENUV_AHB_INCR16 (0x3 << 6)
+-#define LCDC_HEOCFG0_DLBO (0x1 << 8)
+-#define LCDC_HEOCFG0_ROTDIS (0x1 << 12)
+-#define LCDC_HEOCFG0_LOCKDIS (0x1 << 13)
+-
+-#define ATMEL_LCDC_HEOCFG1 0x02D0
+-#define LCDC_HEOCFG1_CLUTEN (0x1 << 0)
+-#define LCDC_HEOCFG1_YUVEN (0x1 << 1)
+-#define LCDC_HEOCFG1_RGBMODE_OFFSET 4
+-#define LCDC_HEOCFG1_RGBMODE (0xf << LCDC_HEOCFG1_RGBMODE_OFFSET)
+-#define LCDC_HEOCFG1_RGBMODE_12BPP_RGB_444 (0x0 << 4)
+-#define LCDC_HEOCFG1_RGBMODE_16BPP_ARGB_4444 (0x1 << 4)
+-#define LCDC_HEOCFG1_RGBMODE_16BPP_RGBA_4444 (0x2 << 4)
+-#define LCDC_HEOCFG1_RGBMODE_16BPP_RGB_565 (0x3 << 4)
+-#define LCDC_HEOCFG1_RGBMODE_16BPP_TRGB_1555 (0x4 << 4)
+-#define LCDC_HEOCFG1_RGBMODE_18BPP_RGB_666 (0x5 << 4)
+-#define LCDC_HEOCFG1_RGBMODE_18BPP_RGB_666_PACKED (0x6 << 4)
+-#define LCDC_HEOCFG1_RGBMODE_19BPP_TRGB_1666 (0x7 << 4)
+-#define LCDC_HEOCFG1_RGBMODE_19BPP_TRGB_PACKED (0x8 << 4)
+-#define LCDC_HEOCFG1_RGBMODE_24BPP_RGB_888 (0x9 << 4)
+-#define LCDC_HEOCFG1_RGBMODE_24BPP_RGB_888_PACKED (0xA << 4)
+-#define LCDC_HEOCFG1_RGBMODE_25BPP_TRGB_1888 (0xB << 4)
+-#define LCDC_HEOCFG1_RGBMODE_32BPP_ARGB_8888 (0xC << 4)
+-#define LCDC_HEOCFG1_RGBMODE_32BPP_RGBA_8888 (0xD << 4)
+-#define LCDC_HEOCFG1_CLUTMODE_OFFSET 8
+-#define LCDC_HEOCFG1_CLUTMODE (0x3 << LCDC_HEOCFG1_CLUTMODE_OFFSET)
+-#define LCDC_HEOCFG1_CLUTMODE_1BPP (0x0 << 8)
+-#define LCDC_HEOCFG1_CLUTMODE_2BPP (0x1 << 8)
+-#define LCDC_HEOCFG1_CLUTMODE_4BPP (0x2 << 8)
+-#define LCDC_HEOCFG1_CLUTMODE_8BPP (0x3 << 8)
+-#define LCDC_HEOCFG1_YUVMODE_OFFSET 12
+-#define LCDC_HEOCFG1_YUVMODE (0xf << LCDC_HEOCFG1_YUVMODE_OFFSET)
+-#define LCDC_HEOCFG1_YUVMODE_32BPP_AYCBCR (0x0 << 12)
+-#define LCDC_HEOCFG1_YUVMODE_16BPP_YCBCR_MODE0 (0x1 << 12)
+-#define LCDC_HEOCFG1_YUVMODE_16BPP_YCBCR_MODE1 (0x2 << 12)
+-#define LCDC_HEOCFG1_YUVMODE_16BPP_YCBCR_MODE2 (0x3 << 12)
+-#define LCDC_HEOCFG1_YUVMODE_16BPP_YCBCR_MODE3 (0x4 << 12)
+-#define LCDC_HEOCFG1_YUVMODE_16BPP_YCBCR_SEMIPLANAR (0x5 << 12)
+-#define LCDC_HEOCFG1_YUVMODE_16BPP_YCBCR_PLANAR (0x6 << 12)
+-#define LCDC_HEOCFG1_YUVMODE_12BPP_YCBCR_SEMIPLANAR (0x7 << 12)
+-#define LCDC_HEOCFG1_YUVMODE_12BPP_YCBCR_PLANAR (0x8 << 12)
+-#define LCDC_HEOCFG1_YUV422ROT (0x1 << 16)
+-#define LCDC_HEOCFG1_YUV422SWP (0x1 << 17)
+-
+-#define ATMEL_LCDC_HEOCFG2 0x02D4
+-#define LCDC_HEOCFG2_XOFFSET_OFFSET 0
+-#define LCDC_HEOCFG2_XOFFSET (0x7ff << LCDC_HEOCFG2_XOFFSET_OFFSET)
+-#define LCDC_HEOCFG2_YOFFSET_OFFSET 16
+-#define LCDC_HEOCFG2_YOFFSET (0x7ff << LCDC_HEOCFG2_YOFFSET_OFFSET)
+-
+-#define ATMEL_LCDC_HEOCFG3 0x02D8
+-#define LCDC_HEOCFG3_XSIZE_OFFSET 0
+-#define LCDC_HEOCFG3_XSIZE (0x7ff << LCDC_HEOCFG3_XSIZE_OFFSET)
+-#define LCDC_HEOCFG3_YSIZE_OFFSET 16
+-#define LCDC_HEOCFG3_YSIZE (0x7ff << LCDC_HEOCFG3_YSIZE_OFFSET)
+-
+-#define ATMEL_LCDC_HEOCFG4 0x02DC
+-#define LCDC_HEOCFG4_XMEM_SIZE_OFFSET 0
+-#define LCDC_HEOCFG4_XMEM_SIZE (0x7ff << LCDC_HEOCFG4_XMEM_SIZE_OFFSET)
+-#define LCDC_HEOCFG4_YMEM_SIZE_OFFSET 16
+-#define LCDC_HEOCFG4_YMEM_SIZE (0x7ff << LCDC_HEOCFG4_YMEM_SIZE_OFFSET)
+-
+-#define ATMEL_LCDC_HEOCFG5 0x02E0
+-
+-#define ATMEL_LCDC_HEOCFG6 0x02E4
+-
+-#define ATMEL_LCDC_HEOCFG7 0x02E8
+-
+-#define ATMEL_LCDC_HEOCFG8 0x02EC
+-
+-#define ATMEL_LCDC_HEOCFG9 0x02F0
+-#define LCDC_HEOCFG9_BDEF_OFFSET 0
+-#define LCDC_HEOCFG9_BDEF (0xff << LCDC_HEOCFG9_BDEF_OFFSET)
+-#define LCDC_HEOCFG9_GDEF_OFFSET 8
+-#define LCDC_HEOCFG9_GDEF (0xff << LCDC_HEOCFG9_GDEF_OFFSET)
+-#define LCDC_HEOCFG9_RDEF_OFFSET 16
+-#define LCDC_HEOCFG9_RDEF (0xff << LCDC_HEOCFG9_RDEF_OFFSET)
+-
+-#define ATMEL_LCDC_HEOCFG10 0x02F4
+-#define LCDC_HEOCFG10_BKEY_OFFSET 0
+-#define LCDC_HEOCFG10_BKEY (0xff << LCDC_HEOCFG10_BKEY_OFFSET)
+-#define LCDC_HEOCFG10_GKEY_OFFSET 8
+-#define LCDC_HEOCFG10_GKEY (0xff << LCDC_HEOCFG10_GKEY_OFFSET)
+-#define LCDC_HEOCFG10_RKEY_OFFSET 16
+-#define LCDC_HEOCFG10_RKEY (0xff << LCDC_HEOCFG10_RKEY_OFFSET)
+-
+-#define ATMEL_LCDC_HEOCFG11 0x02F8
+-#define LCDC_HEOCFG11_BMASK_OFFSET 0
+-#define LCDC_HEOCFG11_BMASK (0xff << LCDC_HEOCFG11_BMASK_OFFSET)
+-#define LCDC_HEOCFG11_GMASK_OFFSET 8
+-#define LCDC_HEOCFG11_GMASK (0xff << LCDC_HEOCFG11_GMASK_OFFSET)
+-#define LCDC_HEOCFG11_RMASK_OFFSET 16
+-#define LCDC_HEOCFG11_RMASK (0xff << LCDC_HEOCFG11_RMASK_OFFSET)
+-
+-#define ATMEL_LCDC_HEOCFG12 0x02FC
+-#define LCDC_HEOCFG12_CRKEY (0x1 << 0)
+-#define LCDC_HEOCFG12_INV (0x1 << 1)
+-#define LCDC_HEOCFG12_ITER2BL (0x1 << 2)
+-#define LCDC_HEOCFG12_ITER (0x1 << 3)
+-#define LCDC_HEOCFG12_REVALPHA (0x1 << 4)
+-#define LCDC_HEOCFG12_GAEN (0x1 << 5)
+-#define LCDC_HEOCFG12_LAEN (0x1 << 6)
+-#define LCDC_HEOCFG12_OVR (0x1 << 7)
+-#define LCDC_HEOCFG12_DMA (0x1 << 8)
+-#define LCDC_HEOCFG12_REP (0x1 << 9)
+-#define LCDC_HEOCFG12_DSTKEY (0x1 << 10)
+-#define LCDC_HEOCFG12_VIDPRI (0x1 << 12)
+-#define LCDC_HEOCFG12_GA_OFFSET 16
+-#define LCDC_HEOCFG12_GA (0xff << LCDC_HEOCFG12_GA_OFFSET)
+-
+-#define ATMEL_LCDC_HEOCFG13 0x0300
+-#define LCDC_HEOCFG13_XFACTOR_OFFSET 0
+-#define LCDC_HEOCFG13_XFACTOR (0x1fff << LCDC_HEOCFG13_XFACTOR_OFFSET)
+-#define LCDC_HEOCFG13_YFACTOR_OFFSET 16
+-#define LCDC_HEOCFG13_YFACTOR (0x1fff << LCDC_HEOCFG13_YFACTOR_OFFSET)
+-#define LCDC_HEOCFG13_SCALEN (0x1 << 31)
+-
+-#define ATMEL_LCDC_HEOCFG14 0x0304
+-#define LCDC_HEOCFG14_CSCRY_OFFSET 0
+-#define LCDC_HEOCFG14_CSCRY (0x3ff << LCDC_HEOCFG14_CSCRY_OFFSET)
+-#define LCDC_HEOCFG14_CSCRU_OFFSET 10
+-#define LCDC_HEOCFG14_CSCRU (0x3ff << LCDC_HEOCFG14_CSCRU_OFFSET)
+-#define LCDC_HEOCFG14_CSCRV_OFFSET 20
+-#define LCDC_HEOCFG14_CSCRV (0x3ff << LCDC_HEOCFG14_CSCRV_OFFSET)
+-#define LCDC_HEOCFG14_CSCYOFF (0x1 << 30)
+-
+-#define ATMEL_LCDC_HEOCFG15 0x0308
+-#define LCDC_HEOCFG15_CSCGY_OFFSET 0
+-#define LCDC_HEOCFG15_CSCGY (0x3ff << LCDC_HEOCFG15_CSCGY_OFFSET)
+-#define LCDC_HEOCFG15_CSCGU_OFFSET 10
+-#define LCDC_HEOCFG15_CSCGU (0x3ff << LCDC_HEOCFG15_CSCGU_OFFSET)
+-#define LCDC_HEOCFG15_CSCGV_OFFSET 20
+-#define LCDC_HEOCFG15_CSCGV (0x3ff << LCDC_HEOCFG15_CSCGV_OFFSET)
+-#define LCDC_HEOCFG15_CSCUOFF (0x1 << 30)
+-
+-#define ATMEL_LCDC_HEOCFG16 0x030C
+-#define LCDC_HEOCFG16_CSCBY_OFFSET 0
+-#define LCDC_HEOCFG16_CSCBY (0x3ff << LCDC_HEOCFG16_CSCBY_OFFSET)
+-#define LCDC_HEOCFG16_CSCBU_OFFSET 10
+-#define LCDC_HEOCFG16_CSCBU (0x3ff << LCDC_HEOCFG16_CSCBU_OFFSET)
+-#define LCDC_HEOCFG16_CSCBV_OFFSET 20
+-#define LCDC_HEOCFG16_CSCBV (0x3ff << LCDC_HEOCFG16_CSCBV_OFFSET)
+-#define LCDC_HEOCFG16_CSCVOFF (0x1 << 30)
+-
+-#define ATMEL_LCDC_HCRCHER 0x0340
+-#define LCDC_HCRCHER_CHEN (0x1 << 0)
+-#define LCDC_HCRCHER_UPDATEEN (0x1 << 1)
+-#define LCDC_HCRCHER_A2QEN (0x1 << 2)
+-
+-#define ATMEL_LCDC_HCRCHDR 0x0344
+-#define LCDC_HCRCHDR_CHDIS (0x1 << 0)
+-#define LCDC_HCRCHDR_CHRST (0x1 << 8)
+-
+-#define ATMEL_LCDC_HCRCHSR 0x0348
+-#define LCDC_HCRCHSR_CHSR (0x1 << 0)
+-#define LCDC_HCRCHSR_UPDATESR (0x1 << 1)
+-#define LCDC_HCRCHSR_A2QSR (0x1 << 2)
+-
+-#define ATMEL_LCDC_HCRIER 0x034C
+-#define LCDC_HCRIER_DMA (0x1 << 2)
+-#define LCDC_HCRIER_DSCR (0x1 << 3)
+-#define LCDC_HCRIER_ADD (0x1 << 4)
+-#define LCDC_HCRIER_DONE (0x1 << 5)
+-#define LCDC_HCRIER_OVR (0x1 << 6)
+-
+-#define ATMEL_LCDC_HCRIDR 0x0350
+-#define LCDC_HCRIDR_DMA (0x1 << 2)
+-#define LCDC_HCRIDR_DSCR (0x1 << 3)
+-#define LCDC_HCRIDR_ADD (0x1 << 4)
+-#define LCDC_HCRIDR_DONE (0x1 << 5)
+-#define LCDC_HCRIDR_OVR (0x1 << 6)
+-
+-#define ATMEL_LCDC_HCRIMR 0x0354
+-#define LCDC_HCRIMR_DMA (0x1 << 2)
+-#define LCDC_HCRIMR_DSCR (0x1 << 3)
+-#define LCDC_HCRIMR_ADD (0x1 << 4)
+-#define LCDC_HCRIMR_DONE (0x1 << 5)
+-#define LCDC_HCRIMR_OVR (0x1 << 6)
+-
+-#define ATMEL_LCDC_HCRISR 0x0358
+-#define LCDC_HCRISR_DMA (0x1 << 2)
+-#define LCDC_HCRISR_DSCR (0x1 << 3)
+-#define LCDC_HCRISR_ADD (0x1 << 4)
+-#define LCDC_HCRISR_DONE (0x1 << 5)
+-#define LCDC_HCRISR_OVR (0x1 << 6)
+-
+-#define ATMEL_LCDC_HCRHEAD 0x035C
+-
+-#define ATMEL_LCDC_HCRADDR 0x0360
+-
+-#define ATMEL_LCDC_HCRCTRL 0x0364
+-#define LCDC_HCRCTRL_DFETCH (0x1 << 0)
+-#define LCDC_HCRCTRL_LFETCH (0x1 << 1)
+-#define LCDC_HCRCTRL_DMAIEN (0x1 << 2)
+-#define LCDC_HCRCTRL_DSCRIEN (0x1 << 3)
+-#define LCDC_HCRCTRL_ADDIEN (0x1 << 4)
+-#define LCDC_HCRCTRL_DONEIEN (0x1 << 5)
+-
+-#define ATMEL_LCDC_HCRNEXT 0x0368
+-
+-#define ATMEL_LCDC_HCRCFG0 0x036C
+-#define LCDC_HCRCFG0_BLEN_OFFSET 4
+-#define LCDC_HCRCFG0_BLEN (0x3 << LCDC_HCRCFG0_BLEN_OFFSET)
+-#define LCDC_HCRCFG0_BLEN_AHB_SINGLE (0x0 << 4)
+-#define LCDC_HCRCFG0_BLEN_AHB_INCR4 (0x1 << 4)
+-#define LCDC_HCRCFG0_BLEN_AHB_INCR8 (0x2 << 4)
+-#define LCDC_HCRCFG0_BLEN_AHB_INCR16 (0x3 << 4)
+-#define LCDC_HCRCFG0_DLBO (0x1 << 8)
+-
+-#define ATMEL_LCDC_HCRCFG1 0x0370
+-#define LCDC_HCRCFG1_CLUTEN (0x1 << 0)
+-#define LCDC_HCRCFG1_RGBMODE_OFFSET 4
+-#define LCDC_HCRCFG1_RGBMODE (0xf << LCDC_HCRCFG1_RGBMODE_OFFSET)
+-#define LCDC_HCRCFG1_RGBMODE_12BPP_RGB_444 (0x0 << 4)
+-#define LCDC_HCRCFG1_RGBMODE_16BPP_ARGB_4444 (0x1 << 4)
+-#define LCDC_HCRCFG1_RGBMODE_16BPP_RGBA_4444 (0x2 << 4)
+-#define LCDC_HCRCFG1_RGBMODE_16BPP_RGB_565 (0x3 << 4)
+-#define LCDC_HCRCFG1_RGBMODE_16BPP_TRGB_1555 (0x4 << 4)
+-#define LCDC_HCRCFG1_RGBMODE_18BPP_RGB_666 (0x5 << 4)
+-#define LCDC_HCRCFG1_RGBMODE_18BPP_RGB_666_PACKED (0x6 << 4)
+-#define LCDC_HCRCFG1_RGBMODE_19BPP_TRGB_1666 (0x7 << 4)
+-#define LCDC_HCRCFG1_RGBMODE_19BPP_TRGB_PACKED (0x8 << 4)
+-#define LCDC_HCRCFG1_RGBMODE_24BPP_RGB_888 (0x9 << 4)
+-#define LCDC_HCRCFG1_RGBMODE_24BPP_RGB_888_PACKED (0xA << 4)
+-#define LCDC_HCRCFG1_RGBMODE_25BPP_TRGB_1888 (0xB << 4)
+-#define LCDC_HCRCFG1_RGBMODE_32BPP_ARGB_8888 (0xC << 4)
+-#define LCDC_HCRCFG1_RGBMODE_32BPP_RGBA_8888 (0xD << 4)
+-#define LCDC_HCRCFG1_CLUTMODE_OFFSET 8
+-#define LCDC_HCRCFG1_CLUTMODE (0x3 << LCDC_HCRCFG1_CLUTMODE_OFFSET)
+-#define LCDC_HCRCFG1_CLUTMODE_1BPP (0x0 << 8)
+-#define LCDC_HCRCFG1_CLUTMODE_2BPP (0x1 << 8)
+-#define LCDC_HCRCFG1_CLUTMODE_4BPP (0x2 << 8)
+-#define LCDC_HCRCFG1_CLUTMODE_8BPP (0x3 << 8)
+-
+-#define ATMEL_LCDC_HCRCFG2 0x0374
+-#define LCDC_HCRCFG2_XOFFSET_OFFSET 0
+-#define LCDC_HCRCFG2_XOFFSET (0x7ff << LCDC_HCRCFG2_XOFFSET_OFFSET)
+-#define LCDC_HCRCFG2_YOFFSET_OFFSET 16
+-#define LCDC_HCRCFG2_YOFFSET (0x7ff << LCDC_HCRCFG2_YOFFSET_OFFSET)
+-
+-#define ATMEL_LCDC_HCRCFG3 0x0378
+-#define LCDC_HCRCFG3_XSIZE_OFFSET 0
+-#define LCDC_HCRCFG3_XSIZE (0x7f << LCDC_HCRCFG3_XSIZE_OFFSET)
+-#define LCDC_HCRCFG3_YSIZE_OFFSET 16
+-#define LCDC_HCRCFG3_YSIZE (0x7f << LCDC_HCRCFG3_YSIZE_OFFSET)
+-
+-#define ATMEL_LCDC_HCRCFG4 0x037C
+-
+-#define ATMEL_LCDC_HCRCFG6 0x0384
+-#define LCDC_HCRCFG6_BDEF_OFFSET 0
+-#define LCDC_HCRCFG6_BDEF (0xff << LCDC_HCRCFG6_BDEF_OFFSET)
+-#define LCDC_HCRCFG6_GDEF_OFFSET 8
+-#define LCDC_HCRCFG6_GDEF (0xff << LCDC_HCRCFG6_GDEF_OFFSET)
+-#define LCDC_HCRCFG6_RDEF_OFFSET 16
+-#define LCDC_HCRCFG6_RDEF (0xff << LCDC_HCRCFG6_RDEF_OFFSET)
+-
+-#define ATMEL_LCDC_HCRCFG7 0x0388
+-#define LCDC_HCRCFG7_BKEY_OFFSET 0
+-#define LCDC_HCRCFG7_BKEY (0xff << LCDC_HCRCFG7_BKEY_OFFSET)
+-#define LCDC_HCRCFG7_GKEY_OFFSET 8
+-#define LCDC_HCRCFG7_GKEY (0xff << LCDC_HCRCFG7_GKEY_OFFSET)
+-#define LCDC_HCRCFG7_RKEY_OFFSET 16
+-#define LCDC_HCRCFG7_RKEY (0xff << LCDC_HCRCFG7_RKEY_OFFSET)
+-
+-#define ATMEL_LCDC_HCRCFG8 0x038C
+-#define LCDC_HCRCFG8_BMASK_OFFSET 0
+-#define LCDC_HCRCFG8_BMASK (0xff << LCDC_HCRCFG8_BMASK_OFFSET)
+-#define LCDC_HCRCFG8_GMASK_OFFSET 8
+-#define LCDC_HCRCFG8_GMASK (0xff << LCDC_HCRCFG8_GMASK_OFFSET)
+-#define LCDC_HCRCFG8_RMASK_OFFSET 16
+-#define LCDC_HCRCFG8_RMASK (0xff << LCDC_HCRCFG8_RMASK_OFFSET)
+-
+-#define ATMEL_LCDC_HCRCFG9 0x0390
+-#define LCDC_HCRCFG9_CRKEY (0x1 << 0)
+-#define LCDC_HCRCFG9_INV (0x1 << 1)
+-#define LCDC_HCRCFG9_ITER2BL (0x1 << 2)
+-#define LCDC_HCRCFG9_ITER (0x1 << 3)
+-#define LCDC_HCRCFG9_REVALPHA (0x1 << 4)
+-#define LCDC_HCRCFG9_GAEN (0x1 << 5)
+-#define LCDC_HCRCFG9_LAEN (0x1 << 6)
+-#define LCDC_HCRCFG9_OVR (0x1 << 7)
+-#define LCDC_HCRCFG9_DMA (0x1 << 8)
+-#define LCDC_HCRCFG9_REP (0x1 << 9)
+-#define LCDC_HCRCFG9_DSTKEY (0x1 << 10)
+-#define LCDC_HCRCFG9_GA_OFFSET 16
+-#define LCDC_HCRCFG9_GA_Msk (0xff << LCDC_HCRCFG9_GA_OFFSET)
+-
+-#define ATMEL_LCDC_BASECLUT 0x400
+-#define LCDC_BASECLUT_BCLUT_OFFSET 0
+-#define LCDC_BASECLUT_BCLUT (0xff << LCDC_BASECLUT_BCLUT_OFFSET)
+-#define LCDC_BASECLUT_GCLUT_OFFSET 8
+-#define LCDC_BASECLUT_GCLUT (0xff << LCDC_BASECLUT_GCLUT_OFFSET)
+-#define LCDC_BASECLUT_RCLUT_OFFSET 16
+-#define LCDC_BASECLUT_RCLUT (0xff << LCDC_BASECLUT_RCLUT_OFFSET)
+-
+-#define ATMEL_LCDC_OVR1CLUT 0x800
+-#define LCDC_OVR1CLUT_BCLUT_OFFSET 0
+-#define LCDC_OVR1CLUT_BCLUT (0xff << LCDC_OVR1CLUT_BCLUT_OFFSET)
+-#define LCDC_OVR1CLUT_GCLUT_OFFSET 8
+-#define LCDC_OVR1CLUT_GCLUT (0xff << LCDC_OVR1CLUT_GCLUT_OFFSET)
+-#define LCDC_OVR1CLUT_RCLUT_OFFSET 16
+-#define LCDC_OVR1CLUT_RCLUT (0xff << LCDC_OVR1CLUT_RCLUT_OFFSET)
+-#define LCDC_OVR1CLUT_ACLUT_OFFSET 24
+-#define LCDC_OVR1CLUT_ACLUT (0xff << LCDC_OVR1CLUT_ACLUT_OFFSET)
+-
+-#define ATMEL_LCDC_HEOCLUT 0x1000
+-#define LCDC_HEOCLUT_BCLUT_OFFSET 0
+-#define LCDC_HEOCLUT_BCLUT (0xff << LCDC_HEOCLUT_BCLUT_OFFSET)
+-#define LCDC_HEOCLUT_GCLUT_OFFSET 8
+-#define LCDC_HEOCLUT_GCLUT (0xff << LCDC_HEOCLUT_GCLUT_OFFSET)
+-#define LCDC_HEOCLUT_RCLUT_OFFSET 16
+-#define LCDC_HEOCLUT_RCLUT (0xff << LCDC_HEOCLUT_RCLUT_OFFSET)
+-#define LCDC_HEOCLUT_ACLUT_OFFSET 24
+-#define LCDC_HEOCLUT_ACLUT (0xff << LCDC_HEOCLUT_ACLUT_OFFSET)
+-
+-#define ATMEL_LCDC_HCRCLUT 0x1400
+-#define LCDC_HCRCLUT_BCLUT_OFFSET 0
+-#define LCDC_HCRCLUT_BCLUT (0xff << LCDC_HCRCLUT_BCLUT_OFFSET)
+-#define LCDC_HCRCLUT_GCLUT_OFFSET 8
+-#define LCDC_HCRCLUT_GCLUT (0xff << LCDC_HCRCLUT_GCLUT_OFFSET)
+-#define LCDC_HCRCLUT_RCLUT_OFFSET 16
+-#define LCDC_HCRCLUT_RCLUT (0xff << LCDC_HCRCLUT_RCLUT_OFFSET)
+-#define LCDC_HCRCLUT_ACLUT_OFFSET 24
+-#define LCDC_HCRCLUT_ACLUT (0xff << LCDC_HCRCLUT_ACLUT_OFFSET)
+-
+-/* Base layer CLUT */
-#define ATMEL_LCDC_LUT(n) (0x0400 + ((n)*4))
-+#define ATMEL_HLCDC_LUT 0x0400
-
-
+-
+-
-#endif /* __ATMEL_HLCDC4_H__ */
-+#endif /* __MACH_ATMEL_HLCDC4_H__ */
-diff --git a/arch/arm/mach-at91/include/mach/atmel_hlcdc_ovl.h b/arch/arm/mach-at91/include/mach/atmel_hlcdc_ovl.h
-new file mode 100644
-index 0000000..4416403
--- /dev/null
-+++ b/arch/arm/mach-at91/include/mach/atmel_hlcdc_ovl.h
-@@ -0,0 +1,156 @@
-+#ifndef __MACH_ATMEL_HLCD_OVL_H__
-+#define __MACH_ATMEL_HLCD_OVL_H__
-+
++++ b/arch/arm/mach-at91/include/mach/atmel_lcdc.h
+@@ -0,0 +1,177 @@
+/*
-+ * OVL has a seperate resource which already starts at offset 0x100.
-+ * So, these defines start at 0x0. The manual will list them at 0x100.
++ * Header file for AT91/AT32 LCD Controller
++ *
++ * Data structure and register user interface
++ *
++ * Copyright (C) 2007 Atmel Corporation
++ *
++ * This program is free software; you can redistribute it and/or modify
++ * it under the terms of the GNU General Public License as published by
++ * the Free Software Foundation; either version 2 of the License, or
++ * (at your option) any later version.
++ *
++ * This program is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
++ * GNU General Public License for more details.
++ *
++ * You should have received a copy of the GNU General Public 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 __MACH_ATMEL_LCDC_H__
++#define __MACH_ATMEL_LCDC_H__
+
-+#define ATMEL_LCDC_OVRCHER1 0x0000
-+#define LCDC_OVRCHER1_CHEN (0x1 << 0)
-+#define LCDC_OVRCHER1_UPDATEEN (0x1 << 1)
-+#define LCDC_OVRCHER1_A2QEN (0x1 << 2)
++#define ATMEL_LCDC_DMABADDR1 0x00
++#define ATMEL_LCDC_DMABADDR2 0x04
++#define ATMEL_LCDC_DMAFRMPT1 0x08
++#define ATMEL_LCDC_DMAFRMPT2 0x0c
++#define ATMEL_LCDC_DMAFRMADD1 0x10
++#define ATMEL_LCDC_DMAFRMADD2 0x14
+
-+#define ATMEL_LCDC_OVRCHDR1 0x0004
-+#define LCDC_OVRCHDR1_CHDIS (0x1 << 0)
-+#define LCDC_OVRCHDR1_CHRST (0x1 << 8)
++#define ATMEL_LCDC_DMAFRMCFG 0x18
++#define ATMEL_LCDC_FRSIZE (0x7fffff << 0)
++#define ATMEL_LCDC_BLENGTH_OFFSET 24
++#define ATMEL_LCDC_BLENGTH (0x7f << ATMEL_LCDC_BLENGTH_OFFSET)
+
-+#define ATMEL_LCDC_OVRCHSR1 0x0008
-+#define LCDC_OVRCHSR1_CHSR (0x1 << 0)
-+#define LCDC_OVRCHSR1_UPDATESR (0x1 << 1)
-+#define LCDC_OVRCHSR1_A2QSR (0x1 << 2)
++#define ATMEL_LCDC_DMACON 0x1c
++#define ATMEL_LCDC_DMAEN (0x1 << 0)
++#define ATMEL_LCDC_DMARST (0x1 << 1)
++#define ATMEL_LCDC_DMABUSY (0x1 << 2)
++#define ATMEL_LCDC_DMAUPDT (0x1 << 3)
++#define ATMEL_LCDC_DMA2DEN (0x1 << 4)
+
-+#define ATMEL_LCDC_OVRIER1 0x000C
-+#define LCDC_OVRIER1_DMA (0x1 << 2)
-+#define LCDC_OVRIER1_DSCR (0x1 << 3)
-+#define LCDC_OVRIER1_ADD (0x1 << 4)
-+#define LCDC_OVRIER1_DONE (0x1 << 5)
-+#define LCDC_OVRIER1_OVR (0x1 << 6)
++#define ATMEL_LCDC_DMA2DCFG 0x20
++#define ATMEL_LCDC_ADDRINC_OFFSET 0
++#define ATMEL_LCDC_ADDRINC (0xffff)
++#define ATMEL_LCDC_PIXELOFF_OFFSET 24
++#define ATMEL_LCDC_PIXELOFF (0x1f << 24)
+
-+#define ATMEL_LCDC_OVRIDR1 0x0010
-+#define LCDC_OVRIDR1_DMA (0x1 << 2)
-+#define LCDC_OVRIDR1_DSCR (0x1 << 3)
-+#define LCDC_OVRIDR1_ADD (0x1 << 4)
-+#define LCDC_OVRIDR1_DONE (0x1 << 5)
-+#define LCDC_OVRIDR1_OVR (0x1 << 6)
++#define ATMEL_LCDC_LCDCON1 0x0800
++#define ATMEL_LCDC_BYPASS (1 << 0)
++#define ATMEL_LCDC_CLKVAL_OFFSET 12
++#define ATMEL_LCDC_CLKVAL (0x1ff << ATMEL_LCDC_CLKVAL_OFFSET)
++#define ATMEL_LCDC_LINCNT (0x7ff << 21)
+
-+#define ATMEL_LCDC_OVRIMR1 0x0014
-+#define LCDC_OVRIMR1_DMA (0x1 << 2)
-+#define LCDC_OVRIMR1_DSCR (0x1 << 3)
-+#define LCDC_OVRIMR1_ADD (0x1 << 4)
-+#define LCDC_OVRIMR1_DONE (0x1 << 5)
-+#define LCDC_OVRIMR1_OVR (0x1 << 6)
++#define ATMEL_LCDC_LCDCON2 0x0804
++#define ATMEL_LCDC_DISTYPE (3 << 0)
++#define ATMEL_LCDC_DISTYPE_STNMONO (0 << 0)
++#define ATMEL_LCDC_DISTYPE_STNCOLOR (1 << 0)
++#define ATMEL_LCDC_DISTYPE_TFT (2 << 0)
++#define ATMEL_LCDC_SCANMOD (1 << 2)
++#define ATMEL_LCDC_SCANMOD_SINGLE (0 << 2)
++#define ATMEL_LCDC_SCANMOD_DUAL (1 << 2)
++#define ATMEL_LCDC_IFWIDTH (3 << 3)
++#define ATMEL_LCDC_IFWIDTH_4 (0 << 3)
++#define ATMEL_LCDC_IFWIDTH_8 (1 << 3)
++#define ATMEL_LCDC_IFWIDTH_16 (2 << 3)
++#define ATMEL_LCDC_PIXELSIZE (7 << 5)
++#define ATMEL_LCDC_PIXELSIZE_1 (0 << 5)
++#define ATMEL_LCDC_PIXELSIZE_2 (1 << 5)
++#define ATMEL_LCDC_PIXELSIZE_4 (2 << 5)
++#define ATMEL_LCDC_PIXELSIZE_8 (3 << 5)
++#define ATMEL_LCDC_PIXELSIZE_16 (4 << 5)
++#define ATMEL_LCDC_PIXELSIZE_24 (5 << 5)
++#define ATMEL_LCDC_PIXELSIZE_32 (6 << 5)
++#define ATMEL_LCDC_INVVD (1 << 8)
++#define ATMEL_LCDC_INVVD_NORMAL (0 << 8)
++#define ATMEL_LCDC_INVVD_INVERTED (1 << 8)
++#define ATMEL_LCDC_INVFRAME (1 << 9 )
++#define ATMEL_LCDC_INVFRAME_NORMAL (0 << 9)
++#define ATMEL_LCDC_INVFRAME_INVERTED (1 << 9)
++#define ATMEL_LCDC_INVLINE (1 << 10)
++#define ATMEL_LCDC_INVLINE_NORMAL (0 << 10)
++#define ATMEL_LCDC_INVLINE_INVERTED (1 << 10)
++#define ATMEL_LCDC_INVCLK (1 << 11)
++#define ATMEL_LCDC_INVCLK_NORMAL (0 << 11)
++#define ATMEL_LCDC_INVCLK_INVERTED (1 << 11)
++#define ATMEL_LCDC_INVDVAL (1 << 12)
++#define ATMEL_LCDC_INVDVAL_NORMAL (0 << 12)
++#define ATMEL_LCDC_INVDVAL_INVERTED (1 << 12)
++#define ATMEL_LCDC_CLKMOD (1 << 15)
++#define ATMEL_LCDC_CLKMOD_ACTIVEDISPLAY (0 << 15)
++#define ATMEL_LCDC_CLKMOD_ALWAYSACTIVE (1 << 15)
++#define ATMEL_LCDC_MEMOR (1 << 31)
++#define ATMEL_LCDC_MEMOR_BIG (0 << 31)
++#define ATMEL_LCDC_MEMOR_LITTLE (1 << 31)
+
-+#define ATMEL_LCDC_OVRISR1 0x0018
-+#define LCDC_OVRISR1_DMA (0x1 << 2)
-+#define LCDC_OVRISR1_DSCR (0x1 << 3)
-+#define LCDC_OVRISR1_ADD (0x1 << 4)
-+#define LCDC_OVRISR1_DONE (0x1 << 5)
-+#define LCDC_OVRISR1_OVR (0x1 << 6)
++#define ATMEL_LCDC_TIM1 0x0808
++#define ATMEL_LCDC_VFP (0xffU << 0)
++#define ATMEL_LCDC_VBP_OFFSET 8
++#define ATMEL_LCDC_VBP (0xffU << ATMEL_LCDC_VBP_OFFSET)
++#define ATMEL_LCDC_VPW_OFFSET 16
++#define ATMEL_LCDC_VPW (0x3fU << ATMEL_LCDC_VPW_OFFSET)
++#define ATMEL_LCDC_VHDLY_OFFSET 24
++#define ATMEL_LCDC_VHDLY (0xfU << ATMEL_LCDC_VHDLY_OFFSET)
+
-+#define ATMEL_LCDC_OVRHEAD1 0x001C
++#define ATMEL_LCDC_TIM2 0x080c
++#define ATMEL_LCDC_HBP (0xffU << 0)
++#define ATMEL_LCDC_HPW_OFFSET 8
++#define ATMEL_LCDC_HPW (0x3fU << ATMEL_LCDC_HPW_OFFSET)
++#define ATMEL_LCDC_HFP_OFFSET 21
++#define ATMEL_LCDC_HFP (0x7ffU << ATMEL_LCDC_HFP_OFFSET)
+
-+#define ATMEL_LCDC_OVRADDR1 0x0020
++#define ATMEL_LCDC_LCDFRMCFG 0x0810
++#define ATMEL_LCDC_LINEVAL (0x7ff << 0)
++#define ATMEL_LCDC_HOZVAL_OFFSET 21
++#define ATMEL_LCDC_HOZVAL (0x7ff << ATMEL_LCDC_HOZVAL_OFFSET)
+
-+#define ATMEL_LCDC_OVRCTRL1 0x0024
-+#define LCDC_OVRCTRL1_DFETCH (0x1 << 0)
-+#define LCDC_OVRCTRL1_LFETCH (0x1 << 1)
-+#define LCDC_OVRCTRL1_DMAIEN (0x1 << 2)
-+#define LCDC_OVRCTRL1_DSCRIEN (0x1 << 3)
-+#define LCDC_OVRCTRL1_ADDIEN (0x1 << 4)
-+#define LCDC_OVRCTRL1_DONEIEN (0x1 << 5)
++#define ATMEL_LCDC_FIFO 0x0814
++#define ATMEL_LCDC_FIFOTH (0xffff)
+
-+#define ATMEL_LCDC_OVRNEXT1 0x0028
++#define ATMEL_LCDC_MVAL 0x0818
+
-+#define ATMEL_LCDC_OVR1CFG0 0x002C
-+#define LCDC_OVR1CFG0_BLEN_OFFSET 4
-+#define LCDC_OVR1CFG0_BLEN (0x3 << LCDC_OVR1CFG0_BLEN_OFFSET)
-+#define LCDC_OVR1CFG0_BLEN_AHB_SINGLE (0x0 << 4)
-+#define LCDC_OVR1CFG0_BLEN_AHB_INCR4 (0x1 << 4)
-+#define LCDC_OVR1CFG0_BLEN_AHB_INCR8 (0x2 << 4)
-+#define LCDC_OVR1CFG0_BLEN_AHB_INCR16 (0x3 << 4)
-+#define LCDC_OVR1CFG0_DLBO (0x1 << 8)
-+#define LCDC_OVR1CFG0_ROTDIS (0x1 << 12)
-+#define LCDC_OVR1CFG0_LOCKDIS (0x1 << 13)
++#define ATMEL_LCDC_DP1_2 0x081c
++#define ATMEL_LCDC_DP4_7 0x0820
++#define ATMEL_LCDC_DP3_5 0x0824
++#define ATMEL_LCDC_DP2_3 0x0828
++#define ATMEL_LCDC_DP5_7 0x082c
++#define ATMEL_LCDC_DP3_4 0x0830
++#define ATMEL_LCDC_DP4_5 0x0834
++#define ATMEL_LCDC_DP6_7 0x0838
++#define ATMEL_LCDC_DP1_2_VAL (0xff)
++#define ATMEL_LCDC_DP4_7_VAL (0xfffffff)
++#define ATMEL_LCDC_DP3_5_VAL (0xfffff)
++#define ATMEL_LCDC_DP2_3_VAL (0xfff)
++#define ATMEL_LCDC_DP5_7_VAL (0xfffffff)
++#define ATMEL_LCDC_DP3_4_VAL (0xffff)
++#define ATMEL_LCDC_DP4_5_VAL (0xfffff)
++#define ATMEL_LCDC_DP6_7_VAL (0xfffffff)
+
-+#define ATMEL_LCDC_OVR1CFG1 0x0030
-+#define LCDC_OVR1CFG1_CLUTEN (0x1 << 0)
-+#define LCDC_OVR1CFG1_RGBMODE_OFFSET 4
-+#define LCDC_OVR1CFG1_RGBMODE (0xf << LCDC_OVR1CFG1_RGBMODE_OFFSET)
-+#define LCDC_OVR1CFG1_RGBMODE_12BPP_RGB_444 (0x0 << 4)
-+#define LCDC_OVR1CFG1_RGBMODE_16BPP_ARGB_4444 (0x1 << 4)
-+#define LCDC_OVR1CFG1_RGBMODE_16BPP_RGBA_4444 (0x2 << 4)
-+#define LCDC_OVR1CFG1_RGBMODE_16BPP_RGB_565 (0x3 << 4)
-+#define LCDC_OVR1CFG1_RGBMODE_16BPP_TRGB_1555 (0x4 << 4)
-+#define LCDC_OVR1CFG1_RGBMODE_18BPP_RGB_666 (0x5 << 4)
-+#define LCDC_OVR1CFG1_RGBMODE_18BPP_RGB_666_PACKED (0x6 << 4)
-+#define LCDC_OVR1CFG1_RGBMODE_19BPP_TRGB_1666 (0x7 << 4)
-+#define LCDC_OVR1CFG1_RGBMODE_19BPP_TRGB_PACKED (0x8 << 4)
-+#define LCDC_OVR1CFG1_RGBMODE_24BPP_RGB_888 (0x9 << 4)
-+#define LCDC_OVR1CFG1_RGBMODE_24BPP_RGB_888_PACKED (0xA << 4)
-+#define LCDC_OVR1CFG1_RGBMODE_25BPP_TRGB_1888 (0xB << 4)
-+#define LCDC_OVR1CFG1_RGBMODE_32BPP_ARGB_8888 (0xC << 4)
-+#define LCDC_OVR1CFG1_RGBMODE_32BPP_RGBA_8888 (0xD << 4)
-+#define LCDC_OVR1CFG1_CLUTMODE_OFFSET 8
-+#define LCDC_OVR1CFG1_CLUTMODE (0x3 << LCDC_OVR1CFG1_CLUTMODE_OFFSET)
-+#define LCDC_OVR1CFG1_CLUTMODE_1BPP (0x0 << 8)
-+#define LCDC_OVR1CFG1_CLUTMODE_2BPP (0x1 << 8)
-+#define LCDC_OVR1CFG1_CLUTMODE_4BPP (0x2 << 8)
-+#define LCDC_OVR1CFG1_CLUTMODE_8BPP (0x3 << 8)
++#define ATMEL_LCDC_PWRCON 0x083c
++#define ATMEL_LCDC_PWR (1 << 0)
++#define ATMEL_LCDC_GUARDT_OFFSET 1
++#define ATMEL_LCDC_GUARDT (0x7f << ATMEL_LCDC_GUARDT_OFFSET)
++#define ATMEL_LCDC_BUSY (1 << 31)
+
-+#define ATMEL_LCDC_OVR1CFG2 0x0034
-+#define LCDC_OVR1CFG2_XOFFSET_OFFSET 0
-+#define LCDC_OVR1CFG2_XOFFSET (0x7ff << LCDC_OVR1CFG2_XOFFSET_OFFSET)
-+#define LCDC_OVR1CFG2_YOFFSET_OFFSET 16
-+#define LCDC_OVR1CFG2_YOFFSET (0x7ff << LCDC_OVR1CFG2_YOFFSET_OFFSET)
++#define ATMEL_LCDC_CONTRAST_CTR 0x0840
++#define ATMEL_LCDC_PS (3 << 0)
++#define ATMEL_LCDC_PS_DIV1 (0 << 0)
++#define ATMEL_LCDC_PS_DIV2 (1 << 0)
++#define ATMEL_LCDC_PS_DIV4 (2 << 0)
++#define ATMEL_LCDC_PS_DIV8 (3 << 0)
++#define ATMEL_LCDC_POL (1 << 2)
++#define ATMEL_LCDC_POL_NEGATIVE (0 << 2)
++#define ATMEL_LCDC_POL_POSITIVE (1 << 2)
++#define ATMEL_LCDC_ENA (1 << 3)
++#define ATMEL_LCDC_ENA_PWMDISABLE (0 << 3)
++#define ATMEL_LCDC_ENA_PWMENABLE (1 << 3)
+
-+#define ATMEL_LCDC_OVR1CFG3 0x0038
-+#define LCDC_OVR1CFG3_XSIZE_OFFSET 0
-+#define LCDC_OVR1CFG3_XSIZE (0x7ff << LCDC_OVR1CFG3_XSIZE_OFFSET)
-+#define LCDC_OVR1CFG3_YSIZE_OFFSET 16
-+#define LCDC_OVR1CFG3_YSIZE (0x7ff << LCDC_OVR1CFG3_YSIZE_OFFSET)
-+
-+#define ATMEL_LCDC_OVR1CFG4 0x003C
++#define ATMEL_LCDC_CONTRAST_VAL 0x0844
++#define ATMEL_LCDC_CVAL (0xff)
+
-+#define ATMEL_LCDC_OVR1CFG5 0x0040
++#define ATMEL_LCDC_IER 0x0848
++#define ATMEL_LCDC_IDR 0x084c
++#define ATMEL_LCDC_IMR 0x0850
++#define ATMEL_LCDC_ISR 0x0854
++#define ATMEL_LCDC_ICR 0x0858
++#define ATMEL_LCDC_LNI (1 << 0)
++#define ATMEL_LCDC_LSTLNI (1 << 1)
++#define ATMEL_LCDC_EOFI (1 << 2)
++#define ATMEL_LCDC_UFLWI (1 << 4)
++#define ATMEL_LCDC_OWRI (1 << 5)
++#define ATMEL_LCDC_MERI (1 << 6)
+
-+#define ATMEL_LCDC_OVR1CFG6 0x0044
-+#define LCDC_OVR1CFG6_BDEF_OFFSET 0
-+#define LCDC_OVR1CFG6_BDEF (0xff << LCDC_OVR1CFG6_BDEF_OFFSET)
-+#define LCDC_OVR1CFG6_GDEF_OFFSET 8
-+#define LCDC_OVR1CFG6_GDEF (0xff << LCDC_OVR1CFG6_GDEF_OFFSET)
-+#define LCDC_OVR1CFG6_RDEF_OFFSET 16
-+#define LCDC_OVR1CFG6_RDEF (0xff << LCDC_OVR1CFG6_RDEF_OFFSET)
-+
-+#define ATMEL_LCDC_OVR1CFG7 0x0048
-+#define LCDC_OVR1CFG7_BKEY_OFFSET 0
-+#define LCDC_OVR1CFG7_BKEY (0xff << LCDC_OVR1CFG7_BKEY_OFFSET)
-+#define LCDC_OVR1CFG7_GKEY_OFFSET 8
-+#define LCDC_OVR1CFG7_GKEY (0xff << LCDC_OVR1CFG7_GKEY_OFFST)
-+#define LCDC_OVR1CFG7_RKEY_OFFSET 16
-+#define LCDC_OVR1CFG7_RKEY (0xff << LCDC_OVR1CFG7_RKEY_OFFSET)
-+
-+#define ATMEL_LCDC_OVR1CFG8 0x004C
-+#define LCDC_OVR1CFG8_BMASK_OFFSET 0
-+#define LCDC_OVR1CFG8_BMASK (0xff << LCDC_OVR1CFG8_BMASK_OFFSET)
-+#define LCDC_OVR1CFG8_GMASK_OFFSET 8
-+#define LCDC_OVR1CFG8_GMASK (0xff << LCDC_OVR1CFG8_GMASK_OFFSET)
-+#define LCDC_OVR1CFG8_RMASK_OFFSET 16
-+#define LCDC_OVR1CFG8_RMASK (0xff << LCDC_OVR1CFG8_RMASK_OFFSET)
-+
-+#define ATMEL_LCDC_OVR1CFG9 0x0050
-+#define LCDC_OVR1CFG9_CRKEY (0x1 << 0)
-+#define LCDC_OVR1CFG9_INV (0x1 << 1)
-+#define LCDC_OVR1CFG9_ITER2BL (0x1 << 2)
-+#define LCDC_OVR1CFG9_ITER (0x1 << 3)
-+#define LCDC_OVR1CFG9_REVALPHA (0x1 << 4)
-+#define LCDC_OVR1CFG9_GAEN (0x1 << 5)
-+#define LCDC_OVR1CFG9_LAEN (0x1 << 6)
-+#define LCDC_OVR1CFG9_OVR (0x1 << 7)
-+#define LCDC_OVR1CFG9_DMA (0x1 << 8)
-+#define LCDC_OVR1CFG9_REP (0x1 << 9)
-+#define LCDC_OVR1CFG9_DSTKEY (0x1 << 10)
-+#define LCDC_OVR1CFG9_GA_OFFSET 16
-+#define LCDC_OVR1CFG9_GA (0xff << LCDC_OVR1CFG9_GA_OFFSET)
++#define ATMEL_LCDC_LUT 0x0c00
+
-+#endif /* __MACH_ATMEL_HLCD_OVL_H__ */
-diff --git a/include/video/atmel_lcdc.h b/arch/arm/mach-at91/include/mach/atmel_lcdc.h
-similarity index 73%
-rename from include/video/atmel_lcdc.h
-rename to arch/arm/mach-at91/include/mach/atmel_lcdc.h
-index 6031b5a..248fed3 100644
++#endif /* __MACH_ATMEL_LCDC_H__ */
+--- a/drivers/video/atmel_lcdfb.c
++++ b/drivers/video/atmel_lcdfb.c
+@@ -19,8 +19,9 @@
+
+ #include <mach/board.h>
+ #include <mach/cpu.h>
++#include <mach/atmel_lcdc.h>
+
+-#include <video/atmel_lcdc.h>
++#include <video/atmel_lcdfb.h>
+
+ /* configurable parameters */
+ #define ATMEL_LCDC_CVAL_DEFAULT 0xc8
+--- a/drivers/video/atmel_lcdfb_core.c
++++ b/drivers/video/atmel_lcdfb_core.c
+@@ -22,7 +22,7 @@
+ #include <mach/cpu.h>
+ #include <mach/gpio.h>
+
+-#include <video/atmel_lcdc.h>
++#include <video/atmel_lcdfb.h>
+
+ /* configurable parameters */
+ #define ATMEL_LCDC_CVAL_DEFAULT 0xc8
--- a/include/video/atmel_lcdc.h
-+++ b/arch/arm/mach-at91/include/mach/atmel_lcdc.h
-@@ -19,79 +19,8 @@
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
++++ /dev/null
+@@ -1,249 +0,0 @@
+-/*
+- * Header file for AT91/AT32 LCD Controller
+- *
+- * Data structure and register user interface
+- *
+- * Copyright (C) 2007 Atmel Corporation
+- *
+- * This program is free software; you can redistribute it and/or modify
+- * it under the terms of the GNU General Public License as published by
+- * the Free Software Foundation; either version 2 of the License, or
+- * (at your option) any later version.
+- *
+- * This program is distributed in the hope that it will be useful,
+- * but WITHOUT ANY WARRANTY; without even the implied warranty of
+- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+- * GNU General Public License for more details.
+- *
+- * You should have received a copy of the GNU General Public 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 __ATMEL_LCDC_H__
-#define __ATMEL_LCDC_H__
-
@@ -650,52 +2246,165 @@ index 6031b5a..248fed3 100644
- void (*atmel_lcdfb_power_control)(int on);
- struct fb_monspecs *default_monspecs;
- u32 pseudo_palette[16];
+- bool have_intensity_bit;
-};
-
-#define lcdc_readl(sinfo, reg) __raw_readl((sinfo)->mmio+(reg))
-#define lcdc_writel(sinfo, reg, val) __raw_writel((val), (sinfo)->mmio+(reg))
-+#ifndef __MACH_ATMEL_LCDC_H__
-+#define __MACH_ATMEL_LCDC_H__
-
- #define ATMEL_LCDC_DMABADDR1 0x00
- #define ATMEL_LCDC_DMABADDR2 0x04
-@@ -245,4 +174,4 @@ struct atmel_lcdfb_info {
-
- #define ATMEL_LCDC_LUT 0x0c00
-
+-
+-#define ATMEL_LCDC_DMABADDR1 0x00
+-#define ATMEL_LCDC_DMABADDR2 0x04
+-#define ATMEL_LCDC_DMAFRMPT1 0x08
+-#define ATMEL_LCDC_DMAFRMPT2 0x0c
+-#define ATMEL_LCDC_DMAFRMADD1 0x10
+-#define ATMEL_LCDC_DMAFRMADD2 0x14
+-
+-#define ATMEL_LCDC_DMAFRMCFG 0x18
+-#define ATMEL_LCDC_FRSIZE (0x7fffff << 0)
+-#define ATMEL_LCDC_BLENGTH_OFFSET 24
+-#define ATMEL_LCDC_BLENGTH (0x7f << ATMEL_LCDC_BLENGTH_OFFSET)
+-
+-#define ATMEL_LCDC_DMACON 0x1c
+-#define ATMEL_LCDC_DMAEN (0x1 << 0)
+-#define ATMEL_LCDC_DMARST (0x1 << 1)
+-#define ATMEL_LCDC_DMABUSY (0x1 << 2)
+-#define ATMEL_LCDC_DMAUPDT (0x1 << 3)
+-#define ATMEL_LCDC_DMA2DEN (0x1 << 4)
+-
+-#define ATMEL_LCDC_DMA2DCFG 0x20
+-#define ATMEL_LCDC_ADDRINC_OFFSET 0
+-#define ATMEL_LCDC_ADDRINC (0xffff)
+-#define ATMEL_LCDC_PIXELOFF_OFFSET 24
+-#define ATMEL_LCDC_PIXELOFF (0x1f << 24)
+-
+-#define ATMEL_LCDC_LCDCON1 0x0800
+-#define ATMEL_LCDC_BYPASS (1 << 0)
+-#define ATMEL_LCDC_CLKVAL_OFFSET 12
+-#define ATMEL_LCDC_CLKVAL (0x1ff << ATMEL_LCDC_CLKVAL_OFFSET)
+-#define ATMEL_LCDC_LINCNT (0x7ff << 21)
+-
+-#define ATMEL_LCDC_LCDCON2 0x0804
+-#define ATMEL_LCDC_DISTYPE (3 << 0)
+-#define ATMEL_LCDC_DISTYPE_STNMONO (0 << 0)
+-#define ATMEL_LCDC_DISTYPE_STNCOLOR (1 << 0)
+-#define ATMEL_LCDC_DISTYPE_TFT (2 << 0)
+-#define ATMEL_LCDC_SCANMOD (1 << 2)
+-#define ATMEL_LCDC_SCANMOD_SINGLE (0 << 2)
+-#define ATMEL_LCDC_SCANMOD_DUAL (1 << 2)
+-#define ATMEL_LCDC_IFWIDTH (3 << 3)
+-#define ATMEL_LCDC_IFWIDTH_4 (0 << 3)
+-#define ATMEL_LCDC_IFWIDTH_8 (1 << 3)
+-#define ATMEL_LCDC_IFWIDTH_16 (2 << 3)
+-#define ATMEL_LCDC_PIXELSIZE (7 << 5)
+-#define ATMEL_LCDC_PIXELSIZE_1 (0 << 5)
+-#define ATMEL_LCDC_PIXELSIZE_2 (1 << 5)
+-#define ATMEL_LCDC_PIXELSIZE_4 (2 << 5)
+-#define ATMEL_LCDC_PIXELSIZE_8 (3 << 5)
+-#define ATMEL_LCDC_PIXELSIZE_16 (4 << 5)
+-#define ATMEL_LCDC_PIXELSIZE_24 (5 << 5)
+-#define ATMEL_LCDC_PIXELSIZE_32 (6 << 5)
+-#define ATMEL_LCDC_INVVD (1 << 8)
+-#define ATMEL_LCDC_INVVD_NORMAL (0 << 8)
+-#define ATMEL_LCDC_INVVD_INVERTED (1 << 8)
+-#define ATMEL_LCDC_INVFRAME (1 << 9 )
+-#define ATMEL_LCDC_INVFRAME_NORMAL (0 << 9)
+-#define ATMEL_LCDC_INVFRAME_INVERTED (1 << 9)
+-#define ATMEL_LCDC_INVLINE (1 << 10)
+-#define ATMEL_LCDC_INVLINE_NORMAL (0 << 10)
+-#define ATMEL_LCDC_INVLINE_INVERTED (1 << 10)
+-#define ATMEL_LCDC_INVCLK (1 << 11)
+-#define ATMEL_LCDC_INVCLK_NORMAL (0 << 11)
+-#define ATMEL_LCDC_INVCLK_INVERTED (1 << 11)
+-#define ATMEL_LCDC_INVDVAL (1 << 12)
+-#define ATMEL_LCDC_INVDVAL_NORMAL (0 << 12)
+-#define ATMEL_LCDC_INVDVAL_INVERTED (1 << 12)
+-#define ATMEL_LCDC_CLKMOD (1 << 15)
+-#define ATMEL_LCDC_CLKMOD_ACTIVEDISPLAY (0 << 15)
+-#define ATMEL_LCDC_CLKMOD_ALWAYSACTIVE (1 << 15)
+-#define ATMEL_LCDC_MEMOR (1 << 31)
+-#define ATMEL_LCDC_MEMOR_BIG (0 << 31)
+-#define ATMEL_LCDC_MEMOR_LITTLE (1 << 31)
+-
+-#define ATMEL_LCDC_TIM1 0x0808
+-#define ATMEL_LCDC_VFP (0xffU << 0)
+-#define ATMEL_LCDC_VBP_OFFSET 8
+-#define ATMEL_LCDC_VBP (0xffU << ATMEL_LCDC_VBP_OFFSET)
+-#define ATMEL_LCDC_VPW_OFFSET 16
+-#define ATMEL_LCDC_VPW (0x3fU << ATMEL_LCDC_VPW_OFFSET)
+-#define ATMEL_LCDC_VHDLY_OFFSET 24
+-#define ATMEL_LCDC_VHDLY (0xfU << ATMEL_LCDC_VHDLY_OFFSET)
+-
+-#define ATMEL_LCDC_TIM2 0x080c
+-#define ATMEL_LCDC_HBP (0xffU << 0)
+-#define ATMEL_LCDC_HPW_OFFSET 8
+-#define ATMEL_LCDC_HPW (0x3fU << ATMEL_LCDC_HPW_OFFSET)
+-#define ATMEL_LCDC_HFP_OFFSET 21
+-#define ATMEL_LCDC_HFP (0x7ffU << ATMEL_LCDC_HFP_OFFSET)
+-
+-#define ATMEL_LCDC_LCDFRMCFG 0x0810
+-#define ATMEL_LCDC_LINEVAL (0x7ff << 0)
+-#define ATMEL_LCDC_HOZVAL_OFFSET 21
+-#define ATMEL_LCDC_HOZVAL (0x7ff << ATMEL_LCDC_HOZVAL_OFFSET)
+-
+-#define ATMEL_LCDC_FIFO 0x0814
+-#define ATMEL_LCDC_FIFOTH (0xffff)
+-
+-#define ATMEL_LCDC_MVAL 0x0818
+-
+-#define ATMEL_LCDC_DP1_2 0x081c
+-#define ATMEL_LCDC_DP4_7 0x0820
+-#define ATMEL_LCDC_DP3_5 0x0824
+-#define ATMEL_LCDC_DP2_3 0x0828
+-#define ATMEL_LCDC_DP5_7 0x082c
+-#define ATMEL_LCDC_DP3_4 0x0830
+-#define ATMEL_LCDC_DP4_5 0x0834
+-#define ATMEL_LCDC_DP6_7 0x0838
+-#define ATMEL_LCDC_DP1_2_VAL (0xff)
+-#define ATMEL_LCDC_DP4_7_VAL (0xfffffff)
+-#define ATMEL_LCDC_DP3_5_VAL (0xfffff)
+-#define ATMEL_LCDC_DP2_3_VAL (0xfff)
+-#define ATMEL_LCDC_DP5_7_VAL (0xfffffff)
+-#define ATMEL_LCDC_DP3_4_VAL (0xffff)
+-#define ATMEL_LCDC_DP4_5_VAL (0xfffff)
+-#define ATMEL_LCDC_DP6_7_VAL (0xfffffff)
+-
+-#define ATMEL_LCDC_PWRCON 0x083c
+-#define ATMEL_LCDC_PWR (1 << 0)
+-#define ATMEL_LCDC_GUARDT_OFFSET 1
+-#define ATMEL_LCDC_GUARDT (0x7f << ATMEL_LCDC_GUARDT_OFFSET)
+-#define ATMEL_LCDC_BUSY (1 << 31)
+-
+-#define ATMEL_LCDC_CONTRAST_CTR 0x0840
+-#define ATMEL_LCDC_PS (3 << 0)
+-#define ATMEL_LCDC_PS_DIV1 (0 << 0)
+-#define ATMEL_LCDC_PS_DIV2 (1 << 0)
+-#define ATMEL_LCDC_PS_DIV4 (2 << 0)
+-#define ATMEL_LCDC_PS_DIV8 (3 << 0)
+-#define ATMEL_LCDC_POL (1 << 2)
+-#define ATMEL_LCDC_POL_NEGATIVE (0 << 2)
+-#define ATMEL_LCDC_POL_POSITIVE (1 << 2)
+-#define ATMEL_LCDC_ENA (1 << 3)
+-#define ATMEL_LCDC_ENA_PWMDISABLE (0 << 3)
+-#define ATMEL_LCDC_ENA_PWMENABLE (1 << 3)
+-
+-#define ATMEL_LCDC_CONTRAST_VAL 0x0844
+-#define ATMEL_LCDC_CVAL (0xff)
+-
+-#define ATMEL_LCDC_IER 0x0848
+-#define ATMEL_LCDC_IDR 0x084c
+-#define ATMEL_LCDC_IMR 0x0850
+-#define ATMEL_LCDC_ISR 0x0854
+-#define ATMEL_LCDC_ICR 0x0858
+-#define ATMEL_LCDC_LNI (1 << 0)
+-#define ATMEL_LCDC_LSTLNI (1 << 1)
+-#define ATMEL_LCDC_EOFI (1 << 2)
+-#define ATMEL_LCDC_UFLWI (1 << 4)
+-#define ATMEL_LCDC_OWRI (1 << 5)
+-#define ATMEL_LCDC_MERI (1 << 6)
+-
+-#define ATMEL_LCDC_LUT 0x0c00
+-
-#endif /* __ATMEL_LCDC_H__ */
-+#endif /* __MACH_ATMEL_LCDC_H__ */
-diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
-index 7a48e9c..8d7992c 100644
---- a/drivers/video/atmel_lcdfb.c
-+++ b/drivers/video/atmel_lcdfb.c
-@@ -19,8 +19,9 @@
-
- #include <mach/board.h>
- #include <mach/cpu.h>
-+#include <mach/atmel_lcdc.h>
-
--#include <video/atmel_lcdc.h>
-+#include <video/atmel_lcdfb.h>
-
- /* configurable parameters */
- #define ATMEL_LCDC_CVAL_DEFAULT 0xc8
-diff --git a/drivers/video/atmel_lcdfb_core.c b/drivers/video/atmel_lcdfb_core.c
-index 20a4e4f..060d41f 100644
---- a/drivers/video/atmel_lcdfb_core.c
-+++ b/drivers/video/atmel_lcdfb_core.c
-@@ -22,7 +22,7 @@
- #include <mach/cpu.h>
- #include <mach/gpio.h>
-
--#include <video/atmel_lcdc.h>
-+#include <video/atmel_lcdfb.h>
-
- /* configurable parameters */
- #define ATMEL_LCDC_CVAL_DEFAULT 0xc8
-diff --git a/include/video/atmel_lcdfb.h b/include/video/atmel_lcdfb.h
-new file mode 100644
-index 0000000..3a0dfc7
--- /dev/null
+++ b/include/video/atmel_lcdfb.h
@@ -0,0 +1,100 @@
@@ -799,6 +2508,3 @@ index 0000000..3a0dfc7
+#define lcdc_writel(sinfo, reg, val) __raw_writel((val), (sinfo)->mmio+(reg))
+
+#endif /* __ATMEL_LCDC_H__ */
---
-1.8.0.197.g5a90748
-
diff --git a/patches.at91/0215-tty-atmel_serial-add-pinctrl-support.patch b/patches.at91/0215-tty-atmel_serial-add-pinctrl-support.patch
index dc8c7ad5589..04e2eab0c05 100644
--- a/patches.at91/0215-tty-atmel_serial-add-pinctrl-support.patch
+++ b/patches.at91/0215-tty-atmel_serial-add-pinctrl-support.patch
@@ -8,11 +8,9 @@ Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
- drivers/tty/serial/atmel_serial.c | 8 ++++++++
+ drivers/tty/serial/atmel_serial.c | 8 ++++++++
1 file changed, 8 insertions(+)
-diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
-index 3d7e1ee..65f891b 100644
--- a/drivers/tty/serial/atmel_serial.c
+++ b/drivers/tty/serial/atmel_serial.c
@@ -39,6 +39,7 @@
@@ -23,7 +21,7 @@ index 3d7e1ee..65f891b 100644
#include <asm/io.h>
#include <asm/ioctls.h>
-@@ -1773,6 +1774,7 @@ static int __devinit atmel_serial_probe(struct platform_device *pdev)
+@@ -1773,6 +1774,7 @@ static int __devinit atmel_serial_probe(
struct atmel_uart_data *pdata = pdev->dev.platform_data;
void *data;
int ret = -ENODEV;
@@ -31,7 +29,7 @@ index 3d7e1ee..65f891b 100644
BUILD_BUG_ON(ATMEL_SERIAL_RINGSIZE & (ATMEL_SERIAL_RINGSIZE - 1));
-@@ -1805,6 +1807,12 @@ static int __devinit atmel_serial_probe(struct platform_device *pdev)
+@@ -1804,6 +1806,12 @@ static int __devinit atmel_serial_probe(
atmel_init_port(port, pdev);
@@ -44,6 +42,3 @@ index 3d7e1ee..65f891b 100644
if (!atmel_use_dma_rx(&port->uart)) {
ret = -ENOMEM;
data = kmalloc(sizeof(struct atmel_uart_char)
---
-1.8.0.197.g5a90748
-
diff --git a/patches.dma-mapping/cma-fix-migration-mode.patch b/patches.dma-mapping/cma-fix-migration-mode.patch
index 620f5cb3a45..d5b752e2da9 100644
--- a/patches.dma-mapping/cma-fix-migration-mode.patch
+++ b/patches.dma-mapping/cma-fix-migration-mode.patch
@@ -22,13 +22,11 @@ Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
mm/page_alloc.c | 2 +-
- 1 files changed, 1 insertions(+), 1 deletions(-)
+ 1 file changed, 1 insertion(+), 1 deletion(-)
-diff --git a/mm/page_alloc.c b/mm/page_alloc.c
-index 22348ae..ed85c02 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
-@@ -5682,7 +5682,7 @@ static int __alloc_contig_migrate_range(unsigned long start, unsigned long end)
+@@ -5685,7 +5685,7 @@ static int __alloc_contig_migrate_range(
ret = migrate_pages(&cc.migratepages,
__alloc_contig_migrate_alloc,
@@ -37,6 +35,3 @@ index 22348ae..ed85c02 100644
}
putback_lru_pages(&cc.migratepages);
---
-1.7.5.4
-
diff --git a/patches.dma-mapping/mm-clean-up-__count_immobile_pages.patch b/patches.dma-mapping/mm-clean-up-__count_immobile_pages.patch
index 01775d794f3..eaf7cdee8b0 100644
--- a/patches.dma-mapping/mm-clean-up-__count_immobile_pages.patch
+++ b/patches.dma-mapping/mm-clean-up-__count_immobile_pages.patch
@@ -25,13 +25,11 @@ Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
---
mm/page_alloc.c | 34 ++++++++++++++++++----------------
- 1 files changed, 18 insertions(+), 16 deletions(-)
+ 1 file changed, 18 insertions(+), 16 deletions(-)
-diff --git a/mm/page_alloc.c b/mm/page_alloc.c
-index d993631..84f82e3 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
-@@ -5471,26 +5471,28 @@ void set_pageblock_flags_group(struct page *page, unsigned long flags,
+@@ -5474,26 +5474,28 @@ void set_pageblock_flags_group(struct pa
}
/*
@@ -69,7 +67,7 @@ index d993631..84f82e3 100644
pfn = page_to_pfn(page);
for (found = 0, iter = 0; iter < pageblock_nr_pages; iter++) {
-@@ -5521,9 +5523,9 @@ __count_immobile_pages(struct zone *zone, struct page *page, int count)
+@@ -5524,9 +5526,9 @@ __count_immobile_pages(struct zone *zone
* page at boot.
*/
if (found > count)
@@ -81,7 +79,7 @@ index d993631..84f82e3 100644
}
bool is_pageblock_removable_nolock(struct page *page)
-@@ -5547,7 +5549,7 @@ bool is_pageblock_removable_nolock(struct page *page)
+@@ -5550,7 +5552,7 @@ bool is_pageblock_removable_nolock(struc
zone->zone_start_pfn + zone->spanned_pages <= pfn)
return false;
@@ -90,7 +88,7 @@ index d993631..84f82e3 100644
}
int set_migratetype_isolate(struct page *page)
-@@ -5586,12 +5588,12 @@ int set_migratetype_isolate(struct page *page)
+@@ -5589,12 +5591,12 @@ int set_migratetype_isolate(struct page
* FIXME: Now, memory hotplug doesn't call shrink_slab() by itself.
* We just check MOVABLE pages.
*/
@@ -107,6 +105,3 @@ index d993631..84f82e3 100644
*/
out:
---
-1.7.5.4
-
diff --git a/patches.dma-mapping/mm-cma-don-t-replace-lowmem-pages-with-highmem.patch b/patches.dma-mapping/mm-cma-don-t-replace-lowmem-pages-with-highmem.patch
index e5025dd5758..95d6e85e6df 100644
--- a/patches.dma-mapping/mm-cma-don-t-replace-lowmem-pages-with-highmem.patch
+++ b/patches.dma-mapping/mm-cma-don-t-replace-lowmem-pages-with-highmem.patch
@@ -45,13 +45,11 @@ Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
mm/page_alloc.c | 7 ++++++-
- 1 files changed, 6 insertions(+), 1 deletions(-)
+ 1 file changed, 6 insertions(+), 1 deletion(-)
-diff --git a/mm/page_alloc.c b/mm/page_alloc.c
-index ed85c02..d993631 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
-@@ -5638,7 +5638,12 @@ static struct page *
+@@ -5641,7 +5641,12 @@ static struct page *
__alloc_contig_migrate_alloc(struct page *page, unsigned long private,
int **resultp)
{
@@ -65,6 +63,3 @@ index ed85c02..d993631 100644
}
/* [start, end) must belong to a single zone. */
---
-1.7.5.4
-
diff --git a/patches.dma-mapping/mm-factor-out-memory-isolate-functions.patch b/patches.dma-mapping/mm-factor-out-memory-isolate-functions.patch
index 4f583cafaf0..357850fa145 100644
--- a/patches.dma-mapping/mm-factor-out-memory-isolate-functions.patch
+++ b/patches.dma-mapping/mm-factor-out-memory-isolate-functions.patch
@@ -32,16 +32,14 @@ Conflicts:
Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
---
- drivers/base/Kconfig | 1 +
+ drivers/base/Kconfig | 1
include/linux/page-isolation.h | 13 ++++--
mm/Kconfig | 5 ++
mm/Makefile | 4 +-
- mm/page_alloc.c | 80 ++--------------------------------------
- mm/page_isolation.c | 71 +++++++++++++++++++++++++++++++++++
+ mm/page_alloc.c | 80 ++---------------------------------------
+ mm/page_isolation.c | 71 ++++++++++++++++++++++++++++++++++++
6 files changed, 93 insertions(+), 81 deletions(-)
-diff --git a/drivers/base/Kconfig b/drivers/base/Kconfig
-index 9b21469..08b4c52 100644
--- a/drivers/base/Kconfig
+++ b/drivers/base/Kconfig
@@ -196,6 +196,7 @@ config CMA
@@ -52,8 +50,6 @@ index 9b21469..08b4c52 100644
help
This enables the Contiguous Memory Allocator which allows drivers
to allocate big physically-contiguous blocks of memory for use with
-diff --git a/include/linux/page-isolation.h b/include/linux/page-isolation.h
-index 3bdcab3..105077a 100644
--- a/include/linux/page-isolation.h
+++ b/include/linux/page-isolation.h
@@ -1,6 +1,11 @@
@@ -77,7 +73,7 @@ index 3bdcab3..105077a 100644
start_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn,
unsigned migratetype);
-@@ -18,7 +23,7 @@ start_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn,
+@@ -18,7 +23,7 @@ start_isolate_page_range(unsigned long s
* Changes MIGRATE_ISOLATE to MIGRATE_MOVABLE.
* target range is [start_pfn, end_pfn)
*/
@@ -86,7 +82,7 @@ index 3bdcab3..105077a 100644
undo_isolate_page_range(unsigned long start_pfn, unsigned long end_pfn,
unsigned migratetype);
-@@ -30,8 +35,8 @@ int test_pages_isolated(unsigned long start_pfn, unsigned long end_pfn);
+@@ -30,8 +35,8 @@ int test_pages_isolated(unsigned long st
/*
* Internal functions. Changes pageblock's migrate type.
*/
@@ -97,8 +93,6 @@ index 3bdcab3..105077a 100644
#endif
-diff --git a/mm/Kconfig b/mm/Kconfig
-index 3922002..d85a959 100644
--- a/mm/Kconfig
+++ b/mm/Kconfig
@@ -140,9 +140,13 @@ config ARCH_DISCARD_MEMBLOCK
@@ -123,11 +117,9 @@ index 3922002..d85a959 100644
help
Enables code to recover from some memory failures on systems
with MCA recovery. This allows a system to continue running
-diff --git a/mm/Makefile b/mm/Makefile
-index 8aada89..31b0d59 100644
--- a/mm/Makefile
+++ b/mm/Makefile
-@@ -12,8 +12,9 @@ obj-y := filemap.o mempool.o oom_kill.o fadvise.o \
+@@ -12,8 +12,9 @@ obj-y := filemap.o mempool.o oom_kill.
maccess.o page_alloc.o page-writeback.o \
readahead.o swap.o truncate.o vmscan.o shmem.o \
prio_tree.o util.o mmzone.o vmstat.o backing-dev.o \
@@ -138,13 +130,11 @@ index 8aada89..31b0d59 100644
obj-y += init-mm.o
ifdef CONFIG_NO_BOOTMEM
-@@ -50,3 +51,4 @@ obj-$(CONFIG_HWPOISON_INJECT) += hwpoison-inject.o
+@@ -50,3 +51,4 @@ obj-$(CONFIG_HWPOISON_INJECT) += hwpoiso
obj-$(CONFIG_DEBUG_KMEMLEAK) += kmemleak.o
obj-$(CONFIG_DEBUG_KMEMLEAK_TEST) += kmemleak-test.o
obj-$(CONFIG_CLEANCACHE) += cleancache.o
+obj-$(CONFIG_MEMORY_ISOLATION) += page_isolation.o
-diff --git a/mm/page_alloc.c b/mm/page_alloc.c
-index 84f82e3..3b17dcd 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -51,7 +51,6 @@
@@ -164,7 +154,7 @@ index 84f82e3..3b17dcd 100644
{
if (unlikely(page_group_by_mobility_disabled))
-@@ -954,7 +953,7 @@ static int move_freepages(struct zone *zone,
+@@ -954,7 +953,7 @@ static int move_freepages(struct zone *z
return pages_moved;
}
@@ -173,7 +163,7 @@ index 84f82e3..3b17dcd 100644
int migratetype)
{
unsigned long start_pfn, end_pfn;
-@@ -5478,8 +5477,7 @@ void set_pageblock_flags_group(struct page *page, unsigned long flags,
+@@ -5481,8 +5480,7 @@ void set_pageblock_flags_group(struct pa
* MIGRATE_MOVABLE block might include unmovable pages. It means you can't
* expect this function should be exact.
*/
@@ -183,7 +173,7 @@ index 84f82e3..3b17dcd 100644
{
unsigned long pfn, iter, found;
int mt;
-@@ -5549,77 +5547,7 @@ bool is_pageblock_removable_nolock(struct page *page)
+@@ -5552,77 +5550,7 @@ bool is_pageblock_removable_nolock(struc
zone->zone_start_pfn + zone->spanned_pages <= pfn)
return false;
@@ -262,8 +252,6 @@ index 84f82e3..3b17dcd 100644
}
#ifdef CONFIG_CMA
-diff --git a/mm/page_isolation.c b/mm/page_isolation.c
-index c9f0477..fb482cf 100644
--- a/mm/page_isolation.c
+++ b/mm/page_isolation.c
@@ -5,8 +5,79 @@
@@ -346,6 +334,3 @@ index c9f0477..fb482cf 100644
static inline struct page *
__first_valid_page(unsigned long pfn, unsigned long nr_pages)
{
---
-1.7.5.4
-
diff --git a/patches.dma-mapping/mm-mmzone-migrate_cma-migration-type-added.patch b/patches.dma-mapping/mm-mmzone-migrate_cma-migration-type-added.patch
index 7ac2eeb0f80..ad571660293 100644
--- a/patches.dma-mapping/mm-mmzone-migrate_cma-migration-type-added.patch
+++ b/patches.dma-mapping/mm-mmzone-migrate_cma-migration-type-added.patch
@@ -42,19 +42,17 @@ Tested-by: Barry Song <Baohua.Song@csr.com>
Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
- include/linux/gfp.h | 3 ++
- include/linux/mmzone.h | 38 +++++++++++++++++++----
- mm/Kconfig | 2 +-
+ include/linux/gfp.h | 3 +
+ include/linux/mmzone.h | 38 +++++++++++++++++++-----
+ mm/Kconfig | 2 -
mm/compaction.c | 11 +++++--
- mm/page_alloc.c | 76 +++++++++++++++++++++++++++++++++++++----------
- mm/vmstat.c | 3 ++
+ mm/page_alloc.c | 76 ++++++++++++++++++++++++++++++++++++++-----------
+ mm/vmstat.c | 3 +
6 files changed, 106 insertions(+), 27 deletions(-)
-diff --git a/include/linux/gfp.h b/include/linux/gfp.h
-index 052a5b6..78d32a7 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
-@@ -397,6 +397,9 @@ static inline bool pm_suspended_storage(void)
+@@ -397,6 +397,9 @@ static inline bool pm_suspended_storage(
extern int alloc_contig_range(unsigned long start, unsigned long end);
extern void free_contig_range(unsigned long pfn, unsigned nr_pages);
@@ -64,8 +62,6 @@ index 052a5b6..78d32a7 100644
#endif
#endif /* __LINUX_GFP_H */
-diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
-index 5f6806b..7d2db87 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -35,13 +35,37 @@
@@ -113,8 +109,6 @@ index 5f6806b..7d2db87 100644
#define for_each_migratetype_order(order, type) \
for (order = 0; order < MAX_ORDER; order++) \
-diff --git a/mm/Kconfig b/mm/Kconfig
-index e338407..3922002 100644
--- a/mm/Kconfig
+++ b/mm/Kconfig
@@ -198,7 +198,7 @@ config COMPACTION
@@ -126,11 +120,9 @@ index e338407..3922002 100644
help
Allows the migration of the physical location of pages of processes
while the virtual addresses are not changed. This is useful in
-diff --git a/mm/compaction.c b/mm/compaction.c
-index dcb3865..eede981 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
-@@ -45,6 +45,11 @@ static void map_pages(struct list_head *list)
+@@ -45,6 +45,11 @@ static void map_pages(struct list_head *
}
}
@@ -142,7 +134,7 @@ index dcb3865..eede981 100644
/*
* Isolate free pages onto a private freelist. Caller must hold zone->lock.
* If @strict is true, will abort returning 0 on any invalid PFNs or non-free
-@@ -299,7 +304,7 @@ isolate_migratepages_range(struct zone *zone, struct compact_control *cc,
+@@ -299,7 +304,7 @@ isolate_migratepages_range(struct zone *
*/
pageblock_nr = low_pfn >> pageblock_order;
if (!cc->sync && last_pageblock_nr != pageblock_nr &&
@@ -151,7 +143,7 @@ index dcb3865..eede981 100644
low_pfn += pageblock_nr_pages;
low_pfn = ALIGN(low_pfn, pageblock_nr_pages) - 1;
last_pageblock_nr = pageblock_nr;
-@@ -367,8 +372,8 @@ static bool suitable_migration_target(struct page *page)
+@@ -367,8 +372,8 @@ static bool suitable_migration_target(st
if (PageBuddy(page) && page_order(page) >= pageblock_order)
return true;
@@ -162,11 +154,9 @@ index dcb3865..eede981 100644
return true;
/* Otherwise skip the block */
-diff --git a/mm/page_alloc.c b/mm/page_alloc.c
-index d6b580c..0869eb1 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
-@@ -750,6 +750,24 @@ void __meminit __free_pages_bootmem(struct page *page, unsigned int order)
+@@ -750,6 +750,24 @@ void __meminit __free_pages_bootmem(stru
__free_pages(page, order);
}
@@ -191,7 +181,7 @@ index d6b580c..0869eb1 100644
/*
* The order of subdivision here is critical for the IO subsystem.
-@@ -875,10 +893,15 @@ struct page *__rmqueue_smallest(struct zone *zone, unsigned int order,
+@@ -875,10 +893,15 @@ struct page *__rmqueue_smallest(struct z
* This array describes the order lists are fallen back to when
* the free lists for the desirable migrate type are depleted
*/
@@ -211,7 +201,7 @@ index d6b580c..0869eb1 100644
[MIGRATE_RESERVE] = { MIGRATE_RESERVE }, /* Never used */
[MIGRATE_ISOLATE] = { MIGRATE_RESERVE }, /* Never used */
};
-@@ -995,11 +1018,18 @@ __rmqueue_fallback(struct zone *zone, int order, int start_migratetype)
+@@ -995,11 +1018,18 @@ __rmqueue_fallback(struct zone *zone, in
* pages to the preferred allocation list. If falling
* back for a reclaimable kernel allocation, be more
* aggressive about taking ownership of free pages
@@ -234,7 +224,7 @@ index d6b580c..0869eb1 100644
pages = move_freepages_block(zone, page,
start_migratetype);
-@@ -1017,11 +1047,14 @@ __rmqueue_fallback(struct zone *zone, int order, int start_migratetype)
+@@ -1017,11 +1047,14 @@ __rmqueue_fallback(struct zone *zone, in
rmv_page_order(page);
/* Take ownership for orders >= pageblock_order */
@@ -251,7 +241,7 @@ index d6b580c..0869eb1 100644
trace_mm_page_alloc_extfrag(page, order, current_order,
start_migratetype, migratetype);
-@@ -1072,7 +1105,7 @@ static int rmqueue_bulk(struct zone *zone, unsigned int order,
+@@ -1072,7 +1105,7 @@ static int rmqueue_bulk(struct zone *zon
unsigned long count, struct list_head *list,
int migratetype, int cold)
{
@@ -260,7 +250,7 @@ index d6b580c..0869eb1 100644
spin_lock(&zone->lock);
for (i = 0; i < count; ++i) {
-@@ -1093,7 +1126,12 @@ static int rmqueue_bulk(struct zone *zone, unsigned int order,
+@@ -1093,7 +1126,12 @@ static int rmqueue_bulk(struct zone *zon
list_add(&page->lru, list);
else
list_add_tail(&page->lru, list);
@@ -289,7 +279,7 @@ index d6b580c..0869eb1 100644
}
return 1 << order;
-@@ -5414,14 +5456,16 @@ static int
+@@ -5417,14 +5459,16 @@ static int
__count_immobile_pages(struct zone *zone, struct page *page, int count)
{
unsigned long pfn, iter, found;
@@ -308,11 +298,9 @@ index d6b580c..0869eb1 100644
return true;
pfn = page_to_pfn(page);
-diff --git a/mm/vmstat.c b/mm/vmstat.c
-index 7db1b9b..0dad31dc 100644
--- a/mm/vmstat.c
+++ b/mm/vmstat.c
-@@ -613,6 +613,9 @@ static char * const migratetype_names[MIGRATE_TYPES] = {
+@@ -613,6 +613,9 @@ static char * const migratetype_names[MI
"Reclaimable",
"Movable",
"Reserve",
@@ -322,6 +310,3 @@ index 7db1b9b..0dad31dc 100644
"Isolate",
};
---
-1.7.5.4
-
diff --git a/patches.dma-mapping/mm-page_alloc-introduce-alloc_contig_range.patch b/patches.dma-mapping/mm-page_alloc-introduce-alloc_contig_range.patch
index e2e7c2063f1..6d5bd58ef6a 100644
--- a/patches.dma-mapping/mm-page_alloc-introduce-alloc_contig_range.patch
+++ b/patches.dma-mapping/mm-page_alloc-introduce-alloc_contig_range.patch
@@ -30,14 +30,12 @@ Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
include/linux/gfp.h | 8 ++
- mm/page_alloc.c | 188 +++++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 196 insertions(+), 0 deletions(-)
+ mm/page_alloc.c | 188 ++++++++++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 196 insertions(+)
-diff --git a/include/linux/gfp.h b/include/linux/gfp.h
-index 581e74b..052a5b6 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
-@@ -391,4 +391,12 @@ static inline bool pm_suspended_storage(void)
+@@ -391,4 +391,12 @@ static inline bool pm_suspended_storage(
}
#endif /* CONFIG_PM_SLEEP */
@@ -50,8 +48,6 @@ index 581e74b..052a5b6 100644
+#endif
+
#endif /* __LINUX_GFP_H */
-diff --git a/mm/page_alloc.c b/mm/page_alloc.c
-index 6fb46c1..2c38a30 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -57,6 +57,7 @@
@@ -62,7 +58,7 @@ index 6fb46c1..2c38a30 100644
#include <linux/page-debug-flags.h>
#include <asm/tlbflush.h>
-@@ -5550,6 +5551,193 @@ out:
+@@ -5553,6 +5554,193 @@ out:
spin_unlock_irqrestore(&zone->lock, flags);
}
@@ -256,6 +252,3 @@ index 6fb46c1..2c38a30 100644
#ifdef CONFIG_MEMORY_HOTREMOVE
/*
* All pages in the range must be isolated before calling this.
---
-1.7.5.4
-
diff --git a/patches.dma-mapping/mm-page_alloc-remove-trailing-whitespace.patch b/patches.dma-mapping/mm-page_alloc-remove-trailing-whitespace.patch
index c23dd26edf2..4be505a7f45 100644
--- a/patches.dma-mapping/mm-page_alloc-remove-trailing-whitespace.patch
+++ b/patches.dma-mapping/mm-page_alloc-remove-trailing-whitespace.patch
@@ -18,13 +18,11 @@ Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
mm/page_alloc.c | 14 +++++++-------
- 1 files changed, 7 insertions(+), 7 deletions(-)
+ 1 file changed, 7 insertions(+), 7 deletions(-)
-diff --git a/mm/page_alloc.c b/mm/page_alloc.c
-index 918330f..6fb46c1 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
-@@ -513,10 +513,10 @@ static inline int page_is_buddy(struct page *page, struct page *buddy,
+@@ -513,10 +513,10 @@ static inline int page_is_buddy(struct p
* free pages of length of (1 << order) and marked with _mapcount -2. Page's
* order is recorded in page_private(page) field.
* So when we are allocating or freeing one, we can derive the state of the
@@ -59,7 +57,7 @@ index 918330f..6fb46c1 100644
spin_lock(&zone->lock);
for (i = 0; i < count; ++i) {
struct page *page = __rmqueue(zone, order, migratetype);
-@@ -4301,7 +4301,7 @@ static void __paginginit free_area_init_core(struct pglist_data *pgdat,
+@@ -4304,7 +4304,7 @@ static void __paginginit free_area_init_
init_waitqueue_head(&pgdat->kswapd_wait);
pgdat->kswapd_max_order = 0;
pgdat_page_cgroup_init(pgdat);
@@ -68,6 +66,3 @@ index 918330f..6fb46c1 100644
for (j = 0; j < MAX_NR_ZONES; j++) {
struct zone *zone = pgdat->node_zones + j;
unsigned long size, realsize, memmap_pages;
---
-1.7.5.4
-
diff --git a/patches.dma-mapping/mm-page_isolation-migrate_cma-isolation-functions-added.patch b/patches.dma-mapping/mm-page_isolation-migrate_cma-isolation-functions-added.patch
index 42952170ac5..06bff2f7e9b 100644
--- a/patches.dma-mapping/mm-page_isolation-migrate_cma-isolation-functions-added.patch
+++ b/patches.dma-mapping/mm-page_isolation-migrate_cma-isolation-functions-added.patch
@@ -136,7 +136,7 @@ Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
unlock_memory_hotplug();
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
-@@ -5582,7 +5582,7 @@ out:
+@@ -5585,7 +5585,7 @@ out:
return ret;
}
@@ -145,7 +145,7 @@ Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
{
struct zone *zone;
unsigned long flags;
-@@ -5590,8 +5590,8 @@ void unset_migratetype_isolate(struct pa
+@@ -5593,8 +5593,8 @@ void unset_migratetype_isolate(struct pa
spin_lock_irqsave(&zone->lock, flags);
if (get_pageblock_migratetype(page) != MIGRATE_ISOLATE)
goto out;
@@ -156,7 +156,7 @@ Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
out:
spin_unlock_irqrestore(&zone->lock, flags);
}
-@@ -5669,6 +5669,10 @@ static int __alloc_contig_migrate_range(
+@@ -5672,6 +5672,10 @@ static int __alloc_contig_migrate_range(
* alloc_contig_range() -- tries to allocate given range of pages
* @start: start PFN to allocate
* @end: one-past-the-last PFN to allocate
@@ -167,7 +167,7 @@ Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
*
* The PFN range does not have to be pageblock or MAX_ORDER_NR_PAGES
* aligned, however it's the caller's responsibility to guarantee that
-@@ -5681,7 +5685,8 @@ static int __alloc_contig_migrate_range(
+@@ -5684,7 +5688,8 @@ static int __alloc_contig_migrate_range(
* pages which PFN is in [start, end) are allocated for the caller and
* need to be freed with free_contig_range().
*/
@@ -177,7 +177,7 @@ Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
{
struct zone *zone = page_zone(pfn_to_page(start));
unsigned long outer_start, outer_end;
-@@ -5712,7 +5717,7 @@ int alloc_contig_range(unsigned long sta
+@@ -5715,7 +5720,7 @@ int alloc_contig_range(unsigned long sta
*/
ret = start_isolate_page_range(pfn_max_align_down(start),
@@ -186,7 +186,7 @@ Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
if (ret)
goto done;
-@@ -5772,7 +5777,7 @@ int alloc_contig_range(unsigned long sta
+@@ -5775,7 +5780,7 @@ int alloc_contig_range(unsigned long sta
done:
undo_isolate_page_range(pfn_max_align_down(start),
diff --git a/patches.dma-mapping/mm-serialize-access-to-min_free_kbytes.patch b/patches.dma-mapping/mm-serialize-access-to-min_free_kbytes.patch
index b5e72594a24..b9f9f75b496 100644
--- a/patches.dma-mapping/mm-serialize-access-to-min_free_kbytes.patch
+++ b/patches.dma-mapping/mm-serialize-access-to-min_free_kbytes.patch
@@ -25,13 +25,11 @@ Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
mm/page_alloc.c | 23 +++++++++++++++--------
- 1 files changed, 15 insertions(+), 8 deletions(-)
+ 1 file changed, 15 insertions(+), 8 deletions(-)
-diff --git a/mm/page_alloc.c b/mm/page_alloc.c
-index 116c087..8be37bc 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
-@@ -5020,14 +5020,7 @@ static void setup_per_zone_lowmem_reserve(void)
+@@ -5023,14 +5023,7 @@ static void setup_per_zone_lowmem_reserv
calculate_totalreserve_pages();
}
@@ -47,7 +45,7 @@ index 116c087..8be37bc 100644
{
unsigned long pages_min = min_free_kbytes >> (PAGE_SHIFT - 10);
unsigned long lowmem_pages = 0;
-@@ -5082,6 +5075,20 @@ void setup_per_zone_wmarks(void)
+@@ -5085,6 +5078,20 @@ void setup_per_zone_wmarks(void)
calculate_totalreserve_pages();
}
@@ -68,6 +66,3 @@ index 116c087..8be37bc 100644
/*
* The inactive anon list should be small enough that the VM never has to
* do too much work, but large enough that each inactive page has a chance
---
-1.7.5.4
-
diff --git a/patches.dma-mapping/mm-trigger-page-reclaim-in-alloc_contig_range-to-stabilise-watermarks.patch b/patches.dma-mapping/mm-trigger-page-reclaim-in-alloc_contig_range-to-stabilise-watermarks.patch
index 40f8128f342..61baca96e48 100644
--- a/patches.dma-mapping/mm-trigger-page-reclaim-in-alloc_contig_range-to-stabilise-watermarks.patch
+++ b/patches.dma-mapping/mm-trigger-page-reclaim-in-alloc_contig_range-to-stabilise-watermarks.patch
@@ -29,11 +29,9 @@ Signed-off-by: Damian Hobson-Garcia <dhobsong@igel.co.jp>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
include/linux/mmzone.h | 9 +++++++
- mm/page_alloc.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 69 insertions(+), 0 deletions(-)
+ mm/page_alloc.c | 60 +++++++++++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 69 insertions(+)
-diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
-index 7d2db87..8d6da7d 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -63,8 +63,10 @@ enum {
@@ -61,11 +59,9 @@ index 7d2db87..8d6da7d 100644
struct free_area free_area[MAX_ORDER];
#ifndef CONFIG_SPARSEMEM
-diff --git a/mm/page_alloc.c b/mm/page_alloc.c
-index 4615531..22348ae 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
-@@ -5079,6 +5079,11 @@ static void __setup_per_zone_wmarks(void)
+@@ -5082,6 +5082,11 @@ static void __setup_per_zone_wmarks(void
zone->watermark[WMARK_LOW] = min_wmark_pages(zone) + (tmp >> 2);
zone->watermark[WMARK_HIGH] = min_wmark_pages(zone) + (tmp >> 1);
@@ -77,7 +73,7 @@ index 4615531..22348ae 100644
setup_zone_migrate_reserve(zone);
spin_unlock_irqrestore(&zone->lock, flags);
}
-@@ -5684,6 +5689,54 @@ static int __alloc_contig_migrate_range(unsigned long start, unsigned long end)
+@@ -5687,6 +5692,54 @@ static int __alloc_contig_migrate_range(
return ret > 0 ? 0 : ret;
}
@@ -132,7 +128,7 @@ index 4615531..22348ae 100644
/**
* alloc_contig_range() -- tries to allocate given range of pages
* @start: start PFN to allocate
-@@ -5782,6 +5835,13 @@ int alloc_contig_range(unsigned long start, unsigned long end,
+@@ -5785,6 +5838,13 @@ int alloc_contig_range(unsigned long sta
goto done;
}
@@ -146,6 +142,3 @@ index 4615531..22348ae 100644
outer_end = isolate_freepages_range(outer_start, end);
if (!outer_end) {
ret = -EBUSY;
---
-1.7.5.4
-
diff --git a/patches.fixes/usb-gadget-acm_ms-need-to-set-max_speed.patch b/patches.fixes/usb-gadget-acm_ms-need-to-set-max_speed.patch
new file mode 100644
index 00000000000..27c43dffd6e
--- /dev/null
+++ b/patches.fixes/usb-gadget-acm_ms-need-to-set-max_speed.patch
@@ -0,0 +1,33 @@
+From ltsi-dev-bounces@lists.linuxfoundation.org Sun Feb 17 18:06:24 2013
+From: Do Quang Thang <dq-thang@jinso.co.jp>
+Date: Mon, 18 Feb 2013 11:05:36 +0900
+Subject: usb: gadget: acm_ms: need to set max_speed
+To: Greg KH <greg@kroah.com>
+Cc: ltsi-dev@lists.linuxfoundation.org
+Message-ID: <1361153138-5365-6-git-send-email-dq-thang@jinso.co.jp>
+
+
+From: Steve Bennett <steveb@workware.net.au>
+
+Failing to set max_speed prevents g_acm_ms working with many drivers which
+check for driver->max_speed < USB_SPEED_FULL, including pxa25x_udc
+
+Signed-off-by: Steve Bennett <steveb@workware.net.au>
+Signed-off-by: Felipe Balbi <balbi@ti.com>
+(cherry picked from commit 6f47209b271661ecd5929397cbe646ff247f01b6)
+
+Signed-off-by: Do Quang Thang <dq-thang@jinso.co.jp>
+---
+ drivers/usb/gadget/acm_ms.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/usb/gadget/acm_ms.c
++++ b/drivers/usb/gadget/acm_ms.c
+@@ -235,6 +235,7 @@ static int __exit acm_ms_unbind(struct u
+ static struct usb_composite_driver acm_ms_driver = {
+ .name = "g_acm_ms",
+ .dev = &device_desc,
++ .max_speed = USB_SPEED_SUPER,
+ .strings = dev_strings,
+ .unbind = __exit_p(acm_ms_unbind),
+ };
diff --git a/patches.fixes/usb-gadget-composite-fix-ep-maxburst-initialization.patch b/patches.fixes/usb-gadget-composite-fix-ep-maxburst-initialization.patch
new file mode 100644
index 00000000000..f21c0244913
--- /dev/null
+++ b/patches.fixes/usb-gadget-composite-fix-ep-maxburst-initialization.patch
@@ -0,0 +1,65 @@
+From ltsi-dev-bounces@lists.linuxfoundation.org Sun Feb 17 18:06:06 2013
+From: Do Quang Thang <dq-thang@jinso.co.jp>
+Date: Mon, 18 Feb 2013 11:05:33 +0900
+Subject: usb: gadget: composite: fix ep->maxburst initialization
+To: Greg KH <greg@kroah.com>
+Cc: ltsi-dev@lists.linuxfoundation.org
+Message-ID: <1361153138-5365-3-git-send-email-dq-thang@jinso.co.jp>
+
+
+From: Felipe Balbi <balbi@ti.com>
+
+bMaxBurst field on endpoint companion descriptor
+is supposed to contain the number of burst minus
+1. When passing that to controller drivers, we
+should be passing the real number instead (by
+incrementing 1).
+
+While doing that, also fix the assumption on
+dwc3 that value comes decremented by one.
+
+Signed-off-by: Felipe Balbi <balbi@ti.com>
+(cherry picked from commit b785ea7ce662c47f6208071320638a4813722803)
+
+Signed-off-by: Do Quang Thang <dq-thang@jinso.co.jp>
+---
+ drivers/usb/dwc3/gadget.c | 2 +-
+ drivers/usb/gadget/composite.c | 7 +++++--
+ 2 files changed, 6 insertions(+), 3 deletions(-)
+
+--- a/drivers/usb/dwc3/gadget.c
++++ b/drivers/usb/dwc3/gadget.c
+@@ -390,7 +390,7 @@ static int dwc3_gadget_set_ep_config(str
+
+ params.param0 = DWC3_DEPCFG_EP_TYPE(usb_endpoint_type(desc))
+ | DWC3_DEPCFG_MAX_PACKET_SIZE(usb_endpoint_maxp(desc))
+- | DWC3_DEPCFG_BURST_SIZE(dep->endpoint.maxburst);
++ | DWC3_DEPCFG_BURST_SIZE(dep->endpoint.maxburst - 1);
+
+ params.param1 = DWC3_DEPCFG_XFER_COMPLETE_EN
+ | DWC3_DEPCFG_XFER_NOT_READY_EN;
+--- a/drivers/usb/gadget/composite.c
++++ b/drivers/usb/gadget/composite.c
+@@ -117,6 +117,7 @@ int config_ep_by_speed(struct usb_gadget
+ struct usb_function *f,
+ struct usb_ep *_ep)
+ {
++ struct usb_composite_dev *cdev = get_gadget_data(g);
+ struct usb_endpoint_descriptor *chosen_desc = NULL;
+ struct usb_descriptor_header **speed_desc = NULL;
+
+@@ -180,10 +181,12 @@ ep_found:
+ _ep->mult = comp_desc->bmAttributes & 0x3;
+ case USB_ENDPOINT_XFER_BULK:
+ case USB_ENDPOINT_XFER_INT:
+- _ep->maxburst = comp_desc->bMaxBurst;
++ _ep->maxburst = comp_desc->bMaxBurst + 1;
+ break;
+ default:
+- /* Do nothing for control endpoints */
++ if (comp_desc->bMaxBurst != 0)
++ ERROR(cdev, "ep0 bMaxBurst must be 0\n");
++ _ep->maxburst = 1;
+ break;
+ }
+ }
diff --git a/patches.fixes/usb-gadget-f_mass_storage-change-default-value-of-the-removable-parameter.patch b/patches.fixes/usb-gadget-f_mass_storage-change-default-value-of-the-removable-parameter.patch
new file mode 100644
index 00000000000..8d542ac5963
--- /dev/null
+++ b/patches.fixes/usb-gadget-f_mass_storage-change-default-value-of-the-removable-parameter.patch
@@ -0,0 +1,50 @@
+From dq-thang@jinso.co.jp Sun Feb 17 18:06:07 2013
+From: Do Quang Thang <dq-thang@jinso.co.jp>
+Date: Mon, 18 Feb 2013 11:05:32 +0900
+Subject: usb: gadget: f_mass_storage: change default value of the removable parameter
+To: Greg KH <greg@kroah.com>
+Cc: ltsi-dev@lists.linuxfoundation.org
+Message-ID: <1361153138-5365-2-git-send-email-dq-thang@jinso.co.jp>
+
+
+From: Michal Nazarewicz <mina86@mina86.com>
+
+This commit changes the default value of the removable module parameter
+from “y” to “n”. This comes with line with file_storag's default and
+seems to be a better default.
+
+Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
+Signed-off-by: Felipe Balbi <balbi@ti.com>
+(cherry picked from commit fa84c57516f6da93ebc2601348043e9bcb7b4b4d)
+
+Signed-off-by: Do Quang Thang <dq-thang@jinso.co.jp>
+---
+ drivers/usb/gadget/f_mass_storage.c | 6 ++----
+ 1 file changed, 2 insertions(+), 4 deletions(-)
+
+--- a/drivers/usb/gadget/f_mass_storage.c
++++ b/drivers/usb/gadget/f_mass_storage.c
+@@ -124,7 +124,7 @@
+ * backing storage.
+ * ro=b[,b...] Default false, boolean for read-only access.
+ * removable=b[,b...]
+- * Default true, boolean for removable media.
++ * Default false, boolean for removable media.
+ * cdrom=b[,b...] Default false, boolean for whether to emulate
+ * a CD-ROM drive.
+ * nofua=b[,b...] Default false, booleans for ignore FUA flag
+@@ -3174,8 +3174,7 @@ fsg_config_from_params(struct fsg_config
+ for (i = 0, lun = cfg->luns; i < cfg->nluns; ++i, ++lun) {
+ lun->ro = !!params->ro[i];
+ lun->cdrom = !!params->cdrom[i];
+- lun->removable = /* Removable by default */
+- params->removable_count <= i || params->removable[i];
++ lun->removable = !!params->removable[i];
+ lun->filename =
+ params->file_count > i && params->file[i][0]
+ ? params->file[i]
+@@ -3210,4 +3209,3 @@ fsg_common_from_params(struct fsg_common
+ fsg_config_from_params(&cfg, params);
+ return fsg_common_init(common, cdev, &cfg);
+ }
+-
diff --git a/patches.fixes/usb-gadget-mass_storage-add-documentation.patch b/patches.fixes/usb-gadget-mass_storage-add-documentation.patch
new file mode 100644
index 00000000000..004970f9ca7
--- /dev/null
+++ b/patches.fixes/usb-gadget-mass_storage-add-documentation.patch
@@ -0,0 +1,349 @@
+From ltsi-dev-bounces@lists.linuxfoundation.org Sun Feb 17 18:06:16 2013
+From: Do Quang Thang <dq-thang@jinso.co.jp>
+Date: Mon, 18 Feb 2013 11:05:35 +0900
+Subject: usb: gadget: mass_storage: add documentation
+To: Greg KH <greg@kroah.com>
+Cc: ltsi-dev@lists.linuxfoundation.org
+Message-ID: <1361153138-5365-5-git-send-email-dq-thang@jinso.co.jp>
+
+
+From: Michal Nazarewicz <mina86@mina86.com>
+
+This commit adds Documentation/usb/mass-storage.txt file. It contains
+description of how to use the mass storage gadget from user space. It
+elaborates on madule parameters and sysfs interface more then it was
+written in the comments in the source code.
+
+Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
+Acked-by: Alan Stern <stern@rowland.harvard.edu>
+Signed-off-by: Felipe Balbi <balbi@ti.com>
+(cherry picked from commit a8287a4ed543494c121050dc453972902637e6de)
+
+Signed-off-by: Do Quang Thang <dq-thang@jinso.co.jp>
+---
+ Documentation/usb/mass-storage.txt | 226 ++++++++++++++++++++++++++++++++++++
+ drivers/usb/gadget/f_mass_storage.c | 69 +---------
+ 2 files changed, 233 insertions(+), 62 deletions(-)
+ create mode 100644 Documentation/usb/mass-storage.txt
+
+--- /dev/null
++++ b/Documentation/usb/mass-storage.txt
+@@ -0,0 +1,226 @@
++* Overview
++
++ Mass Storage Gadget (or MSG) acts as a USB Mass Storage device,
++ appearing to the host as a disk or a CD-ROM drive. It supports
++ multiple logical units (LUNs). Backing storage for each LUN is
++ provided by a regular file or a block device, access can be limited
++ to read-only, and gadget can indicate that it is removable and/or
++ CD-ROM (the latter implies read-only access).
++
++ Its requirements are modest; only a bulk-in and a bulk-out endpoint
++ are needed. The memory requirement amounts to two 16K buffers.
++ Support is included for full-speed, high-speed and SuperSpeed
++ operation.
++
++ Note that the driver is slightly non-portable in that it assumes
++ a single memory/DMA buffer will be useable for bulk-in and bulk-out
++ endpoints. With most device controllers this is not an issue, but
++ there may be some with hardware restrictions that prevent a buffer
++ from being used by more than one endpoint.
++
++ This document describes how to use the gadget from user space, its
++ relation to mass storage function (or MSF) and different gadgets
++ using it, and how it differs from File Storage Gadget (or FSG). It
++ will talk only briefly about how to use MSF within composite
++ gadgets.
++
++* Module parameters
++
++ The mass storage gadget accepts the following mass storage specific
++ module parameters:
++
++ - file=filename[,filename...]
++
++ This parameter lists paths to files or block devices used for
++ backing storage for each logical unit. There may be at most
++ FSG_MAX_LUNS (8) LUNs set. If more files are specified, they will
++ be silently ignored. See also “luns” parameter.
++
++ *BEWARE* that if a file is used as a backing storage, it may not
++ be modified by any other process. This is because the host
++ assumes the data does not change without its knowledge. It may be
++ read, but (if the logical unit is writable) due to buffering on
++ the host side, the contents are not well defined.
++
++ The size of the logical unit will be rounded down to a full
++ logical block. The logical block size is 2048 bytes for LUNs
++ simulating CD-ROM, block size of the device if the backing file is
++ a block device, or 512 bytes otherwise.
++
++ - removable=b[,b...]
++
++ This parameter specifies whether each logical unit should be
++ removable. “b” here is either “y”, “Y” or “1” for true or “n”,
++ “N” or “0” for false.
++
++ If this option is set for a logical unit, gadget will accept an
++ “eject” SCSI request (Start/Stop Unit). When it is sent, the
++ backing file will be closed to simulate ejection and the logical
++ unit will not be mountable by the host until a new backing file is
++ specified by userspace on the device (see “sysfs entries”
++ section).
++
++ If a logical unit is not removable (the default), a backing file
++ must be specified for it with the “file” parameter as the module
++ is loaded. The same applies if the module is built in, no
++ exceptions.
++
++ The default value of the flag is false, *HOWEVER* it used to be
++ true. This has been changed to better match File Storage Gadget
++ and because it seems like a saner default after all. Thus to
++ maintain compatibility with older kernels, it's best to specify
++ the default values. Also, if one relied on old default, explicit
++ “n” needs to be specified now.
++
++ Note that “removable” means the logical unit's media can be
++ ejected or removed (as is true for a CD-ROM drive or a card
++ reader). It does *not* mean that the entire gadget can be
++ unplugged from the host; the proper term for that is
++ “hot-unpluggable”.
++
++ - cdrom=b[,b...]
++
++ This parameter specifies whether each logical unit should simulate
++ CD-ROM. The default is false.
++
++ - ro=b[,b...]
++
++ This parameter specifies whether each logical unit should be
++ reported as read only. This will prevent host from modifying the
++ backing files.
++
++ Note that if this flag for given logical unit is false but the
++ backing file could not be opened in read/write mode, the gadget
++ will fall back to read only mode anyway.
++
++ The default value for non-CD-ROM logical units is false; for
++ logical units simulating CD-ROM it is forced to true.
++
++ - nofua=b[,b...]
++
++ This parameter specifies whether FUA flag should be ignored in SCSI
++ Write10 and Write12 commands sent to given logical units.
++
++ MS Windows mounts removable storage in “Removal optimised mode” by
++ default. All the writes to the media are synchronous, which is
++ achieved by setting the FUA (Force Unit Access) bit in SCSI
++ Write(10,12) commands. This forces each write to wait until the
++ data has actually been written out and prevents I/O requests
++ aggregation in block layer dramatically decreasing performance.
++
++ Note that this may mean that if the device is powered from USB and
++ the user unplugs the device without unmounting it first (which at
++ least some Windows users do), the data may be lost.
++
++ The default value is false.
++
++ - luns=N
++
++ This parameter specifies number of logical units the gadget will
++ have. It is limited by FSG_MAX_LUNS (8) and higher value will be
++ capped.
++
++ If this parameter is provided, and the number of files specified
++ in “file” argument is greater then the value of “luns”, all excess
++ files will be ignored.
++
++ If this parameter is not present, the number of logical units will
++ be deduced from the number of files specified in the “file”
++ parameter. If the file parameter is missing as well, one is
++ assumed.
++
++ - stall=b
++
++ Specifies whether the gadget is allowed to halt bulk endpoints.
++ The default is determined according to the type of USB device
++ controller, but usually true.
++
++ In addition to the above, the gadget also accepts the following
++ parameters defined by the composite framework (they are common to
++ all composite gadgets so just a quick listing):
++
++ - idVendor -- USB Vendor ID (16 bit integer)
++ - idProduct -- USB Product ID (16 bit integer)
++ - bcdDevice -- USB Device version (BCD) (16 bit integer)
++ - iManufacturer -- USB Manufacturer string (string)
++ - iProduct -- USB Product string (string)
++ - iSerialNumber -- SerialNumber string (sting)
++
++* sysfs entries
++
++ For each logical unit, the gadget creates a directory in the sysfs
++ hierarchy. Inside of it the following three files are created:
++
++ - file
++
++ When read it returns the path to the backing file for the given
++ logical unit. If there is no backing file (possible only if the
++ logical unit is removable), the content is empty.
++
++ When written into, it changes the backing file for given logical
++ unit. This change can be performed even if given logical unit is
++ not specified as removable (but that may look strange to the
++ host). It may fail, however, if host disallowed medium removal
++ with the Prevent-Allow Medium Removal SCSI command.
++
++ - ro
++
++ Reflects the state of ro flag for the given logical unit. It can
++ be read any time, and written to when there is no backing file
++ open for given logical unit.
++
++ - nofua
++
++ Reflects the state of nofua flag for given logical unit. It can
++ be read and written.
++
++ Other then those, as usual, the values of module parameters can be
++ read from /sys/module/g_mass_storage/parameters/* files.
++
++* Other gadgets using mass storage function
++
++ The Mass Storage Gadget uses the Mass Storage Function to handle
++ mass storage protocol. As a composite function, MSF may be used by
++ other gadgets as well (eg. g_multi and acm_ms).
++
++ All of the information in previous sections are valid for other
++ gadgets using MSF, except that support for mass storage related
++ module parameters may be missing, or the parameters may have
++ a prefix. To figure out whether any of this is true one needs to
++ consult the gadget's documentation or its source code.
++
++ For examples of how to include mass storage function in gadgets, one
++ may take a look at mass_storage.c, acm_ms.c and multi.c (sorted by
++ complexity).
++
++* Relation to file storage gadget
++
++ The Mass Storage Function and thus the Mass Storage Gadget has been
++ based on the File Storage Gadget. The difference between the two is
++ that MSG is a composite gadget (ie. uses the composite framework)
++ while file storage gadget is a traditional gadget. From userspace
++ point of view this distinction does not really matter, but from
++ kernel hacker's point of view, this means that (i) MSG does not
++ duplicate code needed for handling basic USB protocol commands and
++ (ii) MSF can be used in any other composite gadget.
++
++ Because of that, File Storage Gadget has been deprecated and
++ scheduled to be removed in Linux 3.8. All users need to transition
++ to the Mass Storage Gadget by that time. The two gadgets behave
++ mostly the same from the outside except:
++
++ 1. In FSG the “removable” and “cdrom” module parameters set the flag
++ for all logical units whereas in MSG they accept a list of y/n
++ values for each logical unit. If one uses only a single logical
++ unit this does not matter, but if there are more, the y/n value
++ needs to be repeated for each logical unit.
++
++ 2. FSG's “serial”, “vendor”, “product” and “release” module
++ parameters are handled in MSG by the composite layer's parameters
++ named respectively: “iSerialnumber”, “idVendor”, “idProduct” and
++ “bcdDevice”.
++
++ 3. MSG does not support FSG's test mode, thus “transport”,
++ “protocol” and “buflen” FSG's module parameters are not
++ supported. MSG always uses SCSI protocol with bulk only
++ transport mode and 16 KiB buffers.
+--- a/drivers/usb/gadget/f_mass_storage.c
++++ b/drivers/usb/gadget/f_mass_storage.c
+@@ -44,12 +44,12 @@
+ * function for a USB device, it also illustrates a technique of
+ * double-buffering for increased throughput.
+ *
+- * Function supports multiple logical units (LUNs). Backing storage
+- * for each LUN is provided by a regular file or a block device.
+- * Access for each LUN can be limited to read-only. Moreover, the
+- * function can indicate that LUN is removable and/or CD-ROM. (The
+- * later implies read-only access.)
+- *
++ * For more information about MSF and in particular its module
++ * parameters and sysfs interface read the
++ * <Documentation/usb/mass-storage.txt> file.
++ */
++
++/*
+ * MSF is configured by specifying a fsg_config structure. It has the
+ * following fields:
+ *
+@@ -95,61 +95,6 @@
+ * data track and no audio tracks; hence there need be only one
+ * backing file per LUN.
+ *
+- *
+- * MSF includes support for module parameters. If gadget using it
+- * decides to use it, the following module parameters will be
+- * available:
+- *
+- * file=filename[,filename...]
+- * Names of the files or block devices used for
+- * backing storage.
+- * ro=b[,b...] Default false, boolean for read-only access.
+- * removable=b[,b...]
+- * Default false, boolean for removable media.
+- * cdrom=b[,b...] Default false, boolean for whether to emulate
+- * a CD-ROM drive.
+- * nofua=b[,b...] Default false, booleans for ignore FUA flag
+- * in SCSI WRITE(10,12) commands
+- * luns=N Default N = number of filenames, number of
+- * LUNs to support.
+- * stall Default determined according to the type of
+- * USB device controller (usually true),
+- * boolean to permit the driver to halt
+- * bulk endpoints.
+- *
+- * The module parameters may be prefixed with some string. You need
+- * to consult gadget's documentation or source to verify whether it is
+- * using those module parameters and if it does what are the prefixes
+- * (look for FSG_MODULE_PARAMETERS() macro usage, what's inside it is
+- * the prefix).
+- *
+- *
+- * Requirements are modest; only a bulk-in and a bulk-out endpoint are
+- * needed. The memory requirement amounts to two 16K buffers, size
+- * configurable by a parameter. Support is included for both
+- * full-speed and high-speed operation.
+- *
+- * Note that the driver is slightly non-portable in that it assumes a
+- * single memory/DMA buffer will be useable for bulk-in, bulk-out, and
+- * interrupt-in endpoints. With most device controllers this isn't an
+- * issue, but there may be some with hardware restrictions that prevent
+- * a buffer from being used by more than one endpoint.
+- *
+- *
+- * The pathnames of the backing files, the ro settings and nofua
+- * settings are available in the attribute files "file", "ro" and
+- * "nofua" in the lun<n> subdirectory of the gadget's sysfs directory.
+- * If the "removable" option is set, writing to these files will
+- * simulate ejecting/loading the medium (writing an empty line means
+- * eject) and adjusting a write-enable tab. Changes to the ro setting
+- * are not allowed when the medium is loaded or if CD-ROM emulation is
+- * being used.
+- *
+- * When a LUN receive an "eject" SCSI request (Start/Stop Unit),
+- * if the LUN is removable, the backing file is released to simulate
+- * ejection.
+- *
+- *
+ * This function is heavily based on "File-backed Storage Gadget" by
+ * Alan Stern which in turn is heavily based on "Gadget Zero" by David
+ * Brownell. The driver's SCSI command interface was based on the
+@@ -191,7 +136,7 @@
+ * In normal operation the main thread is started during the gadget's
+ * fsg_bind() callback and stopped during fsg_unbind(). But it can
+ * also exit when it receives a signal, and there's no point leaving
+- * the gadget running when the thread is dead. At of this moment, MSF
++ * the gadget running when the thread is dead. As of this moment, MSF
+ * provides no way to deregister the gadget when thread dies -- maybe
+ * a callback functions is needed.
+ *
diff --git a/patches.fixes/usb-gadget-mass_storage-fail-fsg_store_file-early-if-colud-not-open-file.patch b/patches.fixes/usb-gadget-mass_storage-fail-fsg_store_file-early-if-colud-not-open-file.patch
new file mode 100644
index 00000000000..d72e4c9e09f
--- /dev/null
+++ b/patches.fixes/usb-gadget-mass_storage-fail-fsg_store_file-early-if-colud-not-open-file.patch
@@ -0,0 +1,139 @@
+From dq-thang@jinso.co.jp Sun Feb 17 18:06:37 2013
+From: Do Quang Thang <dq-thang@jinso.co.jp>
+Date: Mon, 18 Feb 2013 11:05:38 +0900
+Subject: usb: gadget: mass_storage: fail fsg_store_file() early if colud not open file
+To: Greg KH <greg@kroah.com>
+Cc: ltsi-dev@lists.linuxfoundation.org
+Message-ID: <1361153138-5365-8-git-send-email-dq-thang@jinso.co.jp>
+
+
+From: Michal Nazarewicz <mina86@mina86.com>
+
+Currently, when a new value is stored to the “file” sysfs entry,
+fsg_store_file() will release existing backing file and only then attempt to
+open a new one. If that fails, no new backing file is open.
+
+This commit changes the fsg_lun_open() so that it closes existing backing file
+only after the new backing file has been successfully opened. With that
+change, fsg_store_file() may use it to perform an atomic open operation with
+guarantee that logical unit will either point to the new backing file or still
+to the old one.
+
+Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
+Acked-by: Alan Stern <stern@rowland.harvard.edu
+Signed-off-by: Felipe Balbi <balbi@ti.com>
+(cherry picked from commit d6e16a89578fcc8834be634c85c5c5ddc2d13229)
+
+Signed-off-by: Do Quang Thang <dq-thang@jinso.co.jp>
+---
+ drivers/usb/gadget/storage_common.c | 52 ++++++++++++++++++++----------------
+ 1 file changed, 29 insertions(+), 23 deletions(-)
+
+--- a/drivers/usb/gadget/storage_common.c
++++ b/drivers/usb/gadget/storage_common.c
+@@ -617,6 +617,16 @@ static struct usb_gadget_strings fsg_str
+ * the caller must own fsg->filesem for writing.
+ */
+
++static void fsg_lun_close(struct fsg_lun *curlun)
++{
++ if (curlun->filp) {
++ LDBG(curlun, "close backing file\n");
++ fput(curlun->filp);
++ curlun->filp = NULL;
++ }
++}
++
++
+ static int fsg_lun_open(struct fsg_lun *curlun, const char *filename)
+ {
+ int ro;
+@@ -626,6 +636,8 @@ static int fsg_lun_open(struct fsg_lun *
+ loff_t size;
+ loff_t num_sectors;
+ loff_t min_sectors;
++ unsigned int blkbits;
++ unsigned int blksize;
+
+ /* R/W if we can, R/O if we must */
+ ro = curlun->initially_ro;
+@@ -670,17 +682,17 @@ static int fsg_lun_open(struct fsg_lun *
+ }
+
+ if (curlun->cdrom) {
+- curlun->blksize = 2048;
+- curlun->blkbits = 11;
++ blksize = 2048;
++ blkbits = 11;
+ } else if (inode->i_bdev) {
+- curlun->blksize = bdev_logical_block_size(inode->i_bdev);
+- curlun->blkbits = blksize_bits(curlun->blksize);
++ blksize = bdev_logical_block_size(inode->i_bdev);
++ blkbits = blksize_bits(blksize);
+ } else {
+- curlun->blksize = 512;
+- curlun->blkbits = 9;
++ blksize = 512;
++ blkbits = 9;
+ }
+
+- num_sectors = size >> curlun->blkbits; /* File size in logic-block-size blocks */
++ num_sectors = size >> blkbits; /* File size in logic-block-size blocks */
+ min_sectors = 1;
+ if (curlun->cdrom) {
+ min_sectors = 300; /* Smallest track is 300 frames */
+@@ -697,7 +709,12 @@ static int fsg_lun_open(struct fsg_lun *
+ goto out;
+ }
+
++ if (fsg_lun_is_open(curlun))
++ fsg_lun_close(curlun);
++
+ get_file(filp);
++ curlun->blksize = blksize;
++ curlun->blkbits = blkbits;
+ curlun->ro = ro;
+ curlun->filp = filp;
+ curlun->file_length = size;
+@@ -711,16 +728,6 @@ out:
+ }
+
+
+-static void fsg_lun_close(struct fsg_lun *curlun)
+-{
+- if (curlun->filp) {
+- LDBG(curlun, "close backing file\n");
+- fput(curlun->filp);
+- curlun->filp = NULL;
+- }
+-}
+-
+-
+ /*-------------------------------------------------------------------------*/
+
+ /*
+@@ -871,19 +878,18 @@ static ssize_t fsg_store_file(struct dev
+ if (count > 0 && buf[count-1] == '\n')
+ ((char *) buf)[count-1] = 0; /* Ugh! */
+
+- /* Eject current medium */
+- down_write(filesem);
+- if (fsg_lun_is_open(curlun)) {
+- fsg_lun_close(curlun);
+- curlun->unit_attention_data = SS_MEDIUM_NOT_PRESENT;
+- }
+
+ /* Load new medium */
++ down_write(filesem);
+ if (count > 0 && buf[0]) {
++ /* fsg_lun_open() will close existing file if any. */
+ rc = fsg_lun_open(curlun, buf);
+ if (rc == 0)
+ curlun->unit_attention_data =
+ SS_NOT_READY_TO_READY_TRANSITION;
++ } else if (fsg_lun_is_open(curlun)) {
++ fsg_lun_close(curlun);
++ curlun->unit_attention_data = SS_MEDIUM_NOT_PRESENT;
+ }
+ up_write(filesem);
+ return (rc < 0 ? rc : count);
diff --git a/patches.fixes/usb-gadget-mass_storage-make-file-and-ro-read-only-in-some-cases.patch b/patches.fixes/usb-gadget-mass_storage-make-file-and-ro-read-only-in-some-cases.patch
new file mode 100644
index 00000000000..287b0d82c0e
--- /dev/null
+++ b/patches.fixes/usb-gadget-mass_storage-make-file-and-ro-read-only-in-some-cases.patch
@@ -0,0 +1,98 @@
+From dq-thang@jinso.co.jp Sun Feb 17 18:40:19 2013
+From: Do Quang Thang <dq-thang@jinso.co.jp>
+Date: Mon, 18 Feb 2013 11:40:10 +0900
+Subject: usb: gadget: mass_storage: make "file" and "ro" read only in some cases
+To: Greg KH <greg@kroah.com>
+Cc: ltsi-dev@lists.linuxfoundation.org
+Message-ID: <1361155210-5674-1-git-send-email-dq-thang@jinso.co.jp>
+
+
+From: Michal Nazarewicz <mina86@mina86.com>
+
+The “file” sysfs entry for LUNs was writable even for non-removable
+LUNs and the fsg_store_file() function did not check whether LUN is
+removable or not. This made it possible to change or even close
+LUN's backing file.
+
+The same is true for “ro” sysfs entry and LUNs simulating CD-ROM.
+For those LUNs, the file should not be writable.
+
+This commit introduces two new device_attribute structures for those
+two special cases so that the file/ro sysfs entries are made
+non-writable when not desired.
+
+Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
+Signed-off-by: Felipe Balbi <balbi@ti.com>
+(cherry picked from commit 48a31af74404e6460eabca410bf0b4a625bfd372)
+
+Signed-off-by: Do Quang Thang <dq-thang@jinso.co.jp>
+---
+ drivers/usb/gadget/f_mass_storage.c | 26 +++++++++++++++++++++-----
+ drivers/usb/gadget/storage_common.c | 1 -
+ 2 files changed, 21 insertions(+), 6 deletions(-)
+
+--- a/drivers/usb/gadget/f_mass_storage.c
++++ b/drivers/usb/gadget/f_mass_storage.c
+@@ -2609,11 +2609,15 @@ static int fsg_main_thread(void *common_
+
+ /*************************** DEVICE ATTRIBUTES ***************************/
+
+-/* Write permission is checked per LUN in store_*() functions. */
+ static DEVICE_ATTR(ro, 0644, fsg_show_ro, fsg_store_ro);
+ static DEVICE_ATTR(nofua, 0644, fsg_show_nofua, fsg_store_nofua);
+ static DEVICE_ATTR(file, 0644, fsg_show_file, fsg_store_file);
+
++static struct device_attribute dev_attr_ro_cdrom =
++ __ATTR(ro, 0444, fsg_show_ro, NULL);
++static struct device_attribute dev_attr_file_nonremovable =
++ __ATTR(file, 0444, fsg_show_file, NULL);
++
+
+ /****************************** FSG COMMON ******************************/
+
+@@ -2724,10 +2728,16 @@ static struct fsg_common *fsg_common_ini
+ goto error_release;
+ }
+
+- rc = device_create_file(&curlun->dev, &dev_attr_ro);
++ rc = device_create_file(&curlun->dev,
++ curlun->cdrom
++ ? &dev_attr_ro_cdrom
++ : &dev_attr_ro);
+ if (rc)
+ goto error_luns;
+- rc = device_create_file(&curlun->dev, &dev_attr_file);
++ rc = device_create_file(&curlun->dev,
++ curlun->removable
++ ? &dev_attr_file
++ : &dev_attr_file_nonremovable);
+ if (rc)
+ goto error_luns;
+ rc = device_create_file(&curlun->dev, &dev_attr_nofua);
+@@ -2862,8 +2872,14 @@ static void fsg_common_release(struct kr
+ /* In error recovery common->nluns may be zero. */
+ for (; i; --i, ++lun) {
+ device_remove_file(&lun->dev, &dev_attr_nofua);
+- device_remove_file(&lun->dev, &dev_attr_ro);
+- device_remove_file(&lun->dev, &dev_attr_file);
++ device_remove_file(&lun->dev,
++ lun->cdrom
++ ? &dev_attr_ro_cdrom
++ : &dev_attr_ro);
++ device_remove_file(&lun->dev,
++ lun->removable
++ ? &dev_attr_file
++ : &dev_attr_file_nonremovable);
+ fsg_lun_close(lun);
+ device_unregister(&lun->dev);
+ }
+--- a/drivers/usb/gadget/storage_common.c
++++ b/drivers/usb/gadget/storage_common.c
+@@ -878,7 +878,6 @@ static ssize_t fsg_store_file(struct dev
+ if (count > 0 && buf[count-1] == '\n')
+ ((char *) buf)[count-1] = 0; /* Ugh! */
+
+-
+ /* Load new medium */
+ down_write(filesem);
+ if (count > 0 && buf[0]) {
diff --git a/patches.fixes/usb-gadget-mass_storage-remove-unused-options.patch b/patches.fixes/usb-gadget-mass_storage-remove-unused-options.patch
new file mode 100644
index 00000000000..9989d28ee8a
--- /dev/null
+++ b/patches.fixes/usb-gadget-mass_storage-remove-unused-options.patch
@@ -0,0 +1,118 @@
+From dq-thang@jinso.co.jp Sun Feb 17 18:09:16 2013
+From: Do Quang Thang <dq-thang@jinso.co.jp>
+Date: Mon, 18 Feb 2013 11:05:34 +0900
+Subject: usb: gadget: mass_storage: remove unused options
+To: Greg KH <greg@kroah.com>
+Cc: ltsi-dev@lists.linuxfoundation.org
+Message-ID: <1361153138-5365-4-git-send-email-dq-thang@jinso.co.jp>
+
+
+From: Michal Nazarewicz <mina86@mina86.com>
+
+This commit removes thread_name and lun_name_format fields from the
+fsg_config structure. Those fields are not used by any in-tree code
+and their usefulness is rather theoretical.
+
+Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
+Signed-off-by: Felipe Balbi <balbi@ti.com>
+(cherry picked from commit 1a12af1a751311e129ff8e8ca18f83613b78a83c)
+
+Signed-off-by: Do Quang Thang <dq-thang@jinso.co.jp>
+---
+ drivers/usb/gadget/f_mass_storage.c | 50 +++++++-----------------------------
+ 1 file changed, 10 insertions(+), 40 deletions(-)
+
+--- a/drivers/usb/gadget/f_mass_storage.c
++++ b/drivers/usb/gadget/f_mass_storage.c
+@@ -75,25 +75,6 @@
+ * ->nofua Flag specifying that FUA flag in SCSI WRITE(10,12)
+ * commands for this LUN shall be ignored.
+ *
+- * lun_name_format A printf-like format for names of the LUN
+- * devices. This determines how the
+- * directory in sysfs will be named.
+- * Unless you are using several MSFs in
+- * a single gadget (as opposed to single
+- * MSF in many configurations) you may
+- * leave it as NULL (in which case
+- * "lun%d" will be used). In the format
+- * you can use "%d" to index LUNs for
+- * MSF's with more than one LUN. (Beware
+- * that there is only one integer given
+- * as an argument for the format and
+- * specifying invalid format may cause
+- * unspecified behaviour.)
+- * thread_name Name of the kernel thread process used by the
+- * MSF. You can safely set it to NULL
+- * (in which case default "file-storage"
+- * will be used).
+- *
+ * vendor_name
+ * product_name
+ * release Information used as a reply to INQUIRY
+@@ -155,15 +136,14 @@
+ * a buffer from being used by more than one endpoint.
+ *
+ *
+- * The pathnames of the backing files and the ro settings are
+- * available in the attribute files "file" and "ro" in the lun<n> (or
+- * to be more precise in a directory which name comes from
+- * "lun_name_format" option!) subdirectory of the gadget's sysfs
+- * directory. If the "removable" option is set, writing to these
+- * files will simulate ejecting/loading the medium (writing an empty
+- * line means eject) and adjusting a write-enable tab. Changes to the
+- * ro setting are not allowed when the medium is loaded or if CD-ROM
+- * emulation is being used.
++ * The pathnames of the backing files, the ro settings and nofua
++ * settings are available in the attribute files "file", "ro" and
++ * "nofua" in the lun<n> subdirectory of the gadget's sysfs directory.
++ * If the "removable" option is set, writing to these files will
++ * simulate ejecting/loading the medium (writing an empty line means
++ * eject) and adjusting a write-enable tab. Changes to the ro setting
++ * are not allowed when the medium is loaded or if CD-ROM emulation is
++ * being used.
+ *
+ * When a LUN receive an "eject" SCSI request (Start/Stop Unit),
+ * if the LUN is removable, the backing file is released to simulate
+@@ -417,9 +397,6 @@ struct fsg_config {
+ char nofua;
+ } luns[FSG_MAX_LUNS];
+
+- const char *lun_name_format;
+- const char *thread_name;
+-
+ /* Callback functions. */
+ const struct fsg_operations *ops;
+ /* Gadget's private data. */
+@@ -2792,11 +2769,7 @@ static struct fsg_common *fsg_common_ini
+ curlun->dev.parent = &gadget->dev;
+ /* curlun->dev.driver = &fsg_driver.driver; XXX */
+ dev_set_drvdata(&curlun->dev, &common->filesem);
+- dev_set_name(&curlun->dev,
+- cfg->lun_name_format
+- ? cfg->lun_name_format
+- : "lun%d",
+- i);
++ dev_set_name(&curlun->dev, "lun%d", i);
+
+ rc = device_register(&curlun->dev);
+ if (rc) {
+@@ -2878,8 +2851,7 @@ buffhds_first_it:
+
+ /* Tell the thread to start working */
+ common->thread_task =
+- kthread_create(fsg_main_thread, common,
+- cfg->thread_name ?: "file-storage");
++ kthread_create(fsg_main_thread, common, "file-storage");
+ if (IS_ERR(common->thread_task)) {
+ rc = PTR_ERR(common->thread_task);
+ goto error_release;
+@@ -3182,8 +3154,6 @@ fsg_config_from_params(struct fsg_config
+ }
+
+ /* Let MSF use defaults */
+- cfg->lun_name_format = 0;
+- cfg->thread_name = 0;
+ cfg->vendor_name = 0;
+ cfg->product_name = 0;
+ cfg->release = 0xffff;
diff --git a/patches.fixes/usb-gadget-storage_common-remove-fsg_buffhd_static_buffer-support.patch b/patches.fixes/usb-gadget-storage_common-remove-fsg_buffhd_static_buffer-support.patch
new file mode 100644
index 00000000000..480c061ad7c
--- /dev/null
+++ b/patches.fixes/usb-gadget-storage_common-remove-fsg_buffhd_static_buffer-support.patch
@@ -0,0 +1,52 @@
+From dq-thang@jinso.co.jp Sun Feb 17 18:07:09 2013
+From: Do Quang Thang <dq-thang@jinso.co.jp>
+Date: Mon, 18 Feb 2013 11:05:37 +0900
+Subject: usb: gadget: storage_common: remove FSG_BUFFHD_STATIC_BUFFER support
+To: Greg KH <greg@kroah.com>
+Cc: ltsi-dev@lists.linuxfoundation.org
+Message-ID: <1361153138-5365-7-git-send-email-dq-thang@jinso.co.jp>
+
+
+From: Michal Nazarewicz <mina86@mina86.com>
+
+Since f_mass_storage stopped using FSG_BUFFHD_STATIC_BUFFER (because it
+caused buffers not to be page aligned which did not work well with at
+least some UDCs), no code was using it. Removing not to bloat the code
+too much.
+
+Signed-off-by: Michal Nazarewicz <mina86@mina86.com>
+Signed-off-by: Felipe Balbi <balbi@ti.com>
+(cherry picked from commit f87cabf4d56e1fc5d08434df9d54ef3450a756f0)
+
+Signed-off-by: Do Quang Thang <dq-thang@jinso.co.jp>
+---
+ drivers/usb/gadget/storage_common.c | 10 ----------
+ 1 file changed, 10 deletions(-)
+
+--- a/drivers/usb/gadget/storage_common.c
++++ b/drivers/usb/gadget/storage_common.c
+@@ -38,12 +38,6 @@
+ */
+
+ /*
+- * When FSG_BUFFHD_STATIC_BUFFER is defined when this file is included
+- * the fsg_buffhd structure's buf field will be an array of FSG_BUFLEN
+- * characters rather then a pointer to void.
+- */
+-
+-/*
+ * When USB_GADGET_DEBUG_FILES is defined the module param num_buffers
+ * sets the number of pipeline buffers (length of the fsg_buffhd array).
+ * The valid range of num_buffers is: num >= 2 && num <= 4.
+@@ -260,11 +254,7 @@ enum fsg_buffer_state {
+ };
+
+ struct fsg_buffhd {
+-#ifdef FSG_BUFFHD_STATIC_BUFFER
+- char buf[FSG_BUFLEN];
+-#else
+ void *buf;
+-#endif
+ enum fsg_buffer_state state;
+ struct fsg_buffhd *next;
+
diff --git a/patches.ltsi/ltsi-makefile-addition.patch b/patches.ltsi/ltsi-makefile-addition.patch
index e57a5a27aee..5ea9effdb2e 100644
--- a/patches.ltsi/ltsi-makefile-addition.patch
+++ b/patches.ltsi/ltsi-makefile-addition.patch
@@ -18,7 +18,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
@@ -1,7 +1,7 @@
VERSION = 3
PATCHLEVEL = 4
- SUBLEVEL = 31
+ SUBLEVEL = 39
-EXTRAVERSION =
+EXTRAVERSION = -ltsi
NAME = Saber-toothed Squirrel
diff --git a/series b/series
index 81c45caf755..7da89fcebd1 100644
--- a/series
+++ b/series
@@ -785,3 +785,11 @@ patches.fixes/revert-usb-renesas_usbhs-gadget-usbhsg_ep_disable-care-pipe-settin
patches.fixes/revert-usb-renesas_usbhs-gadget-remove-usbhsg_uep_init.patch
patches.fixes/sh-clkfwk-bugfix-sh_clk_div_enable-care-sh_clk_div_set_rate-if-div6.patch
patches.fixes/asoc-shmobile-armadillo800eva-enable-clock-inversion-on-fsi-a.patch
+patches.fixes/usb-gadget-f_mass_storage-change-default-value-of-the-removable-parameter.patch
+patches.fixes/usb-gadget-composite-fix-ep-maxburst-initialization.patch
+patches.fixes/usb-gadget-mass_storage-remove-unused-options.patch
+patches.fixes/usb-gadget-mass_storage-add-documentation.patch
+patches.fixes/usb-gadget-acm_ms-need-to-set-max_speed.patch
+patches.fixes/usb-gadget-storage_common-remove-fsg_buffhd_static_buffer-support.patch
+patches.fixes/usb-gadget-mass_storage-fail-fsg_store_file-early-if-colud-not-open-file.patch
+patches.fixes/usb-gadget-mass_storage-make-file-and-ro-read-only-in-some-cases.patch