Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Craneboard ITBOK integrated with OMAP3EVM ITBOK

  • Loading branch information...
commit 73002b184884ce41aa3ab11e89108d5957aeea2a 1 parent 881882a
Srinath authored
View
15 common/src/omap3530evm.c
@@ -43,20 +43,23 @@ extern void register_battery_tests(void);
void register_diagnostics(void)
{
/* Register all test routines. */
- register_ramtests();
-#if defined(CONFIG_OMAP3_EVM) || defined(CONFIG_OMAP3_AM3517EVM) || defined(CONFIG_OMAP3_AM3517CRANE)
- register_tvout_tests();
-#endif
-
#ifdef CONFIG_OMAP3_EVM
- register_lcd_tests();
register_uarttests();
+ register_ramtests();
+ register_lcd_tests();
register_audio_tests();
register_keypad_tests();
register_ts_tests();
+ register_tvout_tests();
register_svideo_tests();
register_battery_tests();
#endif
+
+#ifdef CONFIG_OMAP3_AM3517CRANE
+ register_ramtests();
+ register_tvout_tests();
+#endif
+
}
/* Converts the string to lower case. */
View
2  device/inc/lcd_utils.h
@@ -421,7 +421,7 @@ void set_csc_coff (U8 pipeline);
void set_format (U8 pipeline, U8 format);
void set_fifo_threshold (U8 pipeline);
void set_row_inc (U8 pipeline, U32 inc_val);
-void set_pixel_inc (U8 pipeline, U32 inc_val);
+void set_pixel_inc (U8 pipeline, int inc_val);
void enable_pipeline (U8 pipeline);
void configure_dss (U8 mode);
void display_lcd_image (void);
View
6 device/src/lcd_utils.c
@@ -45,6 +45,7 @@
#include "lcd_utils.h"
#include "dss.h"
#include "../../diagnostics/inc/mt9t111.h"
+#include "../../diagnostics/inc/dg_videoin.h"
#define SD_FRAME_BUFFER 0x80377000
@@ -769,7 +770,7 @@ void set_row_inc(U8 pipeline, U32 inc_val)
}
/* Set pixel increment. */
-void set_pixel_inc(U8 pipeline, U32 inc_val)
+void set_pixel_inc(U8 pipeline, int inc_val)
{
inc_val &= PIXEL_INC_MASK;
@@ -884,8 +885,9 @@ void configure_dss(U8 mode)
/* Size of graphics window. */
set_window_size(GFX_PIPELINE, mode);
- if (mt9t111_lcd == 1)
+ if ((mt9t111_lcd == 1) || (videoin_lcd == 1)) {
set_format(GFX_PIPELINE, RGB24);
+ }
else
set_format(GFX_PIPELINE, RGB16);
View
1  device/src/tvout.c
@@ -122,7 +122,6 @@ S32 tv_config(U8 video_std, U8 image_cap_flag, U16 gfx_x, U16 gfx_y, U16 gfx_ppl
{
S32 ret_val = SUCCESS;
U32 i;
-
#ifdef CONFIG_OMAP3_EVM
enable_power(); /* Enable volages to VENC */
#endif
View
35 diagnostics/Makefile
@@ -1,4 +1,4 @@
-# Makefile - Makefile for building Diagnostic libarry
+# Makefile - Makefile for building Diagnostic library
#
# Copyright Mistral software Pvt. Ltd.
#
@@ -11,34 +11,25 @@ LIB = libdiagnostic.a
ifdef CONFIG_OMAP3_EVM
COBJS = src/diag_core.o src/diag_support.o src/dg_memory.o src/dg_uart.o src/mac_evm.o \
- src/dg_i2c.o src/dg_lcd.o src/eeprom.o src/dg_audio.o src/dg_battery.o src/dg_rtc.o ../common/src/omap3530evm.o \
- ../device/src/i2c_utils.o ../device/src/lcd_utils.o ../common/src/strtoint.o \
- ../device/src/triton2_utils.o ../device/src/mcbsp_utils.o \
- ../common/src/dg_gpio.o src/dg_dvi.o src/dg_keypad.o src/dg_mmc.o \
- src/dg_touchscreen.o ../device/src/tsc2046_utils.o \
- ../device/src/mcspi_utils.o ../device/src/uart_utils.o \
- src/dg_tvout.o src/dg_ram.o src/dg_flash_test.o src/dg_flash_test_onnd.o \
- src/dg_svideo.o src/automation.o src/dg_otg.o src/mt9t111.o src/dg_camera.o
-endif
-
-ifdef CONFIG_OMAP3_AM3517EVM
-COBJS = src/diag_core.o src/diag_support.o src/dg_memory.o \
- src/dg_i2c.o src/dg_rtc.o ../common/src/omap3530evm.o \
- ../device/src/i2c_utils.o ../common/src/strtoint.o \
- ../device/src/triton2_utils.o ../common/src/dg_gpio.o\
- src/dg_mmc.o src/dg_tvout.o src/dg_ram.o\
- src/dg_flash_test.o src/dg_flash_test_onnd.o \
- src/automation.o src/dg_otg.o src/dg_rtc.o
+ src/dg_i2c.o src/dg_lcd.o src/eeprom.o src/dg_audio.o src/dg_battery.o src/dg_rtc.o ../common/src/omap3530evm.o \
+ ../device/src/i2c_utils.o ../device/src/lcd_utils.o ../common/src/strtoint.o \
+ ../device/src/triton2_utils.o ../device/src/mcbsp_utils.o \
+ ../common/src/dg_gpio.o src/dg_dvi.o src/dg_keypad.o src/dg_mmc.o \
+ src/dg_touchscreen.o ../device/src/tsc2046_utils.o \
+ ../device/src/mcspi_utils.o ../device/src/uart_utils.o \
+ src/dg_tvout.o src/dg_ram.o src/dg_flash_test.o src/dg_flash_test_onnd.o \
+ src/dg_svideo.o src/automation.o src/dg_otg.o src/mt9t111.o src/dg_camera.o \
+ src/tvp5146.o src/videoin_isp.o src/dg_videoin.o
endif
ifdef CONFIG_OMAP3_AM3517CRANE
COBJS = src/diag_core.o src/diag_support.o src/dg_memory.o \
src/dg_i2c.o src/dg_rtc.o ../common/src/omap3530evm.o \
../device/src/i2c_utils.o ../common/src/strtoint.o \
- ../device/src/triton2_utils.o ../common/src/dg_gpio.o\
- src/dg_mmc.o src/dg_tvout.o src/dg_ram.o\
+ ../device/src/triton2_utils.o ../common/src/dg_gpio.o \
+ src/dg_mmc.o src/dg_tvout.o src/dg_ram.o \
src/dg_flash_test.o src/dg_flash_test_onnd.o \
- src/automation.o src/dg_otg.o src/dg_rtc.o src/dg_gpio.o
+ src/automation.o src/dg_otg.o src/dg_gpio.o
endif
OBJS = $(AOBJS) $(COBJS)
View
15 diagnostics/inc/dg_gpio.h
@@ -38,6 +38,7 @@ extern "C" {
#endif
+#define OMAP34XX_CTRL_BASE (0x48000000 + 0x2000)
/*
* IEN - Input Enable
@@ -458,7 +459,7 @@ extern "C" {
#define CRANE_STRBEN_DLY1 0x0224
#define CRANE_SYS_BOOT8 0x0226
-#define PUT_MUX_VAL(OFFSET,VALUE)\
+#define PUT_MUX_VAL(OFFSET, VALUE)\
crane_writel((VALUE), OMAP34XX_CTRL_BASE + (OFFSET));
#define GET_MUX_VAL(OFFSET)\
crane_readl(OMAP34XX_CTRL_BASE + (OFFSET));
@@ -469,4 +470,16 @@ extern "C" {
}
#endif
+int set_dss_gpio(int);
+int set_mmc_gpio(int);
+int set_ccdc_gpio(int);
+int set_i2c2_gpio(int);
+void crane_gpio_clk_init(void);
+int set_dss_mux(void);
+int set_mmc_mux(void);
+int set_ccdc_mux(void);
+int set_i2c_mux(void);
+int save_mux_val(void);
+int restore_mux_val(void);
+
#endif /* __DIAG_GPIO_H__ */
View
134 diagnostics/inc/dg_videoin.h
@@ -0,0 +1,134 @@
+/*
+ * video input test file.
+ *
+ * (C) Copyright 2010
+ * Mistral Solutions Private Limited, <www.mistralsolutions.com>
+ *
+ * Author :
+ * Ganeshan <nganeshan@mistralsolutions.com>
+ *
+ * Derived from NA
+ *
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+/*
+ * modification history
+ * --------------------
+ * 14 Jul 2009 - Created
+ */
+#ifndef _DG_VIDEOIN_H
+#define _DG_VIDEOIN_H
+
+#define VIDEOIN_CVBS 0
+#define VIDEOIN_SVIDEO 1
+
+/*image formats*/
+#define BITMAP1 0x0
+#define BITMAP2 0x1
+#define BITMAP4 0x2
+#define BITMAP8 0x3
+#define RGB12 0x4
+#define RGB16 0x6
+#define RGB24 0x8
+#define YUV422 0xA
+#define UYVY422 0xB
+/***************pixel formats******************/
+
+#define YUV422BE 0x0 //CC_CCPDFR[3:0]
+//#define YUV422 0x1
+#define YUV420 0x2
+#define RGB444 0x4
+#define RGB565 0x5
+#define RGB888_NDE 0x6
+#define RGB888_DE 0x7
+#define RAW8_NDE 0x8
+#define RAW8_DE 0x9
+#define RAW10_NDE 0xA
+#define RAW10_DE 0xB
+#define RAW12_NDE 0xC
+#define RAW12_DE 0xD
+#define JPEG8_FSP 0xE
+#define JPEG8 0xF
+#define RGB666 0x10
+#define RGB888 0x11
+
+/*image types*/
+
+#define SQCIF 0x0
+#define QCIF 0x1
+#define CIF 0x2
+#define VGA 0x3
+#define SVGA 0x4
+#define XGA 0x5
+#define SXGA 0x6
+#define UXGA 0x7
+#define QSIF 0x8
+#define SIF 0x9
+#define QVGA 0xA
+#define HDMI 0xB
+#define RFBI_QVGA 0xC
+/*Specific to LCD*/
+#define DVI 0xFF
+
+#define LCD_QVGA 0x0
+#define LCD_VGA 0x1
+#define DVI_VGA 0x2
+#define DVI_720P 0x3
+/*standard resolution*/
+#define LCD_HEIGHT_QVGA 320
+#define LCD_WIDTH_QVGA 240
+#define LCD_HEIGHT_VGA 640
+#define LCD_WIDTH_VGA 480
+/* lcd interface width */
+#define LCD_WIDTH_18BIT 0x1
+#define LCD_WIDTH_16BIT 0x2
+
+
+extern unsigned int videoin_lcd;
+
+/////////////////////////////////////////////////////////////////////////////////////////
+/* Tokens for register write */
+#define TOK_WRITE (0) /* token for write operation */
+#define TOK_TERM (1) /* terminating token */
+#define TOK_DELAY (2) /* delay token for reg list */
+#define TOK_SKIP (3) /* token to skip a register */
+
+
+/**
+ * struct tvp514x_reg - Structure for TVP5146/47 register initialization values
+ * @token - Token: TOK_WRITE, TOK_TERM etc..
+ * @reg - Register offset
+ * @val - Register Value for TOK_WRITE or delay in ms for TOK_DELAY
+ */
+struct tvp514x_reg {
+ U8 token;
+ U8 reg;
+ U32 val;
+};
+
+/**
+ * struct tvp514x_init_seq - Structure for TVP5146/47/46M2/47M1 power up
+ * Sequence.
+ * @ no_regs - Number of registers to write for power up sequence.
+ * @ init_reg_seq - Array of registers and respective value to write.
+ */
+struct tvp514x_init_seq {
+ unsigned int no_regs;
+ const struct tvp514x_reg *init_reg_seq;
+};
+
+#endif //_DG_SALOOPBACK_H
View
662 diagnostics/inc/tvp514x_regs.h
@@ -0,0 +1,662 @@
+/*
+ * video input TVP5146 device file.
+ *
+ * (C) Copyright 2010
+ * Mistral Solutions Private Limited, <www.mistralsolutions.com>
+ *
+ * Author :
+ * Ganeshan <nganeshan@mistralsolutions.com>
+ *
+ * Derived from NA
+ *
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+/*
+ * modification history
+ * --------------------
+ * 14 Jul 2009 - Created
+ */
+
+#ifndef _TVP514X_REGS_H
+#define _TVP514X_REGS_H
+
+//typedef long long v4l2_std_id;
+
+/* Values for the 'type' field */
+#define V4L2_INPUT_TYPE_TUNER 1
+#define V4L2_INPUT_TYPE_CAMERA 2
+
+/*
+ * TVP5146/47 registers
+ */
+#define REG_INPUT_SEL (0x00)
+#define REG_AFE_GAIN_CTRL (0x01)
+#define REG_VIDEO_STD (0x02)
+#define REG_OPERATION_MODE (0x03)
+#define REG_AUTOSWITCH_MASK (0x04)
+
+#define REG_COLOR_KILLER (0x05)
+#define REG_LUMA_CONTROL1 (0x06)
+#define REG_LUMA_CONTROL2 (0x07)
+#define REG_LUMA_CONTROL3 (0x08)
+
+#define REG_BRIGHTNESS (0x09)
+#define REG_CONTRAST (0x0A)
+#define REG_SATURATION (0x0B)
+#define REG_HUE (0x0C)
+
+#define REG_CHROMA_CONTROL1 (0x0D)
+#define REG_CHROMA_CONTROL2 (0x0E)
+
+/* 0x0F Reserved */
+
+#define REG_COMP_PR_SATURATION (0x10)
+#define REG_COMP_Y_CONTRAST (0x11)
+#define REG_COMP_PB_SATURATION (0x12)
+
+/* 0x13 Reserved */
+
+#define REG_COMP_Y_BRIGHTNESS (0x14)
+
+/* 0x15 Reserved */
+
+#define REG_AVID_START_PIXEL_LSB (0x16)
+#define REG_AVID_START_PIXEL_MSB (0x17)
+#define REG_AVID_STOP_PIXEL_LSB (0x18)
+#define REG_AVID_STOP_PIXEL_MSB (0x19)
+
+#define REG_HSYNC_START_PIXEL_LSB (0x1A)
+#define REG_HSYNC_START_PIXEL_MSB (0x1B)
+#define REG_HSYNC_STOP_PIXEL_LSB (0x1C)
+#define REG_HSYNC_STOP_PIXEL_MSB (0x1D)
+
+#define REG_VSYNC_START_LINE_LSB (0x1E)
+#define REG_VSYNC_START_LINE_MSB (0x1F)
+#define REG_VSYNC_STOP_LINE_LSB (0x20)
+#define REG_VSYNC_STOP_LINE_MSB (0x21)
+
+#define REG_VBLK_START_LINE_LSB (0x22)
+#define REG_VBLK_START_LINE_MSB (0x23)
+#define REG_VBLK_STOP_LINE_LSB (0x24)
+#define REG_VBLK_STOP_LINE_MSB (0x25)
+
+/* 0x26 - 0x27 Reserved */
+
+#define REG_FAST_SWTICH_CONTROL (0x28)
+
+/* 0x29 Reserved */
+
+#define REG_FAST_SWTICH_SCART_DELAY (0x2A)
+
+/* 0x2B Reserved */
+
+#define REG_SCART_DELAY (0x2C)
+#define REG_CTI_DELAY (0x2D)
+#define REG_CTI_CONTROL (0x2E)
+
+/* 0x2F - 0x31 Reserved */
+
+#define REG_SYNC_CONTROL (0x32)
+#define REG_OUTPUT_FORMATTER1 (0x33)
+#define REG_OUTPUT_FORMATTER2 (0x34)
+#define REG_OUTPUT_FORMATTER3 (0x35)
+#define REG_OUTPUT_FORMATTER4 (0x36)
+#define REG_OUTPUT_FORMATTER5 (0x37)
+#define REG_OUTPUT_FORMATTER6 (0x38)
+#define REG_CLEAR_LOST_LOCK (0x39)
+
+#define REG_STATUS1 (0x3A)
+#define REG_STATUS2 (0x3B)
+
+#define REG_AGC_GAIN_STATUS_LSB (0x3C)
+#define REG_AGC_GAIN_STATUS_MSB (0x3D)
+
+/* 0x3E Reserved */
+
+#define REG_VIDEO_STD_STATUS (0x3F)
+#define REG_GPIO_INPUT1 (0x40)
+#define REG_GPIO_INPUT2 (0x41)
+
+/* 0x42 - 0x45 Reserved */
+
+#define REG_AFE_COARSE_GAIN_CH1 (0x46)
+#define REG_AFE_COARSE_GAIN_CH2 (0x47)
+#define REG_AFE_COARSE_GAIN_CH3 (0x48)
+#define REG_AFE_COARSE_GAIN_CH4 (0x49)
+
+#define REG_AFE_FINE_GAIN_PB_B_LSB (0x4A)
+#define REG_AFE_FINE_GAIN_PB_B_MSB (0x4B)
+#define REG_AFE_FINE_GAIN_Y_G_CHROMA_LSB (0x4C)
+#define REG_AFE_FINE_GAIN_Y_G_CHROMA_MSB (0x4D)
+#define REG_AFE_FINE_GAIN_PR_R_LSB (0x4E)
+#define REG_AFE_FINE_GAIN_PR_R_MSB (0x4F)
+#define REG_AFE_FINE_GAIN_CVBS_LUMA_LSB (0x50)
+#define REG_AFE_FINE_GAIN_CVBS_LUMA_MSB (0x51)
+
+/* 0x52 - 0x68 Reserved */
+
+#define REG_FBIT_VBIT_CONTROL1 (0x69)
+
+/* 0x6A - 0x6B Reserved */
+
+#define REG_BACKEND_AGC_CONTROL (0x6C)
+
+/* 0x6D - 0x6E Reserved */
+
+#define REG_AGC_DECREMENT_SPEED_CONTROL (0x6F)
+#define REG_ROM_VERSION (0x70)
+
+/* 0x71 - 0x73 Reserved */
+
+#define REG_AGC_WHITE_PEAK_PROCESSING (0x74)
+#define REG_FBIT_VBIT_CONTROL2 (0x75)
+#define REG_VCR_TRICK_MODE_CONTROL (0x76)
+#define REG_HORIZONTAL_SHAKE_INCREMENT (0x77)
+#define REG_AGC_INCREMENT_SPEED (0x78)
+#define REG_AGC_INCREMENT_DELAY (0x79)
+
+/* 0x7A - 0x7F Reserved */
+
+#define REG_CHIP_ID_MSB (0x80)
+#define REG_CHIP_ID_LSB (0x81)
+
+/* 0x82 Reserved */
+
+#define REG_CPLL_SPEED_CONTROL (0x83)
+
+/* 0x84 - 0x96 Reserved */
+
+#define REG_STATUS_REQUEST (0x97)
+
+/* 0x98 - 0x99 Reserved */
+
+#define REG_VERTICAL_LINE_COUNT_LSB (0x9A)
+#define REG_VERTICAL_LINE_COUNT_MSB (0x9B)
+
+/* 0x9C - 0x9D Reserved */
+
+#define REG_AGC_DECREMENT_DELAY (0x9E)
+
+/* 0x9F - 0xB0 Reserved */
+
+#define REG_VDP_TTX_FILTER_1_MASK1 (0xB1)
+#define REG_VDP_TTX_FILTER_1_MASK2 (0xB2)
+#define REG_VDP_TTX_FILTER_1_MASK3 (0xB3)
+#define REG_VDP_TTX_FILTER_1_MASK4 (0xB4)
+#define REG_VDP_TTX_FILTER_1_MASK5 (0xB5)
+#define REG_VDP_TTX_FILTER_2_MASK1 (0xB6)
+#define REG_VDP_TTX_FILTER_2_MASK2 (0xB7)
+#define REG_VDP_TTX_FILTER_2_MASK3 (0xB8)
+#define REG_VDP_TTX_FILTER_2_MASK4 (0xB9)
+#define REG_VDP_TTX_FILTER_2_MASK5 (0xBA)
+#define REG_VDP_TTX_FILTER_CONTROL (0xBB)
+#define REG_VDP_FIFO_WORD_COUNT (0xBC)
+#define REG_VDP_FIFO_INTERRUPT_THRLD (0xBD)
+
+/* 0xBE Reserved */
+
+#define REG_VDP_FIFO_RESET (0xBF)
+#define REG_VDP_FIFO_OUTPUT_CONTROL (0xC0)
+#define REG_VDP_LINE_NUMBER_INTERRUPT (0xC1)
+#define REG_VDP_PIXEL_ALIGNMENT_LSB (0xC2)
+#define REG_VDP_PIXEL_ALIGNMENT_MSB (0xC3)
+
+/* 0xC4 - 0xD5 Reserved */
+
+#define REG_VDP_LINE_START (0xD6)
+#define REG_VDP_LINE_STOP (0xD7)
+#define REG_VDP_GLOBAL_LINE_MODE (0xD8)
+#define REG_VDP_FULL_FIELD_ENABLE (0xD9)
+#define REG_VDP_FULL_FIELD_MODE (0xDA)
+
+/* 0xDB - 0xDF Reserved */
+
+#define REG_VBUS_DATA_ACCESS_NO_VBUS_ADDR_INCR (0xE0)
+#define REG_VBUS_DATA_ACCESS_VBUS_ADDR_INCR (0xE1)
+#define REG_FIFO_READ_DATA (0xE2)
+
+/* 0xE3 - 0xE7 Reserved */
+
+#define REG_VBUS_ADDRESS_ACCESS1 (0xE8)
+#define REG_VBUS_ADDRESS_ACCESS2 (0xE9)
+#define REG_VBUS_ADDRESS_ACCESS3 (0xEA)
+
+/* 0xEB - 0xEF Reserved */
+
+#define REG_INTERRUPT_RAW_STATUS0 (0xF0)
+#define REG_INTERRUPT_RAW_STATUS1 (0xF1)
+#define REG_INTERRUPT_STATUS0 (0xF2)
+#define REG_INTERRUPT_STATUS1 (0xF3)
+#define REG_INTERRUPT_MASK0 (0xF4)
+#define REG_INTERRUPT_MASK1 (0xF5)
+#define REG_INTERRUPT_CLEAR0 (0xF6)
+#define REG_INTERRUPT_CLEAR1 (0xF7)
+
+/* 0xF8 - 0xFF Reserved */
+
+/*
+ * Mask and bit definitions of TVP5146/47 registers
+ */
+/* The ID values we are looking for */
+#define TVP514X_CHIP_ID_MSB (0x51)
+#define TVP5146_CHIP_ID_LSB (0x46)
+#define TVP5147_CHIP_ID_LSB (0x47)
+
+#define VIDEO_STD_MASK (0x07)
+#define VIDEO_STD_AUTO_SWITCH_BIT (0x00)
+#define VIDEO_STD_NTSC_MJ_BIT (0x01)
+#define VIDEO_STD_PAL_BDGHIN_BIT (0x02)
+#define VIDEO_STD_PAL_M_BIT (0x03)
+#define VIDEO_STD_PAL_COMBINATION_N_BIT (0x04)
+#define VIDEO_STD_NTSC_4_43_BIT (0x05)
+#define VIDEO_STD_SECAM_BIT (0x06)
+#define VIDEO_STD_PAL_60_BIT (0x07)
+
+/*
+ * Status bit
+ */
+#define STATUS_TV_VCR_BIT (1<<0)
+#define STATUS_HORZ_SYNC_LOCK_BIT (1<<1)
+#define STATUS_VIRT_SYNC_LOCK_BIT (1<<2)
+#define STATUS_CLR_SUBCAR_LOCK_BIT (1<<3)
+#define STATUS_LOST_LOCK_DETECT_BIT (1<<4)
+#define STATUS_FEILD_RATE_BIT (1<<5)
+#define STATUS_LINE_ALTERNATING_BIT (1<<6)
+#define STATUS_PEAK_WHITE_DETECT_BIT (1<<7)
+
+/* Tokens for register write */
+#define TOK_WRITE (0) /* token for write operation */
+#define TOK_TERM (1) /* terminating token */
+#define TOK_DELAY (2) /* delay token for reg list */
+#define TOK_SKIP (3) /* token to skip a register */
+
+#define TVP514X_XCLK_BT656 (27000000)
+
+/* Number of pixels and number of lines per frame for different standards */
+#define NTSC_NUM_ACTIVE_PIXELS (720)
+#define NTSC_NUM_ACTIVE_LINES (480)
+#define PAL_NUM_ACTIVE_PIXELS (720)
+#define PAL_NUM_ACTIVE_LINES (576)
+
+#define V4L2_STD_NTSC_M ((v4l2_std_id)0x00001000)
+#define V4L2_STD_NTSC_M_JP ((v4l2_std_id)0x00002000)
+#define V4L2_STD_NTSC_443 ((v4l2_std_id)0x00004000)
+#define V4L2_STD_NTSC_M_KR ((v4l2_std_id)0x00008000)
+
+
+#define V4L2_STD_NTSC (V4L2_STD_NTSC_M |\
+ V4L2_STD_NTSC_M_JP |\
+ V4L2_STD_NTSC_M_KR)
+
+
+/* one bit for each */
+#define V4L2_STD_PAL_B ((v4l2_std_id)0x00000001)
+#define V4L2_STD_PAL_B1 ((v4l2_std_id)0x00000002)
+#define V4L2_STD_PAL_G ((v4l2_std_id)0x00000004)
+#define V4L2_STD_PAL_H ((v4l2_std_id)0x00000008)
+#define V4L2_STD_PAL_I ((v4l2_std_id)0x00000010)
+#define V4L2_STD_PAL_D ((v4l2_std_id)0x00000020)
+#define V4L2_STD_PAL_D1 ((v4l2_std_id)0x00000040)
+#define V4L2_STD_PAL_K ((v4l2_std_id)0x00000080)
+
+#define V4L2_STD_PAL_M ((v4l2_std_id)0x00000100)
+#define V4L2_STD_PAL_N ((v4l2_std_id)0x00000200)
+#define V4L2_STD_PAL_Nc ((v4l2_std_id)0x00000400)
+#define V4L2_STD_PAL_60 ((v4l2_std_id)0x00000800)
+
+
+/* FIXME:
+ Although std_id is 64 bits, there is an issue on PPC32 architecture that
+ makes switch(__u64) to break. So, there's a hack on v4l2-common.c rounding
+ this value to 32 bits.
+ As, currently, the max value is for V4L2_STD_ATSC_16_VSB (30 bits wide),
+ it should work fine. However, if needed to add more than two standards,
+ v4l2-common.c should be fixed.
+ */
+
+/* some merged standards */
+#define V4L2_STD_MN (V4L2_STD_PAL_M|V4L2_STD_PAL_N|V4L2_STD_PAL_Nc|V4L2_STD_NTSC)
+#define V4L2_STD_B (V4L2_STD_PAL_B|V4L2_STD_PAL_B1|V4L2_STD_SECAM_B)
+#define V4L2_STD_GH (V4L2_STD_PAL_G|V4L2_STD_PAL_H|V4L2_STD_SECAM_G|V4L2_STD_SECAM_H)
+#define V4L2_STD_DK (V4L2_STD_PAL_DK|V4L2_STD_SECAM_DK)
+
+/* some common needed stuff */
+#define V4L2_STD_PAL_BG (V4L2_STD_PAL_B |\
+ V4L2_STD_PAL_B1 |\
+ V4L2_STD_PAL_G)
+#define V4L2_STD_PAL_DK (V4L2_STD_PAL_D |\
+ V4L2_STD_PAL_D1 |\
+ V4L2_STD_PAL_K)
+#define V4L2_STD_PAL (V4L2_STD_PAL_BG |\
+ V4L2_STD_PAL_DK |\
+ V4L2_STD_PAL_H |\
+ V4L2_STD_PAL_I)
+
+
+/* Values for 'capabilities' field */
+#define V4L2_CAP_VIDEO_CAPTURE 0x00000001 /* Is a video capture device */
+#define V4L2_CAP_VIDEO_OUTPUT 0x00000002 /* Is a video output device */
+#define V4L2_CAP_VIDEO_OVERLAY 0x00000004 /* Can do video overlay */
+#define V4L2_CAP_VBI_CAPTURE 0x00000010 /* Is a raw VBI capture device */
+#define V4L2_CAP_VBI_OUTPUT 0x00000020 /* Is a raw VBI output device */
+#define V4L2_CAP_SLICED_VBI_CAPTURE 0x00000040 /* Is a sliced VBI capture device */
+#define V4L2_CAP_SLICED_VBI_OUTPUT 0x00000080 /* Is a sliced VBI output device */
+#define V4L2_CAP_RDS_CAPTURE 0x00000100 /* RDS data capture */
+#define V4L2_CAP_VIDEO_OUTPUT_OVERLAY 0x00000200 /* Can do video output overlay */
+#define V4L2_CAP_HW_FREQ_SEEK 0x00000400 /* Can do hardware frequency seek */
+
+#define V4L2_CAP_TUNER 0x00010000 /* has a tuner */
+#define V4L2_CAP_AUDIO 0x00020000 /* has audio support */
+#define V4L2_CAP_RADIO 0x00040000 /* is a radio device */
+
+#define V4L2_CAP_READWRITE 0x01000000 /* read/write systemcalls */
+#define V4L2_CAP_ASYNCIO 0x02000000 /* async I/O */
+#define V4L2_CAP_STREAMING 0x04000000 /* streaming I/O ioctls */
+
+/**
+
+ * enum tvp514x_input - enum for different decoder input pin
+ * configuration.
+ */
+enum tvp514x_input {
+ /*
+ * CVBS input selection
+ */
+ INPUT_CVBS_VI1A = 0x0,
+ INPUT_CVBS_VI1B,
+ INPUT_CVBS_VI1C,
+ INPUT_CVBS_VI2A = 0x04,
+ INPUT_CVBS_VI2B,
+ INPUT_CVBS_VI2C,
+ INPUT_CVBS_VI3A = 0x08,
+ INPUT_CVBS_VI3B,
+ INPUT_CVBS_VI3C,
+ INPUT_CVBS_VI4A = 0x0C,
+ /*
+ * S-Video input selection
+ */
+ INPUT_SVIDEO_VI2A_VI1A = 0x44,
+ INPUT_SVIDEO_VI2B_VI1B,
+ INPUT_SVIDEO_VI2C_VI1C,
+ INPUT_SVIDEO_VI2A_VI3A = 0x54,
+ INPUT_SVIDEO_VI2B_VI3B,
+ INPUT_SVIDEO_VI2C_VI3C,
+ INPUT_SVIDEO_VI4A_VI1A = 0x4C,
+ INPUT_SVIDEO_VI4A_VI1B,
+ INPUT_SVIDEO_VI4A_VI1C,
+ INPUT_SVIDEO_VI4A_VI3A = 0x5C,
+ INPUT_SVIDEO_VI4A_VI3B,
+ INPUT_SVIDEO_VI4A_VI3C,
+
+ /* Need to add entries for
+ * RGB, YPbPr and SCART.
+ */
+ INPUT_INVALID
+};
+
+/**
+ * enum tvp514x_output - enum for output format
+ * supported.
+ *
+ */
+enum tvp514x_output {
+ OUTPUT_10BIT_422_EMBEDDED_SYNC = 0,
+ OUTPUT_20BIT_422_SEPERATE_SYNC,
+ OUTPUT_10BIT_422_SEPERATE_SYNC = 3,
+ OUTPUT_INVALID
+};
+
+
+/**
+ * enum tvp514x_std - enum for supported standards
+ */
+enum tvp514x_std {
+ STD_NTSC_MJ = 0,
+ STD_PAL_BDGHIN,
+ STD_INVALID
+};
+#if 0
+struct v4l2_fract {
+ U32 numerator;
+ U32 denominator;
+};
+
+struct v4l2_standard {
+ U32 index;
+ v4l2_std_id id;
+ U8 name[24];
+ struct v4l2_fract frameperiod; /* Frames, not fields */
+ U32 framelines;
+ U32 reserved[4];
+};
+
+struct tvp514x_std_info {
+ unsigned long width;
+ unsigned long height;
+ U8 video_std;
+ struct v4l2_standard standard;
+};
+/*
+ * Supported standards -
+ *
+ * Currently supports two standards only, need to add support for rest of the
+ * modes, like SECAM, etc...
+ */
+static struct tvp514x_std_info tvp514x_std_list[] = {
+ /* Standard: STD_NTSC_MJ */
+ [STD_NTSC_MJ] = {
+ .width = NTSC_NUM_ACTIVE_PIXELS,
+ .height = NTSC_NUM_ACTIVE_LINES,
+ .video_std = VIDEO_STD_NTSC_MJ_BIT,
+ .standard = {
+ .index = 0,
+ .id = V4L2_STD_NTSC,
+ .name = "NTSC",
+ .frameperiod = {1001, 30000},
+ .framelines = 525
+ },
+ /* Standard: STD_PAL_BDGHIN */
+ },
+ [STD_PAL_BDGHIN] = {
+ .width = PAL_NUM_ACTIVE_PIXELS,
+ .height = PAL_NUM_ACTIVE_LINES,
+ .video_std = VIDEO_STD_PAL_BDGHIN_BIT,
+ .standard = {
+ .index = 1,
+ .id = V4L2_STD_PAL,
+ .name = "PAL",
+ .frameperiod = {1, 25},
+ .framelines = 625
+ },
+ },
+ /* Standard: need to add for additional standard */
+};
+
+
+/**
+ * struct tvp514x_reg - Structure for TVP5146/47 register initialization values
+ * @token - Token: TOK_WRITE, TOK_TERM etc..
+ * @reg - Register offset
+ * @val - Register Value for TOK_WRITE or delay in ms for TOK_DELAY
+ */
+struct tvp514x_reg {
+ U8 token;
+ U8 reg;
+ U32 val;
+};
+
+/**
+ * struct tvp514x_init_seq - Structure for TVP5146/47/46M2/47M1 power up
+ * Sequence.
+ * @ no_regs - Number of registers to write for power up sequence.
+ * @ init_reg_seq - Array of registers and respective value to write.
+ */
+struct tvp514x_init_seq {
+ unsigned int no_regs;
+ const struct tvp514x_reg *init_reg_seq;
+};
+#endif
+
+/* Number of pixels and number of lines per frame for different standards */
+#define NTSC_NUM_ACTIVE_PIXELS (720)
+#define NTSC_NUM_ACTIVE_LINES (480)
+#define PAL_NUM_ACTIVE_PIXELS (720)
+#define PAL_NUM_ACTIVE_LINES (576)
+#if 0
+/*
+ * V I D E O I N P U T S
+ */
+struct v4l2_input {
+ U32 index; /* Which input */
+ U8 name[32]; /* Label */
+ U32 type; /* Type of input */
+ U32 audioset; /* Associated audios (bitfield) */
+ U32 tuner; /* Associated tuner */
+ U32 std;
+ U32 status;
+ U32 reserved[4];
+};
+#endif
+enum v4l2_field {
+ V4L2_FIELD_ANY = 0, /* driver can choose from none,
+ top, bottom, interlaced
+ depending on whatever it thinks
+ is approximate ... */
+ V4L2_FIELD_NONE = 1, /* this device has no fields ... */
+ V4L2_FIELD_TOP = 2, /* top field only */
+ V4L2_FIELD_BOTTOM = 3, /* bottom field only */
+ V4L2_FIELD_INTERLACED = 4, /* both fields interlaced */
+ V4L2_FIELD_SEQ_TB = 5, /* both fields sequential into one
+ buffer, top-bottom order */
+ V4L2_FIELD_SEQ_BT = 6, /* same as above + bottom-top order */
+ V4L2_FIELD_ALTERNATE = 7, /* both fields alternating into
+ separate buffers */
+ V4L2_FIELD_INTERLACED_TB = 8, /* both fields interlaced, top field
+ first and the top field is
+ transmitted first */
+ V4L2_FIELD_INTERLACED_BT = 9, /* both fields interlaced, top field
+ first and the bottom field is
+ transmitted first */
+};
+
+/* see also http://vektor.theorem.ca/graphics/ycbcr/ */
+enum v4l2_colorspace {
+ /* ITU-R 601 -- broadcast NTSC/PAL */
+ V4L2_COLORSPACE_SMPTE170M = 1,
+
+ /* 1125-Line (US) HDTV */
+ V4L2_COLORSPACE_SMPTE240M = 2,
+
+ /* HD and modern captures. */
+ V4L2_COLORSPACE_REC709 = 3,
+
+ /* broken BT878 extents (601, luma range 16-253 instead of 16-235) */
+ V4L2_COLORSPACE_BT878 = 4,
+
+ /* These should be useful. Assume 601 extents. */
+ V4L2_COLORSPACE_470_SYSTEM_M = 5,
+ V4L2_COLORSPACE_470_SYSTEM_BG = 6,
+
+ /* I know there will be cameras that send this. So, this is
+ * unspecified chromaticities and full 0-255 on each of the
+ * Y'CbCr components
+ */
+ V4L2_COLORSPACE_JPEG = 7,
+
+ /* For RGB colourspaces, this is probably a good start. */
+ V4L2_COLORSPACE_SRGB = 8,
+};
+
+enum v4l2_buf_type {
+ V4L2_BUF_TYPE_VIDEO_CAPTURE = 1,
+ V4L2_BUF_TYPE_VIDEO_OUTPUT = 2,
+ V4L2_BUF_TYPE_VIDEO_OVERLAY = 3,
+ V4L2_BUF_TYPE_VBI_CAPTURE = 4,
+ V4L2_BUF_TYPE_VBI_OUTPUT = 5,
+ V4L2_BUF_TYPE_SLICED_VBI_CAPTURE = 6,
+ V4L2_BUF_TYPE_SLICED_VBI_OUTPUT = 7,
+#if 1
+ /* Experimental */
+ V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY = 8,
+#endif
+ V4L2_BUF_TYPE_PRIVATE = 0x80,
+};
+
+
+#if 0
+struct v4l2_pix_format {
+ U32 width;
+ U32 height;
+ U32 pixelformat;
+ enum v4l2_field field;
+ U32 bytesperline; /* for padding, zero if unused */
+ U32 sizeimage;
+ enum v4l2_colorspace colorspace;
+ U32 priv; /* private data, depends on pixelformat */
+};
+
+/* Stream data format
+ */
+struct v4l2_format {
+ enum v4l2_buf_type type;
+ union {
+ struct v4l2_pix_format pix; /* V4L2_BUF_TYPE_VIDEO_CAPTURE */
+// struct v4l2_window win; /* V4L2_BUF_TYPE_VIDEO_OVERLAY */
+// struct v4l2_vbi_format vbi; /* V4L2_BUF_TYPE_VBI_CAPTURE */
+// struct v4l2_sliced_vbi_format sliced; /* V4L2_BUF_TYPE_SLICED_VBI_CAPTURE */
+ U8 raw_data[200]; /* user-defined */
+ } fmt;
+};
+
+
+/* Routing definition, device dependent. It specifies which inputs (if any)
+ should be routed to which outputs (if any). */
+struct v4l2_routing {
+ U32 input;
+ U32 output;
+ enum tvp514x_std current_std;
+ v4l2_std_id current_norm;
+ U32 capabilities; /* Device capabilities */
+
+ int ver;
+ enum tvp514x_state state;
+
+ struct v4l2_pix_format pix;
+ int num_fmts;
+ const struct v4l2_fmtdesc *fmt_list;
+
+ enum tvp514x_std current_std;
+ int num_stds;
+ struct tvp514x_std_info *std_list;
+};
+
+/* List of image formats supported by TVP5146/47 decoder
+ * Currently we are using 8 bit mode only, but can be
+ * extended to 10/20 bit mode.
+ */
+static const struct v4l2_fmtdesc tvp514x_fmt_list[] = {
+ {
+ .index = 0,
+ .type = V4L2_BUF_TYPE_VIDEO_CAPTURE,
+ .flags = 0,
+ .description = "8-bit UYVY 4:2:2 Format",
+ .pixelformat = V4L2_PIX_FMT_UYVY,
+ },
+};
+#endif
+
+#endif /* ifndef _TVP514X_REGS_H */
View
927 diagnostics/src/automation.c
@@ -9,6 +9,7 @@
*
* Derived from OMAP2EVM ITBOK.
*
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
@@ -27,11 +28,23 @@
/*
* modification history
* --------------------
- * Modified by : Ulaganathan.V
- * <ulaganathan@mistralsolutions.com>
- * 14 Jul 2010 - Created from EVM3530 ITBOK source.
- * 16 Jul 2010 - Modified source to support both OMAP35xx and AM35xx
- * 04 Aug 2010 - Integrated GPIO Test for Crane board
+ * 10 Mar 2009 - Created from OMAP2 ITBOK source.
+ * 15 Apr 2010 - Added Camera Support
+ * 26 Apr 2010 - Added USB Gadget Support
+ * Added USB Host Support
+ * Added MMC Option for 24MHz and 48MHz
+ * 10 Jun 2010 - Fixed issues with LCD backlight and camera test.
+ * When run all test selected, the LCD backlight and
+ * camera was not working.
+ * updated test_svideoOut(), test_tvOut() and
+ * test_lcd_backlight() functions
+ * 21 Jun 2010 - Updated headset detect function and Ethernet test
+ * When run all test selected, audio was feable and
+ * Ethernet test shows result as Fail even though the
+ * host is alive.
+ * 28 Jun 2010 - Integrated UART Test
+ * 14 Jul 2010 - Added videoin Test which supports composite video IN
+ * 05 Aug 2010 - Added Support for videoin S-Video Test
*/
#include <common.h>
@@ -44,52 +57,42 @@
#include <linux/string.h>
#include "sys_info.h"
#include <asm/arch-omap3/sys_proto.h>
-
-#if defined(CONFIG_OMAP3_EVM) || defined(CONFIG_OMAP3_AM3517EVM) || defined(CONFIG_OMAP3_AM3517CRANE)
+#include "dg_audio.h"
#include "dg_i2c.h"
+#include "dg_lcd.h"
+#include "dg_touchscreen.h"
#include "dg_uart.h"
+#include "dg_keypad.h"
#include "dg_memory.h"
#include "dg_tvout.h"
-#endif
-
-#if defined(CONFIG_OMAP3_AM3517EVM) || defined(CONFIG_OMAP3_AM3517CRANE)
-#include "dg_gpio.h"
-#endif
-
-#ifdef CONFIG_OMAP3_EVM
#include "dg_svideo.h"
-#include "dg_audio.h"
-#include "dg_lcd.h"
-#include "dg_touchscreen.h"
-#include "dg_keypad.h"
-#endif
-
#include "uart_utils.h"
#include "triton2_utils.h"
#include "dss.h"
#include "omap3530evm.h"
+#include "dg_videoin.h"
+#include "dg_gpio.h"
/* Version information of ITBOK */
#define ITBOK_MAJOR_VERSION 1
#define ITBOK_MINOR_VERSION 2
#define ITBOK_PATCH_VERSION 0
-#define FIVE_SEC 5
-#define TWENTY_SEC 20
-#define TEN 10
+#define FIVE_SEC 5
+#define TWENTY_SEC 20
+#define TEN 10
#define ITBOK_ALL_TESTS 1
#define ITBOK_MEMORY_TEST 2
#define ITBOK_NAND_TEST 3
-#if defined(CONFIG_OMAP3_AM3517EVM) || defined(CONFIG_OMAP3_AM3517CRANE)
+#ifdef CONFIG_OMAP3_AM3517CRANE
#define ITBOK_ETHERNET_TEST 4
#define ITBOK_MMC_TEST 5
#define ITBOK_OTG_HOST_TEST 6
-#define ITBOK_OTG_GADGET_TEST 7
-#define ITBOK_TV_OUT_TEST 8
-#define ITBOK_GPIO_TEST 9
-#define ITBOK_EXIT 10
+#define ITBOK_TV_OUT_TEST 7
+#define ITBOK_GPIO_TEST 8
+#define ITBOK_EXIT 9
#define ITBOK_TEST_END ITBOK_EXIT
#endif
@@ -110,13 +113,14 @@
#define ITBOK_OTG_HOST_TEST 17
#define ITBOK_OTG_GADGET_TEST 18
#define ITBOK_UART_TEST 19
-#define ITBOK_EXIT 20
+#define ITBOK_VIDEOIN_CVBS_TEST 20
+#define ITBOK_VIDEOIN_SVIDEO_TEST 21
+#define ITBOK_EXIT 22
#define ITBOK_TEST_END ITBOK_EXIT
#endif
#define NUM_CHAR 1
-#ifdef CONFIG_OMAP3_EVM
#define AUDIO_TEST_COUNT 2
#define TS_TEST_COUNT 2
@@ -124,17 +128,15 @@
#define UART_WRITE_TEST_COUNT 1
#define UART_TEST_COUNT (UART_READ_TEST_COUNT + UART_WRITE_TEST_COUNT)
+#define TVOUT_FILLCLR_TEST_COUNT 1
+#define TVOUT_CLRBAR_TEST_COUNT 1
+#define TVOUT_TEST_COUNT (TVOUT_CLRBAR_TEST_COUNT + TVOUT_FILLCLR_TEST_COUNT)
+
#define LCD_FILLCLR_TEST_COUNT 0
#define LCD_BITMAP_TEST_COUNT 2
#define LCD_TEST_COUNT (LCD_FILLCLR_TEST_COUNT + LCD_BITMAP_TEST_COUNT)
#define BACKLIGHT_TEST_COUNT 1
-#endif
-
-#define TVOUT_FILLCLR_TEST_COUNT 1
-#define TVOUT_CLRBAR_TEST_COUNT 1
-#define TVOUT_TEST_COUNT (TVOUT_CLRBAR_TEST_COUNT + TVOUT_FILLCLR_TEST_COUNT)
-
#define ETHERNET_TEST_COUNT 1
#define GPIODATAIN1 0x98
@@ -161,7 +163,7 @@ char tv_standard[10][20] = { "PAL-60", "NTSC-M", "PAL-BDGHI", "PAL-N", "PAL-M",
static u8 diag_port = 1;
#endif
-#if defined(CONFIG_OMAP3_AM3517EVM) || defined(CONFIG_OMAP3_AM3517CRANE)
+#ifdef CONFIG_OMAP3_AM3517CRANE
static u8 diag_port = 3;
#endif
@@ -174,19 +176,19 @@ extern unsigned char tv_mode;
extern u32 get_gpmc0_type(void);
extern void get_string(U8 port, S8 * str, S16 size);
+#ifdef CONFIG_OMAP3_EVM
extern void get_line(U8 port, S8 * str, S16 size);
extern u32 get_number(U8 port, S8 * str, S16 size);
-
-#ifdef CONFIG_OMAP3_EVM
+extern status_t get_battery_status(void);
extern S32 gpio_pin_init(U16 pin_num, U8 in_out);
extern S32 set_gpio_output(U16 pin_num, U8 set);
extern status_t dvi_fillcolor_test(U8 * color, U8 * image_type);
-extern void rtc_date_time_set(void);
extern int camera_test(void);
-extern status_t get_battery_status(void);
+extern void rtc_date_time_set(void);
+extern void dg_videoin_test(void);
#endif
-#if defined(CONFIG_OMAP3_AM3517EVM) || defined(CONFIG_OMAP3_AM3517CRANE)
+#if defined(CONFIG_OMAP3_EVM) || defined(CONFIG_OMAP3_AM3517CRANE)
extern int diag_mmc_test(int speed);
extern int diag_otg_host_test(void);
extern int diag_otg_gadget_test(void);
@@ -197,23 +199,18 @@ extern int set_dss_gpio(int dir);
extern int set_mmc_gpio(int dir);
extern int set_ccdc_gpio(int dir);
extern int set_i2c2_gpio(int dir);
-extern int set_reswarm_gpio(void);
extern void crane_gpio_clk_init(void);
extern int set_dss_mux(void);
extern int set_mmc_mux(void);
extern int set_ccdc_mux(void);
extern int set_i2c_mux(void);
-extern int set_reset_mux(void);
extern int save_mux_val(void);
extern int restore_mux_val(void);
#endif
int automation(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[]);
-U_BOOT_CMD(itbok, 10, 1, automation,
- "Run menu based diagnostics for given devcie(s)\n",
- "\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n");
-
+U_BOOT_CMD(itbok, 10, 1, automation, "Run menu based diagnostics for given devcie(s)\n", "\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n");
void test_memory(void)
{
@@ -231,18 +228,14 @@ void test_nand(void)
printf("***********************************************************\n");
}
-#if defined(CONFIG_OMAP3_AM3517EVM) || defined(CONFIG_OMAP3_AM3517CRANE)
-
+#ifdef CONFIG_OMAP3_AM3517CRANE
void test_dss_gpio(void)
{
int ret;
ret = set_dss_mux();
- if(ret < 0)
- {
+ if (ret < 0) {
printf("DSS - GPIOs not set\n");
- }
- else
- {
+ } else {
printf("DSS - GPIOs are set\n");
set_dss_gpio(0);
set_dss_gpio(1);
@@ -253,12 +246,9 @@ void test_mmc_gpio(void)
{
int ret;
ret = set_mmc_mux();
- if(ret < 0)
- {
+ if (ret < 0) {
printf("MMC - GPIOs not set \n");
- }
- else
- {
+ } else {
printf("MMC - GPIOs are set\n");
set_mmc_gpio(0);
set_mmc_gpio(1);
@@ -269,10 +259,9 @@ void test_ccdc_gpio(void)
{
int ret;
ret = set_ccdc_mux();
- if(ret < 0)
- printf("CCDC - GPIOs not set \n");
- else
- {
+ if (ret < 0) {
+ printf("CCDC - GPIOs not set \n");
+ } else {
printf("CCDC - GPIOs are set\n");
set_ccdc_gpio(0);
set_ccdc_gpio(1);
@@ -283,29 +272,15 @@ void test_i2c2_gpio(void)
{
int ret;
ret = set_i2c_mux();
- if(ret < 0)
+ if (ret < 0) {
printf("i2c2 - GPIOs not set\n");
- else
- {
+ } else {
printf("i2c2 - GPIOs are set\n");
set_i2c2_gpio(0);
set_i2c2_gpio(1);
}
}
-void test_reswarm_gpio(void)
-{
- int ret;
- ret = set_reset_mux();
- if(ret < 0)
- printf("Reswarm GPIO not set\n");
- else
- {
- printf("Reswarm GPIO is set\n");
- set_reswarm_gpio();
- }
-}
-
void test_gpio(void)
{
int test;
@@ -327,97 +302,151 @@ void test_gpio(void)
printf("Expansion Connector Test\n");
printf("========================\n");
printf("\t1. Test all GPIOs\n\t2. Test DSS GPIO\n"
- "\t3. Test MMC GPIO\n\t4. Test CCDC GPIO\n"
- "\t5. Test i2c2 GPIO\n\t6. Test Resetwarm GPIO\n"
- " \t7. Exit and back to ITBOK Menu\n");
+ "\t3. Test MMC GPIO\n\t4. Test CCDC GPIO - Not Available\n"
+ "\t5. Test i2c2 GPIO\n"
+ "\t6. Exit and back to ITBOK Menu\n");
printf("Please enter test option: ");
test = get_number(diag_port, (S8 *) input, 3);
printf("\n\n");
if ((test < 1) || (test > 7)) {
- printf("Invalid Input %d, Enter Options from 1 to 6\n", test);
+ printf("Invalid Input %d, Enter Options from 1 to 6 \
+ \n", test);
continue;
}
switch (test) {
- case 1:
- test_dss_gpio();
- test_mmc_gpio();
- /*test_ccdc_gpio();*/
- test_i2c2_gpio();
- test_reswarm_gpio();
- ret = restore_mux_val();
- if(ret < 0)
+ case 1:
+ test_dss_gpio();
+ test_mmc_gpio();
+ /*test_ccdc_gpio();*/
+ test_i2c2_gpio();
+ ret = restore_mux_val();
+ if (ret < 0) {
printf("Restoring mux values - Failed\n");
- else {
+ } else {
printf("Restoring mux values - Passed\n");
printf("-----------------------------\n");
printf("***** GPIO test finished*****\n");
printf("-----------------------------\n");
printf("Exiting to ITBOK menu....\n");
return;
- }
- break;
-
- case 2:
- test_dss_gpio();
- break;
- case 3:
- test_mmc_gpio();
- break;
-
- /*case 4:
- test_ccdc_gpio(); // connector is not available
- break;*/
-
- case 5:
- test_i2c2_gpio();
- break;
-
- case 6:
- test_reswarm_gpio();
- break;
-
- case 7:
- ret = restore_mux_val();
- if(ret < 0)
+ }
+ break;
+
+ case 2:
+ test_dss_gpio();
+ break;
+
+ case 3:
+ test_mmc_gpio();
+ break;
+
+ /*case 4:
+ test_ccdc_gpio(); // connector is not available
+ break;*/
+
+ case 5:
+ test_i2c2_gpio();
+ break;
+
+ case 6:
+ ret = restore_mux_val();
+ if (ret < 0) {
printf("Restoring mux values - Failed\n");
- else
+ } else {
printf("Restoring mux values - Passed\n");
printf("-----------------------------\n");
printf("***** GPIO test finished*****\n");
printf("-----------------------------\n");
printf("Exiting to ITBOK menu....\n");
return;
- break;
- default:
- ret = restore_mux_val();
- if(ret < 0)
+ }
+ break;
+
+ default:
+ ret = restore_mux_val();
+ if (ret < 0) {
printf("Restoring mux values - Failed\n");
- else
+ } else {
printf("Restoring mux values - Passed\n");
- printf("Unknown input. Not Supported!!!\n");
- break;
- }
- }
+ printf("Unknown input. Not Supported!!!\n");
+ }
+ break;
+ }
+ }
}
#endif
-#if defined(CONFIG_OMAP3_EVM) || defined(CONFIG_OMAP3_AM3517EVM)\
- || defined(CONFIG_OMAP3_AM3517CRANE)
-void test_mmc_24mhz(void)
+#if defined(CONFIG_OMAP3_EVM) || defined(CONFIG_OMAP3_AM3517CRANE)
+void test_tvOut(void)
{
- int flag = 1;
+ int i;
+ tv_mode = 0;
-/* printf("Please insert the SD/MMC card\n");
- printf("Press ENTER to continue\n");
- get_string(diag_port, button_press, 1);*/
+ printf("\nStarting TV-OUT Test...\n");
- if (diag_mmc_test(0) < 0) {
- flag = 0;
+ for (i = 0; i < TVOUT_CLRBAR_TEST_COUNT; i++) {
+ printf("Displaying colorbar in %s standard\n", tv_standard[i]);
+ diag_tvout_colorbar((u8 *) tv_standard[i]);
+
+ printf("Is the colorbar displayed on TV in %s standard proper?"
+ "(y/n): ", tv_standard[i]);
+
+ get_string(diag_port, button_press, NUM_CHAR);
+
+ c = button_press[0];
+ while ((c != 'y') && (c != 'Y') && (c != 'n') && (c != 'N')) {
+ if (c == '\r')
+ printf("\nPlease enter (y/n) ");
+ printf("\b");
+ get_string(diag_port, button_press, NUM_CHAR);
+ c = button_press[0];
+ }
+
+ if ((c == 'y') || (c == 'Y')) {
+ printf("\nColorbar test in %s standard... PASSED\n",
+ tv_standard[i]);
+ pass_count++;
+ } else {
+ printf("\nColorbar test in %s standard... FAILED\n",
+ tv_standard[i]);
+ }
+ }
+
+ i = 1;
+ printf("Displaying %s color in %s standard\n",
+ colorDisp[i], tv_standard[i]);
+
+ diag_tvout_fillcolour((u8 *) color[i], (u8 *) tv_standard[i]);
+
+ printf("Is the TV screen in %s color, %s standard proper? (y/n): ",
+ colorDisp[i], tv_standard[i]);
+
+ get_string(diag_port, button_press, NUM_CHAR);
+
+ c = button_press[0];
+ while ((c != 'y') && (c != 'Y') && (c != 'n') && (c != 'N')) {
+ if (c == '\r')
+ printf("\nPlease enter (y/n) ");
+ printf("\b");
+ get_string(diag_port, button_press, NUM_CHAR);
+ c = button_press[0];
+ }
+ if ((c == 'y') || (c == 'Y')) {
+ printf("\nFillcolor test in %s color, %s standard... PASSED\n",
+ colorDisp[i], tv_standard[i]);
+ pass_count++;
+ } else {
+ printf("\nFillcolor test in %s color, %s standard... FAILED\n",
+ colorDisp[i], tv_standard[i]);
}
- printf("\nMMC Test in 24MHz mode Completed... %s\n", ((flag) ? "PASS" : "FAIL"));
+ printf("\nTVOUT Test Completed... %s\n",
+ ((pass_count == TVOUT_TEST_COUNT) ? "PASS" : "FAIL"));
+ pass_count = 0;
printf("***********************************************************\n");
+
+ out_regl(DSS_CONTROL, 0x0);
}
/* testing ethernet */
@@ -428,12 +457,10 @@ void ethernet_test(void)
printf("\nStarting Ethernet Test...\n");
- /* pre-set load_addr */
s = getenv("serverip");
- if(s != NULL)
- {
+ /* pre-set load_addr */
+ if (s != NULL)
load_addr = simple_strtoul(s, NULL, 16);
- }
printf("Server IP address is %s\n", s);
NetPingIP = string_to_ip(s);
@@ -472,23 +499,88 @@ void ethernet_test(void)
}
exit0:
- printf("\nEthernet Test Completed... %s\n", ((pass_count == 0) ? "FAIL" : "PASS"));
+ printf("\nEthernet Test Completed... %s\n",
+ ((pass_count == 0) ? "FAIL" : "PASS"));
pass_count = 0;
- printf("*********************************************************\n");
+ printf("***********************************************************\n");
}
-void test_tvOut(void)
+void test_mmc_24mhz(void)
+{
+ int flag = 1;
+
+ printf("Please insert the SD/MMC card\n");
+ printf("Press ENTER to continue\n");
+ get_string(diag_port, button_press, 1);
+
+ if (diag_mmc_test(0) < 0)
+ flag = 0;
+
+ printf("\nMMC Test in 24MHz mode Completed... %s\n",
+ ((flag) ? "PASS" : "FAIL"));
+ printf("***********************************************************\n");
+}
+
+/* OTG host test */
+void test_otg_host(void)
+{
+ int flag = 1;
+
+ printf("Insert the USB pendrive formatted with FAT(16) only to OTG port"
+ " and press any to continue .......\n");
+ get_string(diag_port, button_press, NUM_CHAR);
+ c = button_press[0];
+
+ printf("\nStarting OTG Host Test...\n");
+ if (diag_otg_host_test() < 0)
+ flag = 0;
+
+ printf("\nOTG Host Test Completed... %s\n", ((flag) ? "PASS" : "FAIL"));
+ printf("***********************************************************\n");
+}
+
+/* OTG gadget test */
+void test_otg_gadget(void)
+{
+ int flag = 1;
+
+ printf("\nStarting OTG Gadget Test...\n");
+
+#if defined(CONFIG_MUSB_UDC)
+ printf("Open the minicom on the Linux machine\n");
+ printf("Make sure that the USB OTG cable is connected between ");
+ printf("Target board and Linux machine\n");
+ printf("Press any key to continue..... \n");
+ get_string(diag_port, button_press, NUM_CHAR);
+ c = button_press[0];
+
+ printf("Now the u-boot prompt is at Linux Machine\n");
+#endif
+
+ if (diag_otg_gadget_test() < 0)
+ flag = 0;
+
+ printf("\nOTG Gadget Test Completed... %s\n",
+ ((flag) ? "PASS" : "FAIL"));
+ printf("***********************************************************\n");
+}
+
+#endif
+
+#ifdef CONFIG_OMAP3_EVM
+void test_svideoOut(void)
{
int i;
- tv_mode = 0;
- pass_count = 0;
- printf("\nStarting TV-OUT Test...\n");
+
+ tv_mode = 1;
+
+ printf("\nStarting S-VIDEO Test...\n");
for (i = 0; i < TVOUT_CLRBAR_TEST_COUNT; i++) {
printf("Displaying colorbar in %s standard\n", tv_standard[i]);
- diag_tvout_colorbar((u8 *) tv_standard[i]);
-
- printf("Is the colorbar displayed on TV in %s standard proper? (y/n): ", tv_standard[i]);
+ diag_svideo_colorbar((u8 *) tv_standard[i]);
+ printf("Is the colorbar displayed on TV in %s standard"
+ "proper? (y/n): ", tv_standard[i]);
get_string(diag_port, button_press, NUM_CHAR);
@@ -502,18 +594,24 @@ void test_tvOut(void)
}
if ((c == 'y') || (c == 'Y')) {
- printf("\nColorbar test in %s standard... PASSED \n", tv_standard[i]);
+ printf("\nColorbar test in %s standard... PASSED\n",
+ tv_standard[i]);
pass_count++;
} else {
- printf("\nColorbar test in %s standard... FAILED \n", tv_standard[i]);
+ printf("\nColorbar test in %s standard... FAILED\n",
+ tv_standard[i]);
}
}
i = 1;
- printf("Displaying %s color in %s standard\n", colorDisp[i], tv_standard[i]);
- diag_tvout_fillcolour((u8 *) color[i], (u8 *) tv_standard[i]);
+ printf("Displaying %s color in %s standard\n",
+ colorDisp[i], tv_standard[i]);
+
+ diag_svideo_fillcolour((u8 *) color[i], (u8 *) tv_standard[i]);
+
+ printf("Is the TV screen in %s color, %s standard proper? (y/n): ",
+ colorDisp[i], tv_standard[i]);
- printf("Is the TV screen in %s color, %s standard proper? (y/n): ", colorDisp[i], tv_standard[i]);
get_string(diag_port, button_press, NUM_CHAR);
c = button_press[0];
@@ -525,66 +623,69 @@ void test_tvOut(void)
c = button_press[0];
}
if ((c == 'y') || (c == 'Y')) {
- printf("\nFillcolor test in %s color, %s standard... PASSED \n", colorDisp[i], tv_standard[i]);
+ printf("\nFillcolor test in %s color, %s standard...PASSED \n",
+ colorDisp[i], tv_standard[i]);
pass_count++;
} else {
- printf("\nFillcolor test in %s color, %s standard... FAILED \n", colorDisp[i], tv_standard[i]);
+ printf("\nFillcolor test in %s color, %s standard...FAILED \n",
+ colorDisp[i], tv_standard[i]);
}
-
- printf("\nTVOUT Test Completed... %s\n", ((pass_count == TVOUT_TEST_COUNT) ? "PASS" : "FAIL"));
+ printf("\nS-VIDEO Test Completed... %s\n",
+ ((pass_count == TVOUT_TEST_COUNT) ? "PASS" : "FAIL"));
pass_count = 0;
printf("***********************************************************\n");
out_regl(DSS_CONTROL, 0x0);
}
+unsigned int videoin_select;
-
-/* OTG host test */
-void test_otg_host(void)
+/* videoin s-video test */
+void test_videoin_svideo(void)
{
int flag = 1;
-/* printf("Insert the USB pendrive formatted with FAT(16) only to OTG port" " and press any to continue .......\n");
+ videoin_select = VIDEOIN_SVIDEO;
+
+ printf("Connect one end of S-Video cable to S-VIDEO In of target\n"
+ "board and another end to DVD Player and Play some video\n"
+ " and press any to continue .......\n");
get_string(diag_port, button_press, NUM_CHAR);
- c = button_press[0];*/
+ c = button_press[0];
- printf("\nStarting OTG Host Test...\n");
- if (diag_otg_host_test() < 0) {
- flag = 0;
- }
- printf("\nOTG Host Test Completed... %s\n", ((flag) ? "PASS" : "FAIL"));
+ printf("\nStarting VideoIN S-Video Test...\n");
+
+ /* enable clock interface/functional clock */
+ dg_videoin_test();
+
+ printf("\nVideoIn S-Video Test Completed... %s\n",
+ ((flag) ? "PASS" : "FAIL"));
printf("***********************************************************\n");
}
-/* OTG gadget test */
-void test_otg_gadget(void)
+/* videoin CVBS test */
+void test_videoin_cvbs(void)
{
int flag = 1;
- printf("\nStarting OTG Gadget Test...\n");
+ videoin_select = VIDEOIN_CVBS;
-#if defined(CONFIG_MUSB_UDC)
- printf("Open the minicom on the Linux machine\n");
- printf("Make sure that the USB OTG cable is connected between ");
- printf("Target board and Linux machine\n");
- printf("Press any key to continue..... \n");
+ printf("Connect one end of Composite video cable to CVBS In of target\n"
+ "board and another end to DVD Player and Play some video\n"
+ " and press any to continue .......\n");
get_string(diag_port, button_press, NUM_CHAR);
c = button_press[0];
- printf("Now the u-boot prompt is at Linux Machine\n");
-#endif
+ printf("\nStarting VideoIN CVBS Test...\n");
- if (diag_otg_gadget_test() < 0) {
- flag = 0;
- }
+ /* enable clock interface/functional clock */
+ dg_videoin_test();
- printf("\nOTG Gadget Test Completed... %s\n", ((flag) ? "PASS" : "FAIL"));
+ printf("\nVideoIn CVBS Test Completed... %s\n",
+ ((flag) ? "PASS" : "FAIL"));
printf("***********************************************************\n");
}
-#endif
-#ifdef CONFIG_OMAP3_EVM /* EVM 3530 */
void test_audio(void)
{
@@ -597,7 +698,7 @@ void test_audio(void)
time = (u8) FIVE_SEC;
volume = (u32) TEN;
printf("\nStarting Audio Test...\n");
- printf("Connect loopback cable between audio source(PC) and audio-in\n");
+ printf("Connect loopback cable between audio source(PC) & audio-in\n");
printf("Start audio application(windows media player) on the PC\n");
printf("Connect headset to audio-out\n");
printf("Press ENTER to continue\n");
@@ -645,7 +746,8 @@ void test_audio(void)
} else {
printf("\nAudio LOOPBACK Test... FAIL\n");
}
- printf("\nAudio Test Completed... %s\n", ((pass_count == AUDIO_TEST_COUNT) ? "PASS" : "FAIL"));
+ printf("\nAudio Test Completed... %s\n",
+ ((pass_count == AUDIO_TEST_COUNT) ? "PASS" : "FAIL"));
pass_count = 0;
printf("***********************************************************\n");
@@ -707,7 +809,8 @@ void test_touchScreen(void)
} else {
printf("\nPen status Test... FAIL\n");
}
- printf("\nTouch Screen Test Completed... %s\n", ((pass_count == TS_TEST_COUNT) ? "PASS" : "FAIL"));
+ printf("\nTouch Screen Test Completed... %s\n",
+ ((pass_count == TS_TEST_COUNT) ? "PASS" : "FAIL"));
pass_count = 0;
printf("***********************************************************\n");
@@ -725,13 +828,15 @@ void test_uart(void)
printf("\nStarting UART Test...\n");
printf("Testing UART%u Read\n", (port + 1));
- printf("Please make sure UART%u is connected to PC before proceeding further and press enter to continue\n",(port + 1));
+ printf("Please make sure UART%u is connected to PC before proceeding"
+ " further and press enter to continue\n", (port + 1));
get_string(diag_port, button_press, NUM_CHAR);
printf("Enter %u charecters on UART%u\n", size, (port + 1));
diag_uart_read(port, size);
- printf("\nAre the characters displayed properly on UART(which is executing tests)? (y/n): ");
+ printf("\nAre the characters displayed properly on UART"
+ "(which is executing tests)? (y/n): ");
get_string(diag_port, button_press, NUM_CHAR);
@@ -753,12 +858,14 @@ void test_uart(void)
printf("Testing UART%u Write\n", (port + 1));
- printf("Enter %u charecters on UART(which one executing tests) and press ENTER\n", size);
+ printf("Enter %u charecters on UART(which one executing tests)"
+ "and press ENTER\n", size);
get_line(diag_port, (S8 *) str, 20);
str[size] = '\0';
diag_uart_write(port, str);
- printf("\nAre the characters displayed properly on UART(which is opened newly)? (y/n): ");
+ printf("\nAre the characters displayed properly on UART"
+ "(which is opened newly)? (y/n): ");
get_string(diag_port, button_press, NUM_CHAR);
@@ -778,7 +885,8 @@ void test_uart(void)
printf("\nWrite Test on UART%u... FAILED \n", (port + 1));
}
- printf("\nUART Test Completed... %s\n", ((pass_count == UART_TEST_COUNT) ? "PASS" : "FAIL"));
+ printf("\nUART Test Completed... %s\n",
+ ((pass_count == UART_TEST_COUNT) ? "PASS" : "FAIL"));
printf("***********************************************************\n");
pass_count = 0;
@@ -854,104 +962,19 @@ void test_lcd(void)
}
if ((c == 'y') || (c == 'Y')) {
- printf("\nLCD Fillcolor %s test... PASSED \n", colorDisp[i]);
- pass_count++;
- } else {
- printf("\nLCD Fillcolor %s test... FAILED \n", colorDisp[i]);
- }
- }
- printf("\nLCD Test Completed... %s\n", ((pass_count == LCD_TEST_COUNT) ? "PASS" : "FAIL"));
- pass_count = 0;
- printf("***********************************************************\n");
-
-}
-
-/* DVI Test */
-void test_dvi(void)
-{
-
- unsigned char byte;
- printf("\nStarting DVI Test...\n");
-
- gpio_pin_init(69, 0);
- set_gpio_output(69, 0);
-
- byte = 0xfd;
- i2c_write(PWRMGT_ADDR_ID2, GPIODATADIR1, 1, &byte, 1);
-
- byte = 0x80;
- i2c_write(PWRMGT_ADDR_ID2, GPIODATAOUT1, 1, &byte, 1);
-
- byte = 0xaa;
- i2c_write(PWRMGT_ADDR_ID2, GPIOPUPDCTR1, 1, &byte, 1);
-
- byte = 0xaa;
- i2c_write(PWRMGT_ADDR_ID2, GPIOPUPDCTR1, 1, &byte, 1);
-
- dvi_fillcolor_test((U8 *) "red", (U8 *) "vga");
- return;
-}
-
-/* s-video test */
-void test_svideoOut(void)
-{
- int i;
-
- tv_mode = 1;
-
- printf("\nStarting S-VIDEO Test...\n");
-
- for (i = 0; i < TVOUT_CLRBAR_TEST_COUNT; i++) {
- printf("Displaying colorbar in %s standard\n", tv_standard[i]);
- diag_svideo_colorbar((u8 *) tv_standard[i]);
- printf("Is the colorbar displayed on TV in %s standard proper? (y/n): ", tv_standard[i]);
-
- get_string(diag_port, button_press, NUM_CHAR);
-
- c = button_press[0];
- while ((c != 'y') && (c != 'Y') && (c != 'n') && (c != 'N')) {
- if (c == '\r')
- printf("\nPlease enter (y/n) ");
- printf("\b");
- get_string(diag_port, button_press, NUM_CHAR);
- c = button_press[0];
- }
-
- if ((c == 'y') || (c == 'Y')) {
- printf("\nColorbar test in %s standard... PASSED \n", tv_standard[i]);
+ printf("\nLCD Fillcolor %s test... PASSED \
+ \n", colorDisp[i]);
pass_count++;
} else {
- printf("\nColorbar test in %s standard... FAILED \n", tv_standard[i]);
+ printf("\nLCD Fillcolor %s test... FAILED \
+ \n", colorDisp[i]);
}
}
-
- i = 1;
- printf("Displaying %s color in %s standard\n", colorDisp[i], tv_standard[i]);
- diag_svideo_fillcolour((u8 *) color[i], (u8 *) tv_standard[i]);
-
- printf("Is the TV screen in %s color, %s standard proper? (y/n): ", colorDisp[i], tv_standard[i]);
-
- get_string(diag_port, button_press, NUM_CHAR);
-
- c = button_press[0];
- while ((c != 'y') && (c != 'Y') && (c != 'n') && (c != 'N')) {
- if (c == '\r')
- printf("\nPlease enter (y/n) ");
- printf("\b");
- get_string(diag_port, button_press, NUM_CHAR);
- c = button_press[0];
- }
- if ((c == 'y') || (c == 'Y')) {
- printf("\nFillcolor test in %s color, %s standard... PASSED \n", colorDisp[i], tv_standard[i]);
- pass_count++;
- } else {
- printf("\nFillcolor test in %s color, %s standard... FAILED \n", colorDisp[i], tv_standard[i]);
- }
- printf("\nS-VIDEO Test Completed... %s\n", ((pass_count == TVOUT_TEST_COUNT) ? "PASS" : "FAIL"));
+ printf("\nLCD Test Completed... %s\n",
+ ((pass_count == LCD_TEST_COUNT) ? "PASS" : "FAIL"));
pass_count = 0;
printf("***********************************************************\n");
- out_regl(DSS_CONTROL, 0x0);
}
/* Read battery charging status */
@@ -969,35 +992,6 @@ void test_battery(void)
printf("***********************************************************\n");
}
-/* RTC Test */
-void test_rtc(void)
-{
- printf("***********************************************************\n");
- printf("\nStarting RTC Test...\n");
- rtc_date_time_set();
- printf("***********************************************************\n");
-
- printf("\nIs date and time is proper (y/n): ");
- get_string(diag_port, button_press, NUM_CHAR);
- c = button_press[0];
- while ((c != 'y') && (c != 'Y') && (c != 'n') && (c != 'N')) {
- if (c == '\r')
- printf("\nPlease enter (y/n) ");
- printf("\n");
-
- get_string(diag_port, button_press, NUM_CHAR);
- c = button_press[0];
- }
-
- if ((c == 'y') || (c == 'Y')) {
- printf("\nRTC Test... PASS\n");
- pass_count++;
- } else {
- printf("\nRTC Test... FAIL\n");
- }
- return;
-}
-
/* LCD back light test */
void test_lcd_backlight(void)
{
@@ -1023,8 +1017,8 @@ void test_lcd_backlight(void)
byte = ~(LEDAPWM | LEDAON);
i2c_write(PWRMGT_ADDR_ID3, LEDEN, 1, &byte, 1);
/* work around: There is problem in switching off the LCD
- backlight after executing the audio test
- to fix this, writing the LEDEN register again */
+ backlight after executing the audio test
+ to fix this, writing the LEDEN register again */
byte = ~(LEDAPWM | LEDAON);
i2c_write(PWRMGT_ADDR_ID3, LEDEN, 1, &byte, 1);
}
@@ -1046,8 +1040,8 @@ void test_lcd_backlight(void)
byte = (LEDAPWM | LEDAON);
i2c_write(PWRMGT_ADDR_ID3, LEDEN, 1, &byte, 1);
/* work around: There is problem in switching off the LCD
- backlight after executing the audio test
- to fix this, writing the LEDEN register again */
+ backlight after executing the audio test
+ to fix this, writing the LEDEN register again */
byte = (LEDAPWM | LEDAON);
i2c_write(PWRMGT_ADDR_ID3, LEDEN, 1, &byte, 1);
}
@@ -1071,7 +1065,8 @@ void test_lcd_backlight(void)
printf("\nLCD Back Light Test... FAIL\n");
}
- printf("\nLCD back light Test Completed... %s\n", ((pass_count == BACKLIGHT_TEST_COUNT) ? "PASS" : "FAIL"));
+ printf("\nLCD back light Test Completed... %s\n",
+ ((pass_count == BACKLIGHT_TEST_COUNT) ? "PASS" : "FAIL"));
pass_count = 0;
printf("***********************************************************\n");
}
@@ -1227,6 +1222,75 @@ void test_audio_headset(void)
return;
}
+/* DVI Test */
+void test_dvi(void)
+{
+
+ unsigned char byte;
+ printf("\nStarting DVI Test...\n");
+
+ gpio_pin_init(69, 0);
+ set_gpio_output(69, 0);
+
+ byte = 0xfd;
+ i2c_write(PWRMGT_ADDR_ID2, GPIODATADIR1, 1, &byte, 1);
+
+ byte = 0x80;
+ i2c_write(PWRMGT_ADDR_ID2, GPIODATAOUT1, 1, &byte, 1);
+
+ byte = 0xaa;
+ i2c_write(PWRMGT_ADDR_ID2, GPIOPUPDCTR1, 1, &byte, 1);
+
+ byte = 0xaa;
+ i2c_write(PWRMGT_ADDR_ID2, GPIOPUPDCTR1, 1, &byte, 1);
+
+ dvi_fillcolor_test((U8 *) "red", (U8 *) "vga");
+ return;
+}
+
+/* Camera Test */
+void test_camera(void)
+{
+ int flag = 1;
+ printf("\nStarting Camera Test...\n");
+ printf("Please insert the Micron camera module\n");
+ printf("Press ENTER to continue\n");
+ get_string(diag_port, button_press, 1);
+ if (camera_test() < 0)
+ flag = 0;
+ printf("\nCamera Test Completed... %s\n", ((flag) ? "PASS" : "FAIL"));
+ return;
+}
+
+/* RTC Test */
+void test_rtc(void)
+{
+ printf("***********************************************************\n");
+ printf("\nStarting RTC Test...\n");
+ rtc_date_time_set();
+ printf("***********************************************************\n");
+
+ printf("\nIs date and time is proper (y/n): ");
+ get_string(diag_port, button_press, NUM_CHAR);
+ c = button_press[0];
+ while ((c != 'y') && (c != 'Y') && (c != 'n') && (c != 'N')) {
+ if (c == '\r')
+ printf("\nPlease enter (y/n) ");
+ printf("\n");
+
+ get_string(diag_port, button_press, NUM_CHAR);
+ c = button_press[0];
+ }
+
+ if ((c == 'y') || (c == 'Y')) {
+ printf("\nRTC Test... PASS\n");
+ pass_count++;
+ } else {
+ printf("\nRTC Test... FAIL\n");
+ }
+ return;
+}
+
void test_mmc_48mhz(void)
{
int flag = 1;
@@ -1238,7 +1302,8 @@ void test_mmc_48mhz(void)
if (diag_mmc_test(1) < 0) {
flag = 0;
}
- printf("\nMMC Test in 48MHz mode Completed... %s\n", ((flag) ? "PASS" : "FAIL"));
+ printf("\nMMC Test in 48MHz mode Completed... %s\n",
+ ((flag) ? "PASS" : "FAIL"));
printf("***********************************************************\n");
}
@@ -1250,12 +1315,14 @@ void test_mmc(void)
while (1) {
printf("MMC Test\n");
printf("========\n");
- printf(" 1. MMC in 24MHz mode\n 2. MMC in 48MHz mode\n 3. Exit and back to ITBOK Menu\n");
+ printf(" 1. MMC in 24MHz mode\n 2. MMC in 48MHz mode\n"
+ "3. Exit and back to ITBOK Menu\n");
printf("Please enter test option: ");
test = get_number(diag_port, (S8 *) input, 3);
printf("\n\n");
if ((test < 1) || (test > 3)) {
- printf("Invalid Input %d, Enter Options from 1 to 3\n", test);
+ printf("Invalid Input %d, Enter Options from 1 to 3\n",
+ test);
continue;
}
@@ -1279,26 +1346,12 @@ void test_mmc(void)
}
}
-/* Camera Test */
-void test_camera(void)
-{
- int flag = 1;
- printf("\nStarting Camera Test...\n");
- printf("Please insert the Micron camera module\n");
- printf("Press ENTER to continue\n");
- get_string(diag_port, button_press, 1);
- if (camera_test() < 0)
- flag = 0;
- printf("\nCamera Test Completed... %s\n", ((flag) ? "PASS" : "FAIL"));
- return;
-}
-
#endif
/*
- * *******************************************************************************
+ * *****************************************************************************
* Automation - main function
- * *******************************************************************************
+ * *****************************************************************************
*/
int automation(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
{
@@ -1313,36 +1366,41 @@ int automation(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
while (1) {
if (!print_mask) {
-
- #ifdef CONFIG_OMAP3_EVM
+#ifdef CONFIG_OMAP3_EVM
printf("\r------------------------------------\n");
printf("\tITBOK MENU\n");
printf("------------------------------------\n");
- printf
- (" 1. Run All Tests (Options 2 to 16)\n 2. Run Memory Test\n 3. Run NAND Test\n"
- " 4. Run Audio Headset Detection Test\n 5. Run Audio Test\n 6. Run Keypad Test\n"
- " 7. Run Touchscreen Test\n 8. Run LCD Backlight Test\n 9. Run LCD Test\n"
- " 10. Run Battery Test\n 11. Run TV-out Test\n 12. Run S-Video Test\n"
- " 13. Run RTC Test\n 14. Run Ethernet Test\n 15. Run MMC Test\n"
- " 16. Run Camera Test\n 17. Run OTG Host Test\n"
- " 18. Run OTG Gadget Test\n 19. Run UART Test\n 20. EXIT\n");
+ printf(" 1. Run All Tests (Options 2 to 16)\n"
+ " 2. Run Memory Test\n 3. Run NAND Test\n"
+ " 4. Run Audio Headset Detection Test\n"
+ " 5. Run Audio Test\n 6. Run Keypad Test\n"
+ " 7. Run Touchscreen Test\n"
+ " 8. Run LCD Backlight Test\n"
+ " 9. Run LCD Test\n 10. Run Battery Test\n"
+ " 11. Run TV-out Test\n 12. Run S-Video Test\n"
+ " 13. Run RTC Test\n 14. Run Ethernet Test\n"
+ " 15. Run MMC Test\n 16. Run Camera Test\n"
+ " 17. Run OTG Host Test\n 18. Run OTG Gadget Test\n"
+ " 19. Run UART Test\n 20. Run Video-in CVBS Test\n"
+ " 21. Run Video-in S-Video Test\n 22. Exit\n");
printf("------------------------------------\n");
printf("\tITBOK MENU\n");
printf("------------------------------------\n");
- #elif ((CONFIG_OMAP3_AM3517EVM) || (CONFIG_OMAP3_AM3517CRANE))
+#elif (CONFIG_OMAP3_AM3517CRANE)
printf("--------------------------------------\n");
- printf(" CRANE - ITBOK MENU \n");
+ printf(" CRANE - ITBOK MENU \n");
printf("--------------------------------------\n");
- printf
- (" 1. Run All Tests (Options 2 to 10)\n 2. Run RAM Test\n 3. Run NAND Test\n"
- " 4. Run Ethernet Test\n 5. Run MMC Test\n 6. Run OTG Host Test\n"
- " 7. Run OTG Gadget Test\n 8. Run TV-out Test\n 9. Run GPIO test\n 10. EXIT\n");
+ printf(" 1. Run All Tests (Options 2 to 10)\n"
+ " 2. Run RAM Test\n 3. Run NAND Test\n"
+ " 4. Run Ethernet Test\n 5. Run MMC Test\n"
+ " 6. Run OTG Host Test\n"
+ " 7. Run TV-out Test\n 8. Run GPIO Test\n"
+ " 9. EXIT\n");
printf("--------------------------------------\n");
- printf(" CRANE - ITBOK MENU \n");
+ printf(" CRANE - ITBOK MENU \n");
printf("--------------------------------------\n");
-
- #endif
+#endif
}
printf("Please enter test option: ");
@@ -1350,7 +1408,8 @@ int automation(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
printf("\n\n");
if ((test < 1) || (test > ITBOK_TEST_END)) {
- printf("Invalid Input %d, Enter Options from 1 to %d\n", test, ITBOK_TEST_END);
+ printf("Invalid Input %d, Enter Options from 1 to %d\n",
+ test, ITBOK_TEST_END);
print_mask = 0;
continue;
}
@@ -1358,80 +1417,70 @@ int automation(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
switch (test) {
case ITBOK_ALL_TESTS:
{
- /* Memory Test */
+ /* Memory Test */
test_memory();
- /* NAND Test */
+ /* NAND Test */
test_nand();
-#if defined(CONFIG_OMAP3_EVM) || defined(CONFIG_OMAP3_AM3517EVM) || defined(CONFIG_OMAP3_AM3517CRANE)
- /* Ethernet test */
+#if defined(CONFIG_OMAP3_EVM) || defined(CONFIG_OMAP3_AM3517CRANE)
+ /* Ethernet test */
ethernet_test();
- /* MMC Test */
+ /* MMC Test */
test_mmc_24mhz();
- /* OTG host test */
+ /* OTG Host test */
test_otg_host();
- /* TV-OUT test */
+ /* TV-OUT test */
test_tvOut();
-
#endif
-#if defined(CONFIG_OMAP3_AM3517EVM) || defined(CONFIG_OMAP3_AM3517CRANE)
+#ifdef CONFIG_OMAP3_AM3517CRANE
/* GPIO test */
test_gpio();
#endif
#ifdef CONFIG_OMAP3_EVM
-
- /* Audio Headset detection test */
+ /* Audio Headset detection test */
test_audio_headset();
- /* Audio test */
+ /* Audio test */
test_audio();
- /* Key pad test */
+ /* Key pad test */
test_keypad();
- /* Touch Screen test */
+ /* Touch Screen test */
test_touchScreen();
- /* LCD Backlight test */
+ /* LCD Backlight test */
test_lcd_backlight();
- /* LCD test */
+ /* LCD test */
test_lcd();
- /* Battery Test */
+ /* Battery Test */
test_battery();
- /* RTC Test */
- test_rtc();
-
- /* DVI test */
- test_dvi();
-
- /* SVIDEO-OUT test */
+ /* SVIDEO-OUT test */
test_svideoOut();
- /* Camera Test */
- test_camera();
-
- /* UART test */
- test_uart();
-
+ /* RTC Test */
+ test_rtc();
+ /* Camera Test */
+ test_camera();
- printf("***********************************************************\n");
- printf(">>>>>>>>>>>>>>>>> ALL THE TESTS COMPLETED <<<<<<<<<<<<<<<<<\n");
- printf(">>>>>>>>>> Please refer summary file and log file <<<<<<<<<\n");
- printf("Note: Summary and log files are available only if \n");
- printf(" the itbok was ran through TTL script \n");
- printf("***********************************************************\n");
+ printf("***********************************************************\n");
+ printf(">>>>>>>>>>>>>>>>> ALL THE TESTS COMPLETED <<<<<<<<<<<<<<<<<\n");
+ printf(">>>>>>>>>> Please refer summary file and log file <<<<<<<<<\n");
+ printf("Note: Summary and log files are available only if \n");
+ printf(" the itbok was ran through TTL script \n");
+ printf("***********************************************************\n");
#endif
- /* Exit */
+ /* Exit */
printf("\nExiting ITBOK Test menu...\n");
return 0;
@@ -1450,15 +1499,7 @@ int automation(cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
}
break;
-#if defined(CONFIG_OMAP3_AM3517EVM) || defined(CONFIG_OMAP3_AM3517CRANE)
- case ITBOK_GPIO_TEST:
- {
- test_gpio();
- }
- break;
-#endif
-
-#if defined(CONFIG_OMAP3_EVM) || defined(CONFIG_OMAP3_AM3517EVM) || defined(CONFIG_OMAP3_AM3517CRANE)
+#if defined(CONFIG_OMAP3_EVM) || defined(CONFIG_OMAP3_AM3517CRANE)