diff --git a/arch/arm/src/am335x/Kconfig b/arch/arm/src/am335x/Kconfig index 43c2de66537..727eec587cc 100644 --- a/arch/arm/src/am335x/Kconfig +++ b/arch/arm/src/am335x/Kconfig @@ -98,6 +98,7 @@ config AM335X_LCDC bool "LCD controller" default n depends on VIDEO && EXPERIMENTAL + select LCD select VIDEO_EDID config AM335X_TSC diff --git a/configs/beaglebone-black/Kconfig b/configs/beaglebone-black/Kconfig index 15b14ece171..c4e4b4eafb1 100644 --- a/configs/beaglebone-black/Kconfig +++ b/configs/beaglebone-black/Kconfig @@ -4,4 +4,14 @@ # if ARCH_BOARD_BEAGLEBONE_BLACK + +config BEAGLEBONE_VIDEOMODE + string "LCD Video Mode" + default "640x480x60" + depends on !CONFIG_LCD_TDA19988 || !CONFIG_AM335X_I2C2 + ---help--- + If we are not using HDMI (via the TDA19988) then we must select a + fixed LCD resolution. The default, "640x480x60" is standard VGA + which should be supported by all LCDs. + endif # ARCH_BOARD_BEAGLEBONE_BLACK diff --git a/configs/beaglebone-black/src/Makefile b/configs/beaglebone-black/src/Makefile index 20b1f72ab5e..a07bdad246e 100644 --- a/configs/beaglebone-black/src/Makefile +++ b/configs/beaglebone-black/src/Makefile @@ -51,7 +51,7 @@ CSRCS += am335x_buttons.c endif ifeq ($(CONFIG_AM335X_LCDC),y) -CSRCS += am335x_lcdc.c +CSRCS += am335x_lcd.c endif include $(TOPDIR)/configs/Board.mk diff --git a/configs/beaglebone-black/src/am335x_lcd.c b/configs/beaglebone-black/src/am335x_lcd.c index c938ed844c9..0a4dd53577b 100644 --- a/configs/beaglebone-black/src/am335x_lcd.c +++ b/configs/beaglebone-black/src/am335x_lcd.c @@ -42,12 +42,13 @@ #include #include #include +#include #include #include #include -#include "am335x_lcd.h" +#include "am335x_lcdc.h" #include "beaglebone-black.h" #ifdef HAVE_LCD @@ -56,15 +57,19 @@ * Private Function Prototypes ****************************************************************************/ +#ifdef HAVE_TDA19988 static int am335x_attach(const struct tda19988_lower_s *lower, xcpt_t handler, void *arg); static int am335x_enable(const struct tda19988_lower_s *lower, bool enable); +#endif /**************************************************************************** * Private Data ****************************************************************************/ +#ifdef HAVE_TDA19988 static const strurct tda19988_lower_s g_lower; +#endif /**************************************************************************** * Private Functions @@ -78,10 +83,14 @@ static const strurct tda19988_lower_s g_lower; * ****************************************************************************/ +#ifdef HAVE_TDA19988 static int am335x_attach(const struct tda19988_lower_s *lower, xcpt_t handler, void *arg) { +#warning Missing logic + return -ENOSYS; } +#endif /**************************************************************************** * Name: am335x_enable @@ -91,9 +100,13 @@ static int am335x_attach(const struct tda19988_lower_s *lower, * ****************************************************************************/ +#ifdef HAVE_TDA19988 static int am335x_enable(const struct tda19988_lower_s *lower, bool enable) { +#warning Missing logic + return -ENOSYS; } +#endif /**************************************************************************** * Public Functions @@ -103,7 +116,8 @@ static int am335x_enable(const struct tda19988_lower_s *lower, bool enable) * Name: up_fbinitialize * * Description: - * Initialize the LCD. This involves: + * Initialize the LCD. If support for the TDA19988 HDMI controller is + * enabled, then this involves: * * 1. Initializing the TDA19988 HDMI controller driver * 2. Reading EDID data from the connected monitor @@ -111,10 +125,18 @@ static int am335x_enable(const struct tda19988_lower_s *lower, bool enable) * 4. Initializing the LCD controller using this video mode * 5. Initializing the HDMI controller using the video mode * + * Otherwise, a default video mode is used to initialize the LCD + * controller. + * ****************************************************************************/ -void up_fbinitialize(int display) +int up_fbinitialize(int display) { + FAR const struct edid_videomode_s *videomode; + struct am335x_panel_info_s panel; + int ret; + +#ifdef HAVE_TDA19988 /* Initialize the TDA19988 GPIO interrupt input */ /* Initialize the TDA19988 lower half state instance */ /* Initialize the TDA19988 HDMI controller driver */ @@ -122,10 +144,41 @@ void up_fbinitialize(int display) /* Read raw EDID data from the connected monitor */ /* Select a compatible video mode from the EDID data */ /* Free the allocated EDID buffer */ + +#warning Missing logic +#else + /* Lookup the video mode corresponding to the default video mode */ + + videomode = edid_mode_lookup(CONFIG_BEAGLEBONE_VIDEOMODE); + if (videomode == NULL) + { + lcderr("ERROR: Videomode \"%s\" is not supported.\n", + CONFIG_BEAGLEBONE_VIDEOMODE); + return -ENOTSUP; + } + +#endif /* Convert the video mode to a AM335X LCD panel configuration */ + + am335x_lcd_videomode(videomode, &panel); + /* Initialize the LCD controller using this video mode */ + + ret = am335x_lcd_initialize(&panel); + if (ret < 0) + { + lcderr("ERROR: am335x_lcd_initialize() failed: %d\n", ret); + return ret; + } + +#ifdef HAVE_TDA19988 /* Convert the EDID video mode to a TDA19988 video mode */ /* Initialize the HDMI controller using the TDA19988 video mode */ + +#warning Missing logic +#endif + + return OK; } #endif /* HAVE_LCD */ diff --git a/configs/beaglebone-black/src/beaglebone-black.h b/configs/beaglebone-black/src/beaglebone-black.h index 1b0f430aed0..9a997b21ebe 100644 --- a/configs/beaglebone-black/src/beaglebone-black.h +++ b/configs/beaglebone-black/src/beaglebone-black.h @@ -56,16 +56,25 @@ /* LCD ******************************************************************************/ -#define HAVE_LCD 1 -#if !defined(CONFIG_AM335X_LCDC) || !defined(CONFIG_VIDEO_EDID) || \ - !defined(CONFIG_LCD_TDA19988) || !defined(CONFIG_AM335X_I2C2) +#define HAVE_LCD 1 +#define HAVE_TDA19988 1 + +#if !defined(CONFIG_AM335X_LCDC) || !defined(CONFIG_VIDEO_EDID) # undef HAVE_LCD +# undef HAVE_TDA19988 +#elif !defined(CONFIG_LCD_TDA19988) || !defined(CONFIG_AM335X_I2C2) +# undef HAVE_TDA19988 +# if !defined(CONFIG_BEAGLEBONE_VIDEOMODE) +# define CONFIG_BEAGLEBONE_VIDEOMODE "640x480x60" +# endif #endif -#define TDA19988_I2CBUS 2 -#define TDA19988_HDMI_I2CADDR 0x70 -#define TDA19988_CEC_I2CADDR 0x34 -#define TDA19988_I2CFREQUENCY 400000 +#if defined(HAVE_LCD) +# define TDA19988_I2CBUS 2 +# define TDA19988_HDMI_I2CADDR 0x70 +# define TDA19988_CEC_I2CADDR 0x34 +# define TDA19988_I2CFREQUENCY 400000 +#endif /* LEDs *****************************************************************************/ diff --git a/configs/makerlisp/README.txt b/configs/makerlisp/README.txt index 0f43fab23bb..a80490c2139 100644 --- a/configs/makerlisp/README.txt +++ b/configs/makerlisp/README.txt @@ -384,10 +384,11 @@ Configuration Subdirectories You can debug the all RAM version using ZDS-II as follows: a. Connect to the debugger, - b. Load the nuttx.lod file + b. Reset, Go, and Break. This will initialize the external RAM + c. Break and Load the nuttx.lod file c. Set the PC to 0x040000 d. Single step a few times to make sure things look good, then - e. "GO" + e. Go 5. Optimizations: @@ -415,7 +416,7 @@ Configuration Subdirectories configuration. Not yet verified. 2019-07-09: The RAM version does not run! I can single step through - the initialization and all looks well, but when I "GO", the system + the initialization and all looks well, but when I "Go", the system crashes. The PC is sitting at a crazy address when I break in. I have not yet debugged this.