diff options
author | Anton Vorontsov <avorontsov@ru.mvista.com> | 2008-04-28 05:14:50 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-28 11:58:35 -0400 |
commit | 7f29b87a7779505288a31df16ba84a85fc1ae93c (patch) | |
tree | 856acab5434b7e712010b5a13c2d5e6bfc55c3b5 /drivers/video | |
parent | e4c690e061b909127ab0f12e929f82f3f39ec953 (diff) |
powerpc: offb: add support for foreign endianness
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/offb.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/video/offb.c b/drivers/video/offb.c index 452433d46973..d7b3dcc0dc43 100644 --- a/drivers/video/offb.c +++ b/drivers/video/offb.c | |||
@@ -248,7 +248,7 @@ static void __iomem *offb_map_reg(struct device_node *np, int index, | |||
248 | static void __init offb_init_fb(const char *name, const char *full_name, | 248 | static void __init offb_init_fb(const char *name, const char *full_name, |
249 | int width, int height, int depth, | 249 | int width, int height, int depth, |
250 | int pitch, unsigned long address, | 250 | int pitch, unsigned long address, |
251 | struct device_node *dp) | 251 | int foreign_endian, struct device_node *dp) |
252 | { | 252 | { |
253 | unsigned long res_size = pitch * height * (depth + 7) / 8; | 253 | unsigned long res_size = pitch * height * (depth + 7) / 8; |
254 | struct offb_par *par = &default_par; | 254 | struct offb_par *par = &default_par; |
@@ -397,7 +397,7 @@ static void __init offb_init_fb(const char *name, const char *full_name, | |||
397 | info->screen_base = ioremap(address, fix->smem_len); | 397 | info->screen_base = ioremap(address, fix->smem_len); |
398 | info->par = par; | 398 | info->par = par; |
399 | info->pseudo_palette = (void *) (info + 1); | 399 | info->pseudo_palette = (void *) (info + 1); |
400 | info->flags = FBINFO_DEFAULT; | 400 | info->flags = FBINFO_DEFAULT | foreign_endian; |
401 | 401 | ||
402 | fb_alloc_cmap(&info->cmap, 256, 0); | 402 | fb_alloc_cmap(&info->cmap, 256, 0); |
403 | 403 | ||
@@ -424,6 +424,15 @@ static void __init offb_init_nodriver(struct device_node *dp, int no_real_node) | |||
424 | u64 rstart, address = OF_BAD_ADDR; | 424 | u64 rstart, address = OF_BAD_ADDR; |
425 | const u32 *pp, *addrp, *up; | 425 | const u32 *pp, *addrp, *up; |
426 | u64 asize; | 426 | u64 asize; |
427 | int foreign_endian = 0; | ||
428 | |||
429 | #ifdef __BIG_ENDIAN | ||
430 | if (of_get_property(dp, "little-endian", NULL)) | ||
431 | foreign_endian = FBINFO_FOREIGN_ENDIAN; | ||
432 | #else | ||
433 | if (of_get_property(dp, "big-endian", NULL)) | ||
434 | foreign_endian = FBINFO_FOREIGN_ENDIAN; | ||
435 | #endif | ||
427 | 436 | ||
428 | pp = of_get_property(dp, "linux,bootx-depth", &len); | 437 | pp = of_get_property(dp, "linux,bootx-depth", &len); |
429 | if (pp == NULL) | 438 | if (pp == NULL) |
@@ -509,7 +518,7 @@ static void __init offb_init_nodriver(struct device_node *dp, int no_real_node) | |||
509 | offb_init_fb(no_real_node ? "bootx" : dp->name, | 518 | offb_init_fb(no_real_node ? "bootx" : dp->name, |
510 | no_real_node ? "display" : dp->full_name, | 519 | no_real_node ? "display" : dp->full_name, |
511 | width, height, depth, pitch, address, | 520 | width, height, depth, pitch, address, |
512 | no_real_node ? NULL : dp); | 521 | foreign_endian, no_real_node ? NULL : dp); |
513 | } | 522 | } |
514 | } | 523 | } |
515 | 524 | ||