Commit f7d8de58 authored by Vojtech Pavlik's avatar Vojtech Pavlik

Merge suse.cz:/home/vojtech/bk/linus into suse.cz:/home/vojtech/bk/input

parents 7b8e33fc 72406137
......@@ -133,6 +133,18 @@ union offset_union {
#define TYPE_LDST 2
#define TYPE_DONE 3
#ifdef __ARMEB__
#define BE 1
#define FIRST_BYTE_16 "mov %1, %1, ror #8\n"
#define FIRST_BYTE_32 "mov %1, %1, ror #24\n"
#define NEXT_BYTE "ror #24"
#else
#define BE 0
#define FIRST_BYTE_16
#define FIRST_BYTE_32
#define NEXT_BYTE "lsr #8"
#endif
#define __get8_unaligned_check(ins,val,addr,err) \
__asm__( \
"1: "ins" %1, [%2], #1\n" \
......@@ -152,9 +164,10 @@ union offset_union {
#define __get16_unaligned_check(ins,val,addr) \
do { \
unsigned int err = 0, v, a = addr; \
__get8_unaligned_check(ins,val,a,err); \
__get8_unaligned_check(ins,v,a,err); \
val |= v << 8; \
val = v << ((BE) ? 8 : 0); \
__get8_unaligned_check(ins,v,a,err); \
val |= v << ((BE) ? 0 : 8); \
if (err) \
goto fault; \
} while (0)
......@@ -168,13 +181,14 @@ union offset_union {
#define __get32_unaligned_check(ins,val,addr) \
do { \
unsigned int err = 0, v, a = addr; \
__get8_unaligned_check(ins,val,a,err); \
__get8_unaligned_check(ins,v,a,err); \
val |= v << 8; \
val = v << ((BE) ? 24 : 0); \
__get8_unaligned_check(ins,v,a,err); \
val |= v << ((BE) ? 16 : 8); \
__get8_unaligned_check(ins,v,a,err); \
val |= v << 16; \
val |= v << ((BE) ? 8 : 16); \
__get8_unaligned_check(ins,v,a,err); \
val |= v << 24; \
val |= v << ((BE) ? 0 : 24); \
if (err) \
goto fault; \
} while (0)
......@@ -188,9 +202,9 @@ union offset_union {
#define __put16_unaligned_check(ins,val,addr) \
do { \
unsigned int err = 0, v = val, a = addr; \
__asm__( \
__asm__( FIRST_BYTE_16 \
"1: "ins" %1, [%2], #1\n" \
" mov %1, %1, lsr #8\n" \
" mov %1, %1, "NEXT_BYTE"\n" \
"2: "ins" %1, [%2]\n" \
"3:\n" \
" .section .fixup,\"ax\"\n" \
......@@ -218,13 +232,13 @@ union offset_union {
#define __put32_unaligned_check(ins,val,addr) \
do { \
unsigned int err = 0, v = val, a = addr; \
__asm__( \
__asm__( FIRST_BYTE_32 \
"1: "ins" %1, [%2], #1\n" \
" mov %1, %1, lsr #8\n" \
" mov %1, %1, "NEXT_BYTE"\n" \
"2: "ins" %1, [%2], #1\n" \
" mov %1, %1, lsr #8\n" \
" mov %1, %1, "NEXT_BYTE"\n" \
"3: "ins" %1, [%2], #1\n" \
" mov %1, %1, lsr #8\n" \
" mov %1, %1, "NEXT_BYTE"\n" \
"4: "ins" %1, [%2]\n" \
"5:\n" \
" .section .fixup,\"ax\"\n" \
......
......@@ -133,11 +133,12 @@ static struct bit_map srmmu_nocache_map;
static unsigned long srmmu_pte_pfn(pte_t pte)
{
if (srmmu_device_memory(pte_val(pte))) {
/* XXX Anton obviously had something in mind when he did this.
* But what?
/* Just return something that will cause
* pfn_valid() to return false. This makes
* copy_one_pte() to just directly copy to
* PTE over.
*/
/* return (struct page *)~0; */
BUG();
return ~0UL;
}
return (pte_val(pte) & SRMMU_PTE_PMASK) >> (PAGE_SHIFT-4);
}
......
......@@ -222,8 +222,8 @@ cg3_blank(int blank, struct fb_info *info)
static struct sbus_mmap_map cg3_mmap_map[] = {
{
.poff = CG3_MMAP_OFFSET,
.voff = CG3_RAM_OFFSET,
.voff = CG3_MMAP_OFFSET,
.poff = CG3_RAM_OFFSET,
.size = SBUS_MMAP_FBSIZE(1)
},
{ .size = 0 }
......@@ -385,6 +385,9 @@ static void cg3_init_one(struct sbus_dev *sdev)
all->par.physbase = sdev->reg_addrs[0].phys_addr;
sbusfb_fill_var(&all->info.var, sdev->prom_node, 8);
all->info.var.red.length = 8;
all->info.var.green.length = 8;
all->info.var.blue.length = 8;
if (!strcmp(sdev->prom_name, "cgRDI"))
all->par.flags |= CG3_FLAG_RDI;
if (all->par.flags & CG3_FLAG_RDI)
......@@ -419,6 +422,7 @@ static void cg3_init_one(struct sbus_dev *sdev)
kfree(all);
return;
}
fb_set_cmap(&all->info.cmap, &all->info);
cg3_init_fix(&all->info, linebytes);
......
......@@ -108,6 +108,7 @@ int sbusfb_ioctl_helper(unsigned long cmd, unsigned long arg,
struct fbcmap __user *c = (struct fbcmap __user *) arg;
struct fb_cmap cmap;
u16 red, green, blue;
u8 red8, green8, blue8;
unsigned char __user *ured;
unsigned char __user *ugreen;
unsigned char __user *ublue;
......@@ -128,11 +129,15 @@ int sbusfb_ioctl_helper(unsigned long cmd, unsigned long arg,
for (i = 0; i < count; i++) {
int err;
if (get_user(red, &ured[i]) ||
get_user(green, &ugreen[i]) ||
get_user(blue, &ublue[i]))
if (get_user(red8, &ured[i]) ||
get_user(green8, &ugreen[i]) ||
get_user(blue8, &ublue[i]))
return -EFAULT;
red = red8 << 8;
green = green8 << 8;
blue = blue8 << 8;
cmap.start = index + i;
err = fb_set_cmap(&cmap, info);
if (err)
......@@ -147,6 +152,7 @@ int sbusfb_ioctl_helper(unsigned long cmd, unsigned long arg,
unsigned char __user *ublue;
struct fb_cmap *cmap = &info->cmap;
int index, count, i;
u8 red, green, blue;
if (get_user(index, &c->index) ||
__get_user(count, &c->count) ||
......@@ -159,9 +165,12 @@ int sbusfb_ioctl_helper(unsigned long cmd, unsigned long arg,
return -EINVAL;
for (i = 0; i < count; i++) {
if (put_user(cmap->red[index + i], &ured[i]) ||
put_user(cmap->green[index + i], &ugreen[i]) ||
put_user(cmap->blue[index + i], &ublue[i]))
red = cmap->red[index + i] >> 8;
green = cmap->green[index + i] >> 8;
blue = cmap->blue[index + i] >> 8;
if (put_user(red, &ured[i]) ||
put_user(green, &ugreen[i]) ||
put_user(blue, &ublue[i]))
return -EFAULT;
}
return 0;
......
......@@ -15,6 +15,7 @@
* 19-06-2003 Ben Dooks Created file
* 12-03-2004 Ben Dooks Updated include protection
* 29-Sep-2004 Ben Dooks Fixed usage for assembly inclusion
* 10-Feb-2005 Ben Dooks Fixed CAMDIVN address (Guillaume Gourat)
*/
#ifndef __ASM_ARM_REGS_CLOCK
......@@ -77,17 +78,17 @@
static inline unsigned int
s3c2410_get_pll(int pllval, int baseclk)
{
int mdiv, pdiv, sdiv;
int mdiv, pdiv, sdiv;
mdiv = pllval >> S3C2410_PLLCON_MDIVSHIFT;
pdiv = pllval >> S3C2410_PLLCON_PDIVSHIFT;
sdiv = pllval >> S3C2410_PLLCON_SDIVSHIFT;
mdiv = pllval >> S3C2410_PLLCON_MDIVSHIFT;
pdiv = pllval >> S3C2410_PLLCON_PDIVSHIFT;
sdiv = pllval >> S3C2410_PLLCON_SDIVSHIFT;
mdiv &= S3C2410_PLLCON_MDIVMASK;
pdiv &= S3C2410_PLLCON_PDIVMASK;
sdiv &= S3C2410_PLLCON_SDIVMASK;
mdiv &= S3C2410_PLLCON_MDIVMASK;
pdiv &= S3C2410_PLLCON_PDIVMASK;
sdiv &= S3C2410_PLLCON_SDIVMASK;
return (baseclk * (mdiv + 8)) / ((pdiv + 2) << sdiv);
return (baseclk * (mdiv + 8)) / ((pdiv + 2) << sdiv);
}
#endif /* __ASSEMBLY__ */
......@@ -95,7 +96,7 @@ s3c2410_get_pll(int pllval, int baseclk)
#ifdef CONFIG_CPU_S3C2440
/* extra registers */
#define S3C2440_CAMDIVN S3C2410_CLKREG(0x14)
#define S3C2440_CAMDIVN S3C2410_CLKREG(0x18)
#define S3C2440_CLKCON_CAMERA (1<<19)
#define S3C2440_CLKCON_AC97 (1<<20)
......
......@@ -11,6 +11,7 @@
*
* Changelog:
* 11-Aug-2004 BJD Created file
* 10-Feb-2005 BJD Fix GPJ12 definition (Guillaume Gourat)
*/
......@@ -94,7 +95,7 @@
#define S3C2440_GPJ12 S3C2410_GPIONO(S3C2440_GPIO_BANKJ, 12)
#define S3C2440_GPJ12_INP (0x00 << 24)
#define S3C2440_GPJ12_OUTP (0x01 << 24)
#define S3C2440_GPJ12_CAMCLKOUT (0x02 << 24)
#define S3C2440_GPJ12_CAMRESET (0x02 << 24)
#endif /* __ASM_ARCH_REGS_GPIOJ_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment