diff options
author | York Sun <yorksun@freescale.com> | 2008-04-28 05:15:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-28 11:58:40 -0400 |
commit | 6f90a8bdd17e63fb27b4f6d50e8a2919704ea254 (patch) | |
tree | 0ddc1f609eb63b3f54673d32f7dc15ed1c20fe49 /arch/powerpc/sysdev | |
parent | 9b53a9e28a34ed82516191dc46ae018e0e899546 (diff) |
powerpc: Add DIU platform code for MPC8610HPCD
Add platform code to support Freescale DIU. The platform code includes
framebuffer memory allocation, pixel format, monitor port, etc.
Signed-off-by: York Sun <yorksun@freescale.com>
Signed-off-by: Timur Tabi <timur@freescale.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/powerpc/sysdev')
-rw-r--r-- | arch/powerpc/sysdev/fsl_soc.c | 41 | ||||
-rw-r--r-- | arch/powerpc/sysdev/fsl_soc.h | 23 |
2 files changed, 64 insertions, 0 deletions
diff --git a/arch/powerpc/sysdev/fsl_soc.c b/arch/powerpc/sysdev/fsl_soc.c index 5c1b246aaccc..7b45670c7af3 100644 --- a/arch/powerpc/sysdev/fsl_soc.c +++ b/arch/powerpc/sysdev/fsl_soc.c | |||
@@ -892,3 +892,44 @@ void fsl_rstcr_restart(char *cmd) | |||
892 | while (1) ; | 892 | while (1) ; |
893 | } | 893 | } |
894 | #endif | 894 | #endif |
895 | |||
896 | #if defined(CONFIG_FB_FSL_DIU) || defined(CONFIG_FB_FSL_DIU_MODULE) | ||
897 | struct platform_diu_data_ops diu_ops = { | ||
898 | .diu_size = 1280 * 1024 * 4, /* default one 1280x1024 buffer */ | ||
899 | }; | ||
900 | EXPORT_SYMBOL(diu_ops); | ||
901 | |||
902 | int __init preallocate_diu_videomemory(void) | ||
903 | { | ||
904 | pr_debug("diu_size=%lu\n", diu_ops.diu_size); | ||
905 | |||
906 | diu_ops.diu_mem = __alloc_bootmem(diu_ops.diu_size, 8, 0); | ||
907 | if (!diu_ops.diu_mem) { | ||
908 | printk(KERN_ERR "fsl-diu: cannot allocate %lu bytes\n", | ||
909 | diu_ops.diu_size); | ||
910 | return -ENOMEM; | ||
911 | } | ||
912 | |||
913 | pr_debug("diu_mem=%p\n", diu_ops.diu_mem); | ||
914 | |||
915 | rh_init(&diu_ops.diu_rh_info, 4096, ARRAY_SIZE(diu_ops.diu_rh_block), | ||
916 | diu_ops.diu_rh_block); | ||
917 | return rh_attach_region(&diu_ops.diu_rh_info, | ||
918 | (unsigned long) diu_ops.diu_mem, | ||
919 | diu_ops.diu_size); | ||
920 | } | ||
921 | |||
922 | static int __init early_parse_diufb(char *p) | ||
923 | { | ||
924 | if (!p) | ||
925 | return 1; | ||
926 | |||
927 | diu_ops.diu_size = _ALIGN_UP(memparse(p, &p), 8); | ||
928 | |||
929 | pr_debug("diu_size=%lu\n", diu_ops.diu_size); | ||
930 | |||
931 | return 0; | ||
932 | } | ||
933 | early_param("diufb", early_parse_diufb); | ||
934 | |||
935 | #endif | ||
diff --git a/arch/powerpc/sysdev/fsl_soc.h b/arch/powerpc/sysdev/fsl_soc.h index 74c4a9657b33..52c831fa1886 100644 --- a/arch/powerpc/sysdev/fsl_soc.h +++ b/arch/powerpc/sysdev/fsl_soc.h | |||
@@ -17,5 +17,28 @@ extern int fsl_spi_init(struct spi_board_info *board_infos, | |||
17 | void (*deactivate_cs)(u8 cs, u8 polarity)); | 17 | void (*deactivate_cs)(u8 cs, u8 polarity)); |
18 | 18 | ||
19 | extern void fsl_rstcr_restart(char *cmd); | 19 | extern void fsl_rstcr_restart(char *cmd); |
20 | |||
21 | #if defined(CONFIG_FB_FSL_DIU) || defined(CONFIG_FB_FSL_DIU_MODULE) | ||
22 | #include <linux/bootmem.h> | ||
23 | #include <asm/rheap.h> | ||
24 | struct platform_diu_data_ops { | ||
25 | rh_block_t diu_rh_block[16]; | ||
26 | rh_info_t diu_rh_info; | ||
27 | unsigned long diu_size; | ||
28 | void *diu_mem; | ||
29 | |||
30 | unsigned int (*get_pixel_format) (unsigned int bits_per_pixel, | ||
31 | int monitor_port); | ||
32 | void (*set_gamma_table) (int monitor_port, char *gamma_table_base); | ||
33 | void (*set_monitor_port) (int monitor_port); | ||
34 | void (*set_pixel_clock) (unsigned int pixclock); | ||
35 | ssize_t (*show_monitor_port) (int monitor_port, char *buf); | ||
36 | int (*set_sysfs_monitor_port) (int val); | ||
37 | }; | ||
38 | |||
39 | extern struct platform_diu_data_ops diu_ops; | ||
40 | int __init preallocate_diu_videomemory(void); | ||
41 | #endif | ||
42 | |||
20 | #endif | 43 | #endif |
21 | #endif | 44 | #endif |