2 * (C) Copyright 2012 Lothar Waßmann <LW@KARO-electronics.de>
4 * See file CREDITS for list of people who contributed to this
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * version 2 as published by the Free Software Foundation.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
19 #ifdef CONFIG_SYS_LVDS_IF
25 #ifdef CONFIG_OF_LIBFDT
26 void karo_fdt_remove_node(void *blob, const char *node);
27 void karo_fdt_move_fdt(void);
28 void karo_fdt_fixup_touchpanel(void *blob, const char *panels[],
30 void karo_fdt_fixup_usb_otg(void *blob, const char *node, const char *phy);
31 void karo_fdt_fixup_flexcan(void *blob, int xcvr_present);
32 void karo_fdt_del_prop(void *blob, const char *compat, phys_addr_t offs,
34 void karo_fdt_enable_node(void *blob, const char *node, int enable);
35 int karo_fdt_get_fb_mode(void *blob, const char *name,
36 struct fb_videomode *fb_mode);
37 int karo_fdt_update_fb_mode(void *blob, const char *name);
38 int karo_fdt_create_fb_mode(void *blob, const char *name,
39 struct fb_videomode *mode);
40 int karo_fdt_get_lcd_bus_width(const void *blob, int default_width);
41 int karo_fdt_get_lvds_mapping(const void *blob, int default_mapping);
42 u8 karo_fdt_get_lvds_channels(const void *blob);
43 int karo_fdt_get_backlight_polarity(const void *blob);
45 static inline void karo_fdt_remove_node(void *blob, const char *node)
48 static inline void karo_fdt_move_fdt(void)
51 static inline void karo_fdt_fixup_touchpanel(void *blob, const char *panels[],
55 static inline void karo_fdt_fixup_usb_otg(void *blob, const char *node,
59 static inline void karo_fdt_fixup_flexcan(void *blob, int xcvr_present)
62 static inline void karo_fdt_del_prop(void *blob, const char *compat,
63 phys_addr_t offs, const char *prop)
66 static inline void karo_fdt_enable_node(void *blob, const char *node,
70 static inline int karo_fdt_get_fb_mode(void *blob, const char *name,
71 struct fb_videomode *fb_mode)
75 static inline int karo_fdt_update_fb_mode(void *blob, const char *name)
79 static inline int karo_fdt_create_fb_mode(void *blob,
81 struct fb_videomode *mode)
85 static inline int karo_fdt_get_lcd_bus_width(const void *blob, int default_width)
89 static inline int karo_fdt_get_lvds_mapping(const void *blob, int default_mapping)
91 return default_mapping;
93 static inline u8 karo_fdt_get_lvds_channels(const void *blob)
97 static inline int karo_fdt_get_backlight_polarity(const void *blob)
99 return getenv_yesno("backlight_polarity");
103 static inline const char *karo_get_vmode(const char *video_mode)
105 const char *vmode = NULL;
107 if (video_mode == NULL || strlen(video_mode) == 0)
110 vmode = strchr(video_mode, ':');
111 return vmode ? vmode + 1 : video_mode;
114 #ifdef CONFIG_SPLASH_SCREEN
115 int karo_load_splashimage(int mode);
117 static inline int karo_load_splashimage(int mode)
123 #ifdef CONFIG_CMD_NAND
124 int karo_load_nand_part(const char *part, void *addr, size_t len);
126 static inline int karo_load_nand_part(const char *part, void *addr, size_t len)
132 #ifdef CONFIG_CMD_MMC
133 int karo_load_mmc_part(const char *part, void *addr, size_t len);
135 static inline int karo_load_mmc_part(const char *part, void *addr, size_t len)
141 static inline int karo_load_part(const char *part, void *addr, size_t len)
145 ret = karo_load_nand_part(part, addr, len);
146 if (ret == -EOPNOTSUPP)
147 return karo_load_mmc_part(part, addr, len);