karo_set_fdtsize(blob);
}
-static int karo_fdt_flexcan_enabled(void *blob)
+static inline int karo_fdt_flexcan_enabled(void *blob)
{
const char *can_ifs[] = {
"can0",
return 0;
}
-static void karo_fdt_set_lcd_pins(void *blob, const char *name)
+static inline void karo_fdt_set_lcd_pins(void *blob, const char *name)
{
int off = fdt_path_offset(blob, name);
u32 ph;
{
const char *xcvr_status = "disabled";
+#ifndef CONFIG_SYS_LVDS_IF
if (xcvr_present) {
if (karo_fdt_flexcan_enabled(blob)) {
karo_fdt_set_lcd_pins(blob, "lcdif_23bit_pins_a");
karo_fdt_set_lcd_pins(blob, "lcdif_24bit_pins_a");
}
+#endif
fdt_find_and_setprop(blob, "reg_can_xcvr", "status",
xcvr_status, strlen(xcvr_status) + 1, 1);
}
return ret;
}
-static int karo_fdt_set_display_alias(void *blob, const char *path,
- const char *name)
-{
- int ret;
- int off;
- size_t size = strlen(path) + strlen(name) + 2;
- char *display;
-
- display = malloc(size);
- if (display == NULL) {
- printf("%s: Failed to allocate buffer\n", __func__);
- return -ENOMEM;
- }
- sprintf(display, "%s/%s", path, name);
- if (strlen(display) != size - 1)
- hang();
- off = fdt_path_offset(blob, "/aliases");
- if (off == FDT_ERR_BADMAGIC)
- return -EINVAL;
- ret = fdt_resize(blob);
- if (ret < 0) {
- printf("%s: Failed to resize FDT: %s\n",
- __func__, fdt_strerror(ret));
- }
- if (off < 0) {
- off = fdt_add_subnode(blob, 0, "aliases");
- if (off < 0) {
- printf("%s: Failed to create 'aliases' node: %s\n",
- __func__, fdt_strerror(off));
- return off;
- }
- }
- ret = fdt_setprop_string(blob, off, "display", display);
- debug("setprop_string(display='%s') returned %d (%s)\n", display, ret,
- ret < 0 ? fdt_strerror(ret) : "OK");
- return ret;
-}
-
-const char *karo_fdt_set_display(const char *video_mode, const char *lcd_path,
- const char *lvds_path)
-{
- const char *vmode = NULL;
- int ret;
- void *blob = working_fdt;
-
- if (video_mode == NULL || strlen(video_mode) == 0)
- return NULL;
-
- vmode = strchr(video_mode, ':');
-
- if (lvds_path == NULL)
- return vmode ? vmode + 1 : video_mode;
-
- if (lvds_path != NULL && vmode != NULL) {
- if (strncmp(video_mode, "LVDS:", 5) == 0 ||
- strncmp(video_mode, "LVDS0:", 6) == 0) {
- ret = karo_fdt_set_display_alias(blob, lvds_path,
- "lvds-channel@0");
- } else if (strncmp(video_mode, "LVDS1:", 6) == 0) {
- ret = karo_fdt_set_display_alias(blob, lvds_path,
- "lvds-channel@1");
- } else {
- debug("%s: Syntax error in video_mode\n", __func__);
- return vmode + 1;
- }
- video_mode = vmode + 1;
- } else {
- int off;
-
- ret = karo_fdt_set_display_alias(blob, lcd_path,
- "display@di0");
-
- off = fdt_path_offset(blob, "lvds0");
- if (off >= 0) {
- ret = fdt_set_node_status(blob, off,
- FDT_STATUS_DISABLED, 0);
- }
- off = fdt_path_offset(blob, "lvds1");
- if (off >= 0) {
- ret = fdt_set_node_status(blob, off,
- FDT_STATUS_DISABLED, 0);
- }
- }
- if (ret) {
- printf("%s: failed to set 'display' alias: %s\n",
- __func__, fdt_strerror(ret));
- }
- return video_mode;
-}
-
int karo_fdt_update_fb_mode(void *blob, const char *name)
{
int off = fdt_path_offset(blob, "display");
int karo_fdt_update_fb_mode(void *blob, const char *name);
int karo_fdt_create_fb_mode(void *blob, const char *name,
struct fb_videomode *mode);
-const char *karo_fdt_set_display(const char *video_mode, const char *lcd_path,
- const char *lvds_path);
#else
static inline void karo_fdt_remove_node(void *blob, const char *node)
{
{
return 0;
}
-static inline const char *karo_fdt_set_display(const char *video_mode, const char *lcd_path,
- const char *lvds_path)
+#endif
+
+static inline const char *karo_get_vmode(const char *video_mode)
{
- return video_mode;
+ const char *vmode = NULL;
+
+ if (video_mode == NULL || strlen(video_mode) == 0)
+ return NULL;
+
+ vmode = strchr(video_mode, ':');
+ return vmode ? vmode + 1 : video_mode;
}
-#endif
int karo_load_splashimage(int mode);
#include <lcd.h>
#include <netdev.h>
#include <mmc.h>
+#include <mxcfb.h>
#include <linux/list.h>
#include <linux/fb.h>
#include <asm/io.h>
val = readl(&cust[index * 8 + i]);
mac[i] = val >> shift;
}
- if (!is_valid_ether_addr(mac))
+ if (!is_valid_ether_addr(mac)) {
+ if (index == 0)
+ printf("No valid MAC address programmed\n");
return 0;
+ }
if (index == 0) {
printf("MAC addr from fuse: %pM\n", mac);
.upper_margin = 2,
.vsync_len = 10,
.lower_margin = 2,
+ .sync = FB_SYNC_CLK_LAT_FALL,
.vmode = FB_VMODE_NONINTERLACED,
},
{
void lcd_ctrl_init(void *lcdbase)
{
int color_depth = 24;
- char *vm;
+ const char *video_mode = karo_get_vmode(getenv("video_mode"));
+ const char *vm;
unsigned long val;
int refresh = 60;
struct fb_videomode *p = tx28_fb_modes;
return;
}
- if (tstc()) {
+ if (had_ctrlc()) {
debug("Disabling LCD\n");
lcd_enabled = 0;
+ setenv("splashimage", NULL);
return;
}
karo_fdt_move_fdt();
- vm = getenv("video_mode");
- if (vm == NULL) {
+ if (video_mode == NULL) {
debug("Disabling LCD\n");
lcd_enabled = 0;
return;
}
- if (karo_fdt_get_fb_mode(working_fdt, vm, &fb_mode) == 0) {
+ vm = video_mode;
+ if (karo_fdt_get_fb_mode(working_fdt, video_mode, &fb_mode) == 0) {
p = &fb_mode;
debug("Using video mode from FDT\n");
vm += strlen(vm);
+ if (fb_mode.xres > panel_info.vl_col ||
+ fb_mode.yres > panel_info.vl_row) {
+ printf("video resolution from DT: %dx%d exceeds hardware limits: %dx%d\n",
+ fb_mode.xres, fb_mode.yres,
+ panel_info.vl_col, panel_info.vl_row);
+ lcd_enabled = 0;
+ return;
+ }
}
if (p->name != NULL)
debug("Trying compiled-in video modes\n");
if (val > panel_info.vl_col)
val = panel_info.vl_col;
p->xres = val;
+ panel_info.vl_col = val;
xres_set = 1;
} else if (!yres_set) {
if (val > panel_info.vl_row)
val = panel_info.vl_row;
p->yres = val;
+ panel_info.vl_row = val;
yres_set = 1;
} else if (!bpp_set) {
switch (val) {
printf("\n");
return;
}
+ if (p->xres > panel_info.vl_col || p->yres > panel_info.vl_row) {
+ printf("video resolution: %dx%d exceeds hardware limits: %dx%d\n",
+ p->xres, p->yres, panel_info.vl_col, panel_info.vl_row);
+ lcd_enabled = 0;
+ return;
+ }
panel_info.vl_col = p->xres;
panel_info.vl_row = p->yres;
debug("Pixel clock set to %lu.%03lu MHz\n",
PICOS2KHZ(p->pixclock) / 1000, PICOS2KHZ(p->pixclock) % 1000);
+ if (p != &fb_mode) {
+ int ret;
+
+ debug("Creating new display-timing node from '%s'\n",
+ video_mode);
+ ret = karo_fdt_create_fb_mode(working_fdt, video_mode, p);
+ if (ret)
+ printf("Failed to create new display-timing node from '%s': %d\n",
+ video_mode, ret);
+ }
+
gpio_request_array(stk5_lcd_gpios, ARRAY_SIZE(stk5_lcd_gpios));
mxs_iomux_setup_multiple_pads(stk5_lcd_pads,
ARRAY_SIZE(stk5_lcd_pads));
color_depth, refresh);
if (karo_load_splashimage(0) == 0) {
- char vmode[32];
+ char vmode[128];
/* setup env variable for mxsfb display driver */
- snprintf(vmode, sizeof(vmode), "%dx%dMR-%d@%d",
- p->xres, p->yres, color_depth, refresh);
+ snprintf(vmode, sizeof(vmode),
+ "x:%d,y:%d,le:%d,ri:%d,up:%d,lo:%d,hs:%d,vs:%d,sync:%d,pclk:%d,depth:%d",
+ p->xres, p->yres, p->left_margin, p->right_margin,
+ p->upper_margin, p->lower_margin, p->hsync_len,
+ p->vsync_len, p->sync, p->pixclock, color_depth);
setenv("videomode", vmode);
debug("Initializing LCD controller\n");
return status && (strcmp(status, "okay") == 0);
}
-int board_late_init(void)
+static void tx28_init_mac(void)
{
int ret;
+
+ ret = fec_get_mac_addr(0);
+ if (ret < 0) {
+ printf("Failed to read FEC0 MAC address from OCOTP\n");
+ return;
+ }
+#ifdef CONFIG_FEC_MXC_MULTI
+ if (tx28_fec1_enabled()) {
+ ret = fec_get_mac_addr(1);
+ if (ret < 0) {
+ printf("Failed to read FEC1 MAC address from OCOTP\n");
+ return;
+ }
+ }
+#endif
+}
+
+int board_late_init(void)
+{
+ int ret = 0;
const char *baseboard;
karo_fdt_move_fdt();
baseboard = getenv("baseboard");
if (!baseboard)
- return 0;
+ goto exit;
+
+ printf("Baseboard: %s\n", baseboard);
if (strncmp(baseboard, "stk5", 4) == 0) {
- printf("Baseboard: %s\n", baseboard);
if ((strlen(baseboard) == 4) ||
strcmp(baseboard, "stk5-v3") == 0) {
stk5v3_board_init();
} else {
printf("WARNING: Unsupported baseboard: '%s'\n",
baseboard);
- return -EINVAL;
+ ret = -EINVAL;
}
- ret = fec_get_mac_addr(0);
- if (ret < 0) {
- printf("Failed to read FEC0 MAC address from OCOTP\n");
- return ret;
- }
-#ifdef CONFIG_FEC_MXC_MULTI
- if (tx28_fec1_enabled()) {
- ret = fec_get_mac_addr(1);
- if (ret < 0) {
- printf("Failed to read FEC1 MAC address from OCOTP\n");
- return ret;
- }
- }
-#endif
- return 0;
+exit:
+ tx28_init_mac();
+ clear_ctrlc();
+ return ret;
}
#define BOOT_CAUSE_MASK (RTC_PERSISTENT0_EXTERNAL_RESET | \
#ifdef CONFIG_FDT_FIXUP_PARTITIONS
#include <jffs2/jffs2.h>
#include <mtd_node.h>
-struct node_info tx28_nand_nodes[] = {
+static struct node_info tx28_nand_nodes[] = {
{ "fsl,imx28-gpmi-nand", MTD_DEV_TYPE_NAND, },
};
#else
{
const char *baseboard = getenv("baseboard");
int stk5_v5 = baseboard != NULL && (strcmp(baseboard, "stk5-v5") == 0);
+ const char *video_mode = karo_get_vmode(getenv("video_mode"));
#ifdef CONFIG_TX28_S
/* TX28-41xx (aka TX28S) has no external RTC
karo_fdt_remove_node(blob, "ds1339");
karo_fdt_remove_node(blob, "gpio5");
#endif
- if (stk5_v5) {
- karo_fdt_remove_node(blob, "stk5led");
- }
+ if (stk5_v5)
+ karo_fdt_enable_node(blob, "stk5led", 0);
fdt_fixup_mtdparts(blob, tx28_nand_nodes, ARRAY_SIZE(tx28_nand_nodes));
fdt_fixup_ethernet(blob);
ARRAY_SIZE(tx28_touchpanels));
karo_fdt_fixup_usb_otg(blob, "usbotg", "fsl,usbphy");
karo_fdt_fixup_flexcan(blob, stk5_v5);
- karo_fdt_update_fb_mode(blob, getenv("video_mode"));
+ karo_fdt_update_fb_mode(blob, video_mode);
}
#endif /* CONFIG_OF_BOARD_SETUP */
void lcd_ctrl_init(void *lcdbase)
{
int color_depth = 24;
- const char *video_mode = getenv("video_mode");
+ const char *video_mode = karo_get_vmode(getenv("video_mode"));
const char *vm;
unsigned long val;
int refresh = 60;
karo_fdt_move_fdt();
- vm = karo_fdt_set_display(video_mode, "/panel", NULL);
- if (vm == NULL) {
+ if (video_mode == NULL) {
debug("Disabling LCD\n");
lcd_enabled = 0;
return;
}
- video_mode = vm;
- if (karo_fdt_get_fb_mode(working_fdt, vm, &fb_mode) == 0) {
+ vm = video_mode;
+ if (karo_fdt_get_fb_mode(working_fdt, video_mode, &fb_mode) == 0) {
p = &fb_mode;
debug("Using video mode from FDT\n");
vm += strlen(vm);
baseboard);
ret = -EINVAL;
}
+
exit:
tx48_init_mac();
clear_ctrlc();
{
const char *baseboard = getenv("baseboard");
int stk5_v5 = baseboard != NULL && (strcmp(baseboard, "stk5-v5") == 0);
- const char *video_mode = getenv("video_mode");
+ const char *video_mode = karo_get_vmode(getenv("video_mode"));
fdt_fixup_mtdparts(blob, nodes, ARRAY_SIZE(nodes));
fdt_fixup_ethernet(blob);
karo_fdt_fixup_usb_otg(blob, "usb0", "phys");
karo_fdt_fixup_flexcan(blob, stk5_v5);
- video_mode = karo_fdt_set_display(video_mode, "/panel", NULL);
karo_fdt_update_fb_mode(blob, video_mode);
tx48_disable_watchdog();
};
static struct fb_videomode tx53_fb_modes[] = {
+#ifndef CONFIG_SYS_LVDS_IF
{
/* Standard VGA timing */
.name = "VGA",
.lower_margin = 525 - 480 - 35,
.sync = FB_SYNC_CLK_LAT_FALL,
},
+#else
+ {
+ /* HannStar HSD100PXN1
+ * 202.7m mm x 152.06 mm display area.
+ */
+ .name = "HSD100PXN1",
+ .refresh = 60,
+ .xres = 1024,
+ .yres = 768,
+ .pixclock = KHZ2PICOS(65000),
+ .left_margin = 0,
+ .hsync_len = 0,
+ .right_margin = 320,
+ .upper_margin = 0,
+ .vsync_len = 0,
+ .lower_margin = 38,
+ .sync = FB_SYNC_CLK_LAT_FALL,
+ },
+#endif
{
/* unnamed entry for assigning parameters parsed from 'video_mode' string */
.refresh = 60,
udelay(100);
gpio_set_value(TX53_LCD_RST_GPIO, 1);
udelay(300000);
- gpio_set_value(TX53_LCD_BACKLIGHT_GPIO, 0);
+ gpio_set_value(TX53_LCD_BACKLIGHT_GPIO, is_lvds());
}
}
{
if (lcd_enabled) {
debug("Switching LCD off\n");
- gpio_set_value(TX53_LCD_BACKLIGHT_GPIO, 1);
+ gpio_set_value(TX53_LCD_BACKLIGHT_GPIO, !is_lvds());
gpio_set_value(TX53_LCD_RST_GPIO, 0);
gpio_set_value(TX53_LCD_PWR_GPIO, 0);
}
MX53_PAD_GPIO_1__GPIO1_1 | MX53_GPIO_PAD_CTRL,
/* Display */
+#ifndef CONFIG_SYS_LVDS_IF
+ /* LCD option */
MX53_PAD_DI0_DISP_CLK__IPU_DI0_DISP_CLK,
MX53_PAD_DI0_PIN15__IPU_DI0_PIN15,
MX53_PAD_DI0_PIN2__IPU_DI0_PIN2,
MX53_PAD_DISP0_DAT21__IPU_DISP0_DAT_21,
MX53_PAD_DISP0_DAT22__IPU_DISP0_DAT_22,
MX53_PAD_DISP0_DAT23__IPU_DISP0_DAT_23,
-
+#else
/* LVDS option */
MX53_PAD_LVDS1_TX3_P__LDB_LVDS1_TX3,
MX53_PAD_LVDS1_TX2_P__LDB_LVDS1_TX2,
MX53_PAD_LVDS0_TX2_P__LDB_LVDS0_TX2,
MX53_PAD_LVDS0_TX1_P__LDB_LVDS0_TX1,
MX53_PAD_LVDS0_TX0_P__LDB_LVDS0_TX0,
+#endif
};
static const struct gpio stk5_lcd_gpios[] = {
void lcd_ctrl_init(void *lcdbase)
{
int color_depth = 24;
- const char *video_mode = getenv("video_mode");
+ const char *video_mode = karo_get_vmode(getenv("video_mode"));
const char *vm;
unsigned long val;
int refresh = 60;
struct fb_videomode *p = &tx53_fb_modes[0];
struct fb_videomode fb_mode;
int xres_set = 0, yres_set = 0, bpp_set = 0, refresh_set = 0;
- int pix_fmt = 0;
- ipu_di_clk_parent_t di_clk_parent = DI_PCLK_PLL3;
+ int pix_fmt = is_lvds() ? IPU_PIX_FMT_LVDS666 : IPU_PIX_FMT_RGB24;
+ ipu_di_clk_parent_t di_clk_parent = is_lvds() ? DI_PCLK_LDB : DI_PCLK_PLL3;
unsigned long di_clk_rate = 65000000;
if (!lcd_enabled) {
karo_fdt_move_fdt();
- vm = karo_fdt_set_display(video_mode, "/soc", "/soc/aips/ldb");
- if (vm == NULL) {
+ if (video_mode == NULL) {
debug("Disabling LCD\n");
lcd_enabled = 0;
return;
}
- video_mode = vm;
- if (karo_fdt_get_fb_mode(working_fdt, vm, &fb_mode) == 0) {
+ vm = video_mode;
+ if (karo_fdt_get_fb_mode(working_fdt, video_mode, &fb_mode) == 0) {
p = &fb_mode;
debug("Using video mode from FDT\n");
vm += strlen(vm);
switch (val) {
case 32:
case 24:
- if (pix_fmt == IPU_PIX_FMT_LVDS666)
+ if (is_lvds())
pix_fmt = IPU_PIX_FMT_LVDS888;
/* fallthru */
case 16:
break;
case 18:
- if (pix_fmt == IPU_PIX_FMT_LVDS666) {
+ if (is_lvds()) {
color_depth = val;
break;
}
default:
if (!pix_fmt) {
- char *tmp;
+ char *tmp = strchr(vm, ':');
- if (strncmp(vm, "LVDS", 4) == 0) {
- pix_fmt = IPU_PIX_FMT_LVDS666;
- di_clk_parent = DI_PCLK_LDB;
- } else {
- pix_fmt = IPU_PIX_FMT_RGB24;
- }
- tmp = strchr(vm, ':');
if (tmp)
vm = tmp;
}
ARRAY_SIZE(stk5_lcd_pads));
debug("Initializing FB driver\n");
- if (!pix_fmt)
- pix_fmt = IPU_PIX_FMT_RGB24;
- else if (pix_fmt == IPU_PIX_FMT_LVDS666) {
+#ifdef CONFIG_SYS_LVDS_IF
+ if (pix_fmt == IPU_PIX_FMT_LVDS666) {
writel(0x01, IOMUXC_BASE_ADDR + 8);
} else if (pix_fmt == IPU_PIX_FMT_LVDS888) {
writel(0x21, IOMUXC_BASE_ADDR + 8);
}
- if (pix_fmt != IPU_PIX_FMT_RGB24) {
+ {
struct mxc_ccm_reg *ccm_regs = (struct mxc_ccm_reg *)CCM_BASE_ADDR;
/* enable LDB & DI0 clock */
writel(readl(&ccm_regs->CCGR6) | (3 << 28) | (3 << 10),
&ccm_regs->CCGR6);
}
-
+#endif
if (karo_load_splashimage(0) == 0) {
int ret;
return;
}
- eth_setenv_enetaddr("ethaddr", mac);
printf("MAC addr from fuse: %pM\n", mac);
+ eth_setenv_enetaddr("ethaddr", mac);
}
int board_late_init(void)
{
tx53_print_cpuinfo();
- printf("Board: Ka-Ro TX53-xx3%s\n",
- TX53_MOD_SUFFIX);
+ printf("Board: Ka-Ro TX53-x%d3%s\n",
+ is_lvds(), TX53_MOD_SUFFIX);
return 0;
}
}
#endif /* CONFIG_SYS_TX53_HWREV_2 */
+#ifndef CONFIG_SYS_LVDS_IF
+static inline void tx53_fdt_fixup_sata(void *blob)
+{
+ karo_fdt_enable_node(blob, "/soc/sata", 0);
+}
+#else
+static inline void tx53_fdt_fixup_sata(void *blob)
+{
+}
+#endif
+
static const char *tx53_touchpanels[] = {
"ti,tsc2007",
"edt,edt-ft5x06",
{
const char *baseboard = getenv("baseboard");
int stk5_v5 = baseboard != NULL && (strcmp(baseboard, "stk5-v5") == 0);
- const char *video_mode = getenv("video_mode");
+ const char *video_mode = karo_get_vmode(getenv("video_mode"));
fdt_fixup_mtdparts(blob, nodes, ARRAY_SIZE(nodes));
fdt_fixup_ethernet(blob);
karo_fdt_fixup_usb_otg(blob, "fsl,imx-otg", "fsl,usbphy");
karo_fdt_fixup_flexcan(blob, stk5_v5);
tx53_fixup_rtc(blob);
- video_mode = karo_fdt_set_display(video_mode, "/soc", "/soc/aips/ldb");
karo_fdt_update_fb_mode(blob, video_mode);
}
#endif /* CONFIG_OF_BOARD_SETUP */
};
static struct fb_videomode tx6_fb_modes[] = {
+#ifndef CONFIG_SYS_LVDS_IF
{
/* Standard VGA timing */
.name = "VGA",
.lower_margin = 525 - 480 - 35,
.sync = FB_SYNC_CLK_LAT_FALL,
},
+#else
+ {
+ /* HannStar HSD100PXN1
+ * 202.7m mm x 152.06 mm display area.
+ */
+ .name = "HSD100PXN1",
+ .refresh = 60,
+ .xres = 1024,
+ .yres = 768,
+ .pixclock = KHZ2PICOS(65000),
+ .left_margin = 0,
+ .hsync_len = 0,
+ .right_margin = 320,
+ .upper_margin = 0,
+ .vsync_len = 0,
+ .lower_margin = 38,
+ .sync = FB_SYNC_CLK_LAT_FALL,
+ },
+#endif
{
/* unnamed entry for assigning parameters parsed from 'video_mode' string */
.refresh = 60,
udelay(100);
gpio_set_value(TX6_LCD_RST_GPIO, 1);
udelay(300000);
- gpio_set_value(TX6_LCD_BACKLIGHT_GPIO, 0);
+ gpio_set_value(TX6_LCD_BACKLIGHT_GPIO, is_lvds());
}
}
{
if (lcd_enabled) {
debug("Switching LCD off\n");
- gpio_set_value(TX6_LCD_BACKLIGHT_GPIO, 1);
+ gpio_set_value(TX6_LCD_BACKLIGHT_GPIO, !is_lvds());
gpio_set_value(TX6_LCD_RST_GPIO, 0);
gpio_set_value(TX6_LCD_PWR_GPIO, 0);
}
void lcd_ctrl_init(void *lcdbase)
{
int color_depth = 24;
- const char *video_mode = getenv("video_mode");
+ const char *video_mode = karo_get_vmode(getenv("video_mode"));
const char *vm;
unsigned long val;
int refresh = 60;
struct fb_videomode *p = &tx6_fb_modes[0];
struct fb_videomode fb_mode;
int xres_set = 0, yres_set = 0, bpp_set = 0, refresh_set = 0;
- int pix_fmt = 0;
- ipu_di_clk_parent_t di_clk_parent = DI_PCLK_PLL3;
+ int pix_fmt = is_lvds() ? IPU_PIX_FMT_LVDS666 : IPU_PIX_FMT_RGB24;
unsigned long di_clk_rate = 65000000;
if (!lcd_enabled) {
karo_fdt_move_fdt();
- vm = karo_fdt_set_display(video_mode, "", "/soc/aips-bus/ldb");
- if (vm == NULL) {
+ if (video_mode == NULL) {
debug("Disabling LCD\n");
lcd_enabled = 0;
return;
}
- video_mode = vm;
- if (karo_fdt_get_fb_mode(working_fdt, vm, &fb_mode) == 0) {
+ vm = video_mode;
+ if (karo_fdt_get_fb_mode(working_fdt, video_mode, &fb_mode) == 0) {
p = &fb_mode;
debug("Using video mode from FDT\n");
vm += strlen(vm);
break;
default:
- if (!pix_fmt) {
- char *tmp;
-
- if (strncmp(vm, "LVDS", 4) == 0) {
- pix_fmt = IPU_PIX_FMT_LVDS666;
- di_clk_parent = DI_PCLK_LDB;
- } else {
- pix_fmt = IPU_PIX_FMT_RGB24;
- }
- tmp = strchr(vm, ':');
- if (tmp)
- vm = tmp;
- }
if (*vm != '\0')
vm++;
}
p->pixclock = KHZ2PICOS(refresh *
(p->xres + p->left_margin + p->right_margin + p->hsync_len) *
- (p->yres + p->upper_margin + p->lower_margin + p->vsync_len)
- / 1000);
+ (p->yres + p->upper_margin + p->lower_margin + p->vsync_len) /
+ 1000);
debug("Pixel clock set to %lu.%03lu MHz\n",
- PICOS2KHZ(p->pixclock) / 1000,
- PICOS2KHZ(p->pixclock) % 1000);
+ PICOS2KHZ(p->pixclock) / 1000, PICOS2KHZ(p->pixclock) % 1000);
if (p != &fb_mode) {
int ret;
ARRAY_SIZE(stk5_lcd_pads));
debug("Initializing FB driver\n");
- if (!pix_fmt)
- pix_fmt = IPU_PIX_FMT_RGB24;
- else if (pix_fmt == IPU_PIX_FMT_LVDS666) {
+#ifdef CONFIG_SYS_LVDS_IF
+ if (pix_fmt == IPU_PIX_FMT_LVDS666) {
writel(0x01, IOMUXC_BASE_ADDR + 8);
} else if (pix_fmt == IPU_PIX_FMT_LVDS888) {
writel(0x21, IOMUXC_BASE_ADDR + 8);
}
- if (pix_fmt != IPU_PIX_FMT_RGB24) {
+ {
struct mxc_ccm_reg *ccm_regs = (struct mxc_ccm_reg *)CCM_BASE_ADDR;
/* enable LDB & DI0 clock */
writel(readl(&ccm_regs->CCGR3) | MXC_CCM_CCGR3_LDB_DI0_MASK |
MXC_CCM_CCGR3_IPU1_IPU_DI0_MASK,
&ccm_regs->CCGR3);
}
-
+#endif
if (karo_load_splashimage(0) == 0) {
debug("Initializing LCD controller\n");
- ipuv3_fb_init(p, 0, pix_fmt, di_clk_parent, di_clk_rate, -1);
+ ipuv3_fb_init(p, 0, pix_fmt, DI_PCLK_PLL3, di_clk_rate, -1);
} else {
debug("Skipping initialization of LCD controller\n");
}
tx6qdl_print_cpuinfo();
- printf("Board: Ka-Ro TX6%c-%dx1%d\n",
+ printf("Board: Ka-Ro TX6%c-%d%d1%d\n",
cpu_variant == MXC_CPU_MX6Q ? 'Q' : 'U',
cpu_variant == MXC_CPU_MX6Q ? 1 : 8,
- 1 - PHYS_SDRAM_1_WIDTH / 64);
+ is_lvds(), 1 - PHYS_SDRAM_1_WIDTH / 64);
return 0;
}
static struct node_info nodes[] = {
{ "fsl,imx6q-gpmi-nand", MTD_DEV_TYPE_NAND, },
};
-
#else
#define fdt_fixup_mtdparts(b,n,c) do { } while (0)
#endif
"edt,edt-ft5x06",
};
+#ifndef CONFIG_SYS_LVDS_IF
+static inline void tx6_fdt_fixup_sata(void *blob)
+{
+ karo_fdt_enable_node(blob, "/soc/sata", 0);
+}
+#else
+static inline void tx6_fdt_fixup_sata(void *blob)
+{
+}
+#endif
+
void ft_board_setup(void *blob, bd_t *bd)
{
const char *baseboard = getenv("baseboard");
int stk5_v5 = baseboard != NULL && (strcmp(baseboard, "stk5-v5") == 0);
- const char *video_mode = getenv("video_mode");
+ const char *video_mode = karo_get_vmode(getenv("video_mode"));
- karo_fdt_enable_node(blob, "stk5led", !stk5_v5);
+ if (stk5_v5)
+ karo_fdt_enable_node(blob, "stk5led", 0);
fdt_fixup_mtdparts(blob, nodes, ARRAY_SIZE(nodes));
fdt_fixup_ethernet(blob);
ARRAY_SIZE(tx6_touchpanels));
karo_fdt_fixup_usb_otg(blob, "usbotg", "fsl,usbphy");
karo_fdt_fixup_flexcan(blob, stk5_v5);
+ tx6_fdt_fixup_sata(blob);
- video_mode = karo_fdt_set_display(video_mode, "", "/soc/aips-bus/ldb");
karo_fdt_update_fb_mode(blob, video_mode);
}
#endif /* CONFIG_OF_BOARD_SETUP */
cgtqmx6qeval arm armv7 cgtqmx6eval congatec mx6 cgtqmx6eval:IMX_CONFIG=board/freescale/imx/ddr/mx6q_4x_mt41j128.cfg,MX6Q
tx51-8xx0 arm armv7 tx51 karo mx5 tx51:SYS_CPU_CLK=800,NR_DRAM_BANKS=1
tx51-8xx1_2 arm armv7 tx51 karo mx5 tx51:SYS_CPU_CLK=800,NR_DRAM_BANKS=2
-tx53-xx30 arm armv7 tx53 karo mx5 tx53:NR_DRAM_BANKS=1
-tx53-xx31 arm armv7 tx53 karo mx5 tx53:NR_DRAM_BANKS=2
-tx6u-8x10 arm armv7 tx6 karo mx6 tx6:MX6DL
-tx6u-8x10_mfg arm armv7 tx6 karo mx6 tx6:MX6DL,MFG
-tx6u-8x10_noenv arm armv7 tx6 karo mx6 tx6:MX6DL,ENV_IS_NOWHERE
-tx6u-8x11 arm armv7 tx6 karo mx6 tx6:MX6DL,SYS_SDRAM_BUS_WIDTH=32
-tx6u-8x11_mfg arm armv7 tx6 karo mx6 tx6:MX6DL,SYS_SDRAM_BUS_WIDTH=32,MFG
-tx6u-8x11_noenv arm armv7 tx6 karo mx6 tx6:MX6DL,SYS_SDRAM_BUS_WIDTH=32,ENV_IS_NOWHERE
-tx6q-1x10 arm armv7 tx6 karo mx6 tx6:MX6Q
-tx6q-1x10_mfg arm armv7 tx6 karo mx6 tx6:MX6Q,MFG
-tx6q-1x10_noenv arm armv7 tx6 karo mx6 tx6:MX6Q,ENV_IS_NOWHERE
+tx53-x030 arm armv7 tx53 karo mx5 tx53:NR_DRAM_BANKS=1
+tx53-x031 arm armv7 tx53 karo mx5 tx53:NR_DRAM_BANKS=2
+tx53-x130 arm armv7 tx53 karo mx5 tx53:NR_DRAM_BANKS=1,SYS_LVDS_IF
+tx53-x131 arm armv7 tx53 karo mx5 tx53:NR_DRAM_BANKS=2,SYS_LVDS_IF
+tx6u-8010 arm armv7 tx6 karo mx6 tx6:MX6DL
+tx6u-8010_mfg arm armv7 tx6 karo mx6 tx6:MX6DL,MFG
+tx6u-8010_noenv arm armv7 tx6 karo mx6 tx6:MX6DL,ENV_IS_NOWHERE
+tx6u-8011 arm armv7 tx6 karo mx6 tx6:MX6DL,SYS_SDRAM_BUS_WIDTH=32
+tx6u-8011_mfg arm armv7 tx6 karo mx6 tx6:MX6DL,SYS_SDRAM_BUS_WIDTH=32,MFG
+tx6u-8011_noenv arm armv7 tx6 karo mx6 tx6:MX6DL,SYS_SDRAM_BUS_WIDTH=32,ENV_IS_NOWHERE
+tx6q-1010 arm armv7 tx6 karo mx6 tx6:MX6Q
+tx6q-1010_mfg arm armv7 tx6 karo mx6 tx6:MX6Q,MFG
+tx6q-1010_noenv arm armv7 tx6 karo mx6 tx6:MX6Q,ENV_IS_NOWHERE
+tx6u-8110 arm armv7 tx6 karo mx6 tx6:MX6DL,SYS_LVDS_IF
+tx6u-8110_mfg arm armv7 tx6 karo mx6 tx6:MX6DL,MFG,SYS_LVDS_IF
+tx6u-8110_noenv arm armv7 tx6 karo mx6 tx6:MX6DL,ENV_IS_NOWHERE,SYS_LVDS_IF
+tx6u-8111 arm armv7 tx6 karo mx6 tx6:MX6DL,SYS_SDRAM_BUS_WIDTH=32,SYS_LVDS_IF
+tx6u-8111_mfg arm armv7 tx6 karo mx6 tx6:MX6DL,SYS_SDRAM_BUS_WIDTH=32,MFG,SYS_LVDS_IF
+tx6u-8111_noenv arm armv7 tx6 karo mx6 tx6:MX6DL,SYS_SDRAM_BUS_WIDTH=32,ENV_IS_NOWHERE,SYS_LVDS_IF
+tx6q-1110 arm armv7 tx6 karo mx6 tx6:MX6Q,SYS_LVDS_IF
+tx6q-1110_mfg arm armv7 tx6 karo mx6 tx6:MX6Q,MFG,SYS_LVDS_IF
+tx6q-1110_noenv arm armv7 tx6 karo mx6 tx6:MX6Q,ENV_IS_NOWHERE,SYS_LVDS_IF
mx6qarm2 arm armv7 mx6qarm2 freescale mx6 mx6qarm2:IMX_CONFIG=board/freescale/mx6qarm2/imximage.cfg
mx6qsabreauto arm armv7 mx6qsabreauto freescale mx6 mx6qsabreauto:IMX_CONFIG=board/freescale/mx6qsabreauto/imximage.cfg,MX6Q
mx6qsabrelite arm armv7 mx6qsabrelite freescale mx6 mx6qsabrelite:IMX_CONFIG=board/freescale/imx/ddr/mx6q_4x_mt41j128.cfg
#define CONFIG_VIDEO_BMP_RLE8
#endif /* CONFIG_LCD */
+#ifdef CONFIG_SYS_LVDS_IF
+#define is_lvds() 1
+#else
+#define is_lvds() 0
+#endif
+
/*
* Memory configurations
*/
#endif /* CONFIG_LCD */
#endif /* CONFIG_MFG */
+#ifdef CONFIG_SYS_LVDS_IF
+#define is_lvds() 1
+#else
+#define is_lvds() 0
+#endif
+
/*
* Memory configuration options
*/