sunxi: HDMI (cfb) console support
Subsystems (3)
v2 cover sunxi: HDMI (cfb) console support
Hi All,
Here is v2 of the (cleaned up) version of the hdmi support series for sunxi. I'm not resending the first 2 patches as those got acked in v1.
Changes in the remaining patches:
-"sunxi: video: Add cfb console driver for sunxi"
-Add CONFIG_VIDEO=n to A13 boards, as they have no hdmi out -Merge in some of the #if foo #define CONFIG_FOO changes done in
"sunxi: Add usb keyboard Kconfig option", as those ended up undoing a bunch of changes done here
-"sunxi: video: Add sun6i support"
-No changes
-"sunxi: video: Add simplefb support"
-Use fdt_setprop_string for strings
-"sunxi: Add usb keyboard Kconfig option"
-Add CONFIG_USB_KEYBOARD=n to A13 boards, as having a usb keyboard makes
little sense when not having any form of video output working
-Dropped the Kconfig changes merged into
"sunxi: video: Add cfb console driver for sunxi"
Regards,
Hans
PATCH v2 1/4 sunxi: video: Add cfb console driver for sunxi
From: Luc Verhaegen <[email protected]>
This adds a fixed mode hdmi driver for the sunxi platform. The fixed mode is a relatively safe 1024x768, more complete EDID handling is currently not provided. Only HDMI is supported today.
This code is enabled when HPD detects an attached monitor.
Current config is such that 8MB is shaved off at the top of the RAM. This avoids several memory handling issues, most significant is the fact that on linux on ARM you are not allowed to remap known RAM as IO. A clued in display driver will be able to recycle this reserved RAM in future though.
cfbconsole was chosen as it provides the most important functionality: a working u-boot console, allowing for the debugging of certain issues without the need for a UART.
--- arch/arm/include/asm/arch-sunxi/display.h | 198 +++++++++++++++ board/sunxi/Kconfig | 7 + configs/A13-OLinuXinoM_defconfig | 1 + configs/A13-OLinuXino_defconfig | 1 + configs/Ippo_q8h_v5_defconfig | 1 + drivers/video/Makefile | 1 + drivers/video/sunxi_display.c | 387 ++++++++++++++++++++++++++++++ include/configs/sunxi-common.h | 41 ++++ 8 files changed, 637 insertions(+) create mode 100644 arch/arm/include/asm/arch-sunxi/display.h create mode 100644 drivers/video/sunxi_display.c
arch/arm/include/asm/arch-sunxi/display.h new file +198 -0
@@ -0,0 +1,198 @@ +/* +* Sunxi platform display controller register and constant defines +* +* (C) Copyright 2014 Hans de Goede <[email protected]> +* +* SPDX-License-Identifier: GPL-2.0+ +*/ + +#ifndef _SUNXI_DISPLAY_H +#define _SUNXI_DISPLAY_H + +struct sunxi_de_be_reg { +u8 res0[0x800 ];/* 0x000 */ +u32 mode;/* 0x800 */ +u32 backcolor;/* 0x804 */ +u32 disp_size;/* 0x808 */ +u8 res1[0x4 ];/* 0x80c */ +u32 layer0_size;/* 0x810 */ +u32 layer1_size;/* 0x814 */ +u32 layer2_size;/* 0x818 */ +u32 layer3_size;/* 0x81c */ +u32 layer0_pos;/* 0x820 */ +u32 layer1_pos;/* 0x824 */ +u32 layer2_pos;/* 0x828 */ +u32 layer3_pos;/* 0x82c */ +u8 res2[0x10 ];/* 0x830 */ +u32 layer0_stride;/* 0x840 */ +u32 layer1_stride;/* 0x844 */ +u32 layer2_stride;/* 0x848 */ +u32 layer3_stride;/* 0x84c */ +u32 layer0_addr_low32b;/* 0x850 */ +u32 layer1_addr_low32b;/* 0x854 */ +u32 layer2_addr_low32b;/* 0x858 */ +u32 layer3_addr_low32b;/* 0x85c */ +u32 layer0_addr_high4b;/* 0x860 */ +u32 layer1_addr_high4b;/* 0x864 */ +u32 layer2_addr_high4b;/* 0x868 */ +u32 layer3_addr_high4b;/* 0x86c */ +u32 reg_ctrl;/* 0x870 */ +u8 res3[0xc ];/* 0x874 */ +u32 color_key_max;/* 0x880 */ +u32 color_key_min;/* 0x884 */ +u32 color_key_config;/* 0x888 */ +u8 res4[0x4 ];/* 0x88c */ +u32 layer0_attr0_ctrl;/* 0x890 */ +u32 layer1_attr0_ctrl;/* 0x894 */ +u32 layer2_attr0_ctrl;/* 0x898 */ +u32 layer3_attr0_ctrl;/* 0x89c */ +u32 layer0_attr1_ctrl;/* 0x8a0 */ +u32 layer1_attr1_ctrl;/* 0x8a4 */ +u32 layer2_attr1_ctrl;/* 0x8a8 */ +u32 layer3_attr1_ctrl;/* 0x8ac */ +}; + +struct sunxi_lcdc_reg { +u32 ctrl;/* 0x00 */ +u32 int0;/* 0x04 */ +u32 int1;/* 0x08 */ +u8 res0[0x04 ];/* 0x0c */ +u32 frame_ctrl;/* 0x10 */ +u8 res1[0x2c ];/* 0x14 */ +u32 tcon0_ctrl;/* 0x40 */ +u32 tcon0_dclk;/* 0x44 */ +u32 tcon0_basic_timing0;/* 0x48 */ +u32 tcon0_basic_timing1;/* 0x4c */ +u32 tcon0_basic_timing2;/* 0x50 */ +u32 tcon0_basic_timing3;/* 0x54 */ +u32 tcon0_hv_intf;/* 0x58 */ +u8 res2[0x04 ];/* 0x5c */ +u32 tcon0_cpu_intf;/* 0x60 */ +u32 tcon0_cpu_wr_dat;/* 0x64 */ +u32 tcon0_cpu_rd_dat0;/* 0x68 */ +u32 tcon0_cpu_rd_dat1;/* 0x6c */ +u32 tcon0_ttl_timing0;/* 0x70 */ +u32 tcon0_ttl_timing1;/* 0x74 */ +u32 tcon0_ttl_timing2;/* 0x78 */ +u32 tcon0_ttl_timing3;/* 0x7c */ +u32 tcon0_ttl_timing4;/* 0x80 */ +u32 tcon0_lvds_intf;/* 0x84 */ +u32 tcon0_io_polarity;/* 0x88 */ +u32 tcon0_io_tristate;/* 0x8c */ +u32 tcon1_ctrl;/* 0x90 */ +u32 tcon1_timing_source;/* 0x94 */ +u32 tcon1_timing_scale;/* 0x98 */ +u32 tcon1_timing_out;/* 0x9c */ +u32 tcon1_timing_h;/* 0xa0 */ +u32 tcon1_timing_v;/* 0xa4 */ +u32 tcon1_timing_sync;/* 0xa8 */ +u8 res3[0x44 ];/* 0xac */ +u32 tcon1_io_polarity;/* 0xf0 */ +u32 tcon1_io_tristate;/* 0xf4 */ +}; + +#define SUNXI_HDMI_CTRL 0x004 +#define SUNXI_HDMI_INT_CTRL 0x008 +#define SUNXI_HDMI_HPD 0x00c +#define SUNXI_HDMI_VIDEO_CTRL 0x010 +#define SUNXI_HDMI_VIDEO_SIZE 0x014 +#define SUNXI_HDMI_VIDEO_BP 0x018 +#define SUNXI_HDMI_VIDEO_FP 0x01c +#define SUNXI_HDMI_VIDEO_SPW 0x020 +#define SUNXI_HDMI_VIDEO_POLARITY 0x024 +#define SUNXI_HDMI_TX_DRIVER0 0x200 +#define SUNXI_HDMI_TX_DRIVER1 0x204 +#define SUNXI_HDMI_TX_DRIVER2 0x208 +#define SUNXI_HDMI_TX_DRIVER3 0x20C +struct sunxi_hdmi_reg { +u32 version_id;/* 0x000 */ +u32 ctrl;/* 0x004 */ +u32 irq;/* 0x008 */ +u32 hpd;/* 0x00c */ +u32 video_ctrl;/* 0x010 */ +u32 video_size;/* 0x014 */ +u32 video_bp;/* 0x018 */ +u32 video_fp;/* 0x01c */ +u32 video_spw;/* 0x020 */ +u32 video_polarity;/* 0x024 */ +u8 res0[0x1d8 ];/* 0x028 */ +u32 pad_ctrl0;/* 0x200 */ +u32 pad_ctrl1;/* 0x204 */ +u32 pll_ctrl;/* 0x208 */ +u32 pll_dbg0;/* 0x20c */ +}; + +/* +* DE-BE register constants. +*/ +#define SUNXI_DE_BE_WIDTH (x) (((x) - 1) << 0) +#define SUNXI_DE_BE_HEIGHT (y) (((y) - 1) << 16) +#define SUNXI_DE_BE_MODE_ENABLE (1 << 0) +#define SUNXI_DE_BE_MODE_START (1 << 1) +#define SUNXI_DE_BE_MODE_LAYER0_ENABLE (1 << 8) +#define SUNXI_DE_BE_LAYER_STRIDE (x) ((x) << 5) +#define SUNXI_DE_BE_REG_CTRL_LOAD_REGS (1 << 0) +#define SUNXI_DE_BE_LAYER_ATTR1_FMT_XRGB8888 (0x09 << 8) + +/* +* LCDC register constants. +*/ +#define SUNXI_LCDC_X (x) (((x) - 1) << 16) +#define SUNXI_LCDC_Y (y) (((y) - 1) << 0) +#define SUNXI_LCDC_CTRL_IO_MAP_MASK (1 << 0) +#define SUNXI_LCDC_CTRL_IO_MAP_TCON0 (0 << 0) +#define SUNXI_LCDC_CTRL_IO_MAP_TCON1 (1 << 0) +#define SUNXI_LCDC_CTRL_TCON_ENABLE (1 << 31) +#define SUNXI_LCDC_TCON0_DCLK_ENABLE (0xf << 28) +#define SUNXI_LCDC_TCON1_CTRL_CLK_DELAY (n) (((n) & 0x1f) << 4) +#define SUNXI_LCDC_TCON1_CTRL_ENABLE (1 << 31) +#define SUNXI_LCDC_TCON1_TIMING_H_BP (n) (((n) - 1) << 0) +#define SUNXI_LCDC_TCON1_TIMING_H_TOTAL (n) (((n) - 1) << 16) +#define SUNXI_LCDC_TCON1_TIMING_V_BP (n) (((n) - 1) << 0) +#define SUNXI_LCDC_TCON1_TIMING_V_TOTAL (n) (((n) * 2) << 16) + +/* +* HDMI register constants. +*/ +#define SUNXI_HDMI_X (x) (((x) - 1) << 0) +#define SUNXI_HDMI_Y (y) (((y) - 1) << 16) +#define SUNXI_HDMI_CTRL_ENABLE (1 << 31) +#define SUNXI_HDMI_IRQ_STATUS_FIFO_UF (1 << 0) +#define SUNXI_HDMI_IRQ_STATUS_FIFO_OF (1 << 1) +#define SUNXI_HDMI_IRQ_STATUS_BITS 0x73 +#define SUNXI_HDMI_HPD_DETECT (1 << 0) +#define SUNXI_HDMI_VIDEO_CTRL_ENABLE (1 << 31) +#define SUNXI_HDMI_VIDEO_POL_HOR (1 << 0) +#define SUNXI_HDMI_VIDEO_POL_VER (1 << 1) +#define SUNXI_HDMI_VIDEO_POL_TX_CLK (0x3e0 << 16) + +#ifdef CONFIG_MACH_SUN6I +#define SUNXI_HDMI_PAD_CTRL0_HDP 0x7e80000f +#define SUNXI_HDMI_PAD_CTRL0_RUN 0x7e8000ff +#else +#define SUNXI_HDMI_PAD_CTRL0_HDP 0xfe800000 +#define SUNXI_HDMI_PAD_CTRL0_RUN 0xfe800000 +#endif + +#ifdef CONFIG_MACH_SUN4I +#define SUNXI_HDMI_PAD_CTRL1 0x00d8c820 +#elif definedCONFIG_MACH_SUN6I +#define SUNXI_HDMI_PAD_CTRL1 0x01ded030 +#else +#define SUNXI_HDMI_PAD_CTRL1 0x00d8c830 +#endif +#define SUNXI_HDMI_PAD_CTRL1_HALVE (1 << 6) + +#ifdef CONFIG_MACH_SUN6I +#define SUNXI_HDMI_PLL_CTRL 0xba48a308 +#define SUNXI_HDMI_PLL_CTRL_DIV (n) (((n) - 1) << 4) +#else +#define SUNXI_HDMI_PLL_CTRL 0xfa4ef708 +#define SUNXI_HDMI_PLL_CTRL_DIV (n) ((n) << 4) +#endif +#define SUNXI_HDMI_PLL_CTRL_DIV_MASK (0xf << 4) + +#define SUNXI_HDMI_PLL_DBG0_PLL3 (0 << 21) +#define SUNXI_HDMI_PLL_DBG0_PLL7 (1 << 21) + +#endif /* _SUNXI_DISPLAY_H */
board/sunxi/Kconfig +7 -0
@@ -216,4 +216,11 @@ config USB2_VBUS_PIN ---help--- See USB1_VBUS_PIN help text. +config VIDEO + boolean "Enable graphical uboot console on HDMI" + default y + ---help--- + Say Y here to add support for using a cfb console on the HDMI output + found on most sunxi devices. + endif
configs/A13-OLinuXinoM_defconfig +1 -0
@@ -2,6 +2,7 @@ CONFIG_SPL=y CONFIG_SYS_EXTRA_OPTIONS="CONS_INDEX=2,USB_EHCI" CONFIG_FDTFILE="sun5i-a13-olinuxino-micro.dtb" CONFIG_USB1_VBUS_PIN="PG11" +CONFIG_VIDEO=n +S:CONFIG_ARM=y +S:CONFIG_ARCH_SUNXI=y +S:CONFIG_MACH_SUN5I=y
configs/A13-OLinuXino_defconfig +1 -0
@@ -2,6 +2,7 @@ CONFIG_SPL=y CONFIG_SYS_EXTRA_OPTIONS="CONS_INDEX=2,AXP209_POWER,USB_EHCI" CONFIG_FDTFILE="sun5i-a13-olinuxino.dtb" CONFIG_USB1_VBUS_PIN="PG11" +CONFIG_VIDEO=n +S:CONFIG_ARM=y +S:CONFIG_ARCH_SUNXI=y +S:CONFIG_MACH_SUN5I=y
configs/Ippo_q8h_v5_defconfig +1 -0
@@ -4,3 +4,4 @@ CONFIG_ARCH_SUNXI=y CONFIG_MACH_SUN8I=y CONFIG_TARGET_IPPO_Q8H_V5=y CONFIG_DEFAULT_DEVICE_TREE="sun8i-a23-ippo-q8h-v5.dtb" +CONFIG_VIDEO=n
drivers/video/Makefile +1 -0
@@ -39,6 +39,7 @@ obj-$(CONFIG_VIDEO_SANDBOX_SDL) += sandbox_sdl.o obj-$(CONFIG_VIDEO_SED13806) += sed13806.o obj-$(CONFIG_VIDEO_SM501) += sm501.o obj-$(CONFIG_VIDEO_SMI_LYNXEM) += smiLynxEM.o videomodes.o +obj-$(CONFIG_VIDEO_SUNXI) += sunxi_display.o obj-$(CONFIG_VIDEO_TEGRA) += tegra.o obj-$(CONFIG_VIDEO_VCXK) += bus_vcxk.o obj-$(CONFIG_FORMIKE) += formike.o
drivers/video/sunxi_display.c new file +387 -0
387 lines not on this page · raw message
include/configs/sunxi-common.h +41 -0
60 lines not on this page · raw message
Signature · 1 line
2.1.0
PATCH v2 2/4 sunxi: video: Add sun6i support
In reply to Hans de GoedeBesided needing the usual sun6i specific ahb1_reset bits poking, it turns out that sun6i also needs the drc to be taken out of reset and clocked even though it is in pass-through mode.
--- drivers/video/sunxi_display.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+)
drivers/video/sunxi_display.c +31 -0
@@ -39,6 +39,9 @@ sunxi_hdmi_hpd_detect(void) CCM_HDMI_CTRL_PLL3);/* Set ahb gating to pass */ +#ifdef CONFIG_MACH_SUN6I +setbits_le32 (&ccm->ahb_reset1_cfg,1 <<AHB_RESET_OFFSET_HDMI ); +#endif setbits_le32 (&ccm->ahb_gate1,1 <<AHB_GATE_OFFSET_HDMI );/* Clock on */
@@ -56,6 +59,9 @@ sunxi_hdmi_hpd_detect(void)clrbits_le32 (&hdmi->ctrl,SUNXI_HDMI_CTRL_ENABLE );clrbits_le32 (&ccm->hdmi_clk_cfg,CCM_HDMI_CTRL_GATE );clrbits_le32 (&ccm->ahb_gate1,1 <<AHB_GATE_OFFSET_HDMI ); +#ifdef CONFIG_MACH_SUN6I +clrbits_le32 (&ccm->ahb_reset1_cfg,1 <<AHB_RESET_OFFSET_HDMI ); +#endif clock_set_pll3 (0 );return 0 ;
@@ -74,6 +80,11 @@ sunxi_composer_init(void) (struct sunxi_de_be_reg *)SUNXI_DE_BE0_BASE ;int i; +#ifdef CONFIG_MACH_SUN6I +/* Reset off */ +setbits_le32 (&ccm->ahb_reset1_cfg,1 <<AHB_RESET_OFFSET_DE_BE0 ); +#endif +/* Clocks on */ setbits_le32 (&ccm->ahb_gate1,1 <<AHB_GATE_OFFSET_DE_BE0 );setbits_le32 (&ccm->dram_clk_gate,1 <<CCM_DRAM_GATE_OFFSET_DE_BE0 );
@@ -175,7 +186,11 @@ sunxi_lcdc_init(void) (struct sunxi_lcdc_reg *)SUNXI_LCD0_BASE ;/* Reset off */ +#ifdef CONFIG_MACH_SUN6I +setbits_le32 (&ccm->ahb_reset1_cfg,1 <<AHB_RESET_OFFSET_LCD0 ); +#else setbits_le32 (&ccm->lcd0_ch0_clk_cfg,CCM_LCD_CH0_CTRL_RST ); +#endif /* Clock on */ setbits_le32 (&ccm->ahb_gate1,1 <<AHB_GATE_OFFSET_LCD0 );
@@ -230,6 +245,19 @@ sunxi_lcdc_mode_set(struct fb_videomode *mode, int *clk_div, int *clk_double)sunxi_lcdc_pll_set (mode->pixclock, clk_div, clk_double); } +#ifdef CONFIG_MACH_SUN6I +static void +sunxi_drc_init (void ) +{ +struct sunxi_ccm_reg *const ccm = + (struct sunxi_ccm_reg *)SUNXI_CCM_BASE ; + +/* On sun6i the drc must be clocked even when in pass-through mode */ +setbits_le32 (&ccm->ahb_reset1_cfg,1 <<AHB_RESET_OFFSET_DRC0 ); +clock_set_de_mod_clock (&ccm->iep_drc0_clk_cfg,300000000 ); +} +#endif +static void sunxi_hdmi_mode_set (struct fb_videomode *mode,int clk_div,int clk_double) {
@@ -281,6 +309,9 @@ sunxi_engines_init(void) {sunxi_composer_init ();sunxi_lcdc_init (); +#ifdef CONFIG_MACH_SUN6I +sunxi_drc_init (); +#endif } static void
Signature · 1 line
2.1.0
PATCH v2 3/4 sunxi: video: Add simplefb support
In reply to Hans de GoedeFrom: Luc Verhaegen <[email protected]>
Add simplefb support, note this depends on the kernel having support for the clocks property which has recently been added to the simplefb devicetree binding.
[hdegoede at redhat.com: Use pre-populated simplefb node under /chosen as
disussed on the devicetree list]
--- arch/arm/include/asm/arch-sunxi/display.h | 4 ++ board/sunxi/board.c | 11 ++++++ drivers/video/sunxi_display.c | 64 +++++++++++++++++++++++++++++++ include/configs/sunxi-common.h | 8 ++++ 4 files changed, 87 insertions(+)
arch/arm/include/asm/arch-sunxi/display.h +4 -0
@@ -195,4 +195,8 @@ struct sunxi_hdmi_reg {#define SUNXI_HDMI_PLL_DBG0_PLL3 (0 << 21)#define SUNXI_HDMI_PLL_DBG0_PLL7 (1 << 21) +#ifdef CONFIG_VIDEO_DT_SIMPLEFB +void sunxi_simplefb_setup (void *blob); +#endif +#endif /* _SUNXI_DISPLAY_H */
board/sunxi/board.c +11 -0
@@ -24,6 +24,7 @@#endif #include <asm/arch/clock.h> #include <asm/arch/cpu.h> +#include <asm/arch/display.h> #include <asm/arch/dram.h> #include <asm/arch/gpio.h> #include <asm/arch/mmc.h>
@@ -237,3 +238,13 @@ int misc_init_r(void) return 0; }#endif + +#ifdef CONFIG_OF_BOARD_SETUP +void +ft_board_setup (void *blob,bd_t *bd) +{ +#ifdef CONFIG_VIDEO_DT_SIMPLEFB +sunxi_simplefb_setup (blob); +#endif +} +#endif /* CONFIG_OF_BOARD_SETUP */
drivers/video/sunxi_display.c +64 -0
73 lines not on this page · raw message
include/configs/sunxi-common.h +8 -0
@@ -204,6 +204,9 @@*/ #define CONFIG_SUNXI_FB_SIZE (8 << 20) +/* Do we want to initialize a simple FB? */ +#define CONFIG_VIDEO_DT_SIMPLEFB +#define CONFIG_VIDEO_SUNXI #define CONFIG_CFB_CONSOLE
@@ -217,6 +220,11 @@#define CONFIG_SYS_MEM_TOP_HIDE ((CONFIG_SUNXI_FB_SIZE + 0xFFF) & ~0xFFF) +/* To be able to hook simplefb into dt */ +#ifdef CONFIG_VIDEO_DT_SIMPLEFB +#define CONFIG_OF_BOARD_SETUP +#endif +#endif /* CONFIG_VIDEO */ /* Ethernet support */
Signature · 1 line
2.1.0
PATCH v2 4/4 sunxi: Add usb keyboard Kconfig option
In reply to Hans de GoedeFor use together with the hdmi console.
--- board/sunxi/Kconfig | 7 +++++++ configs/A13-OLinuXinoM_defconfig | 1 + configs/A13-OLinuXino_defconfig | 1 + configs/Ippo_q8h_v5_defconfig | 1 + include/configs/sunxi-common.h | 13 +++++++++++++ 5 files changed, 23 insertions(+)
board/sunxi/Kconfig +7 -0
@@ -223,4 +223,11 @@ config VIDEO Say Y here to add support for using a cfb console on the HDMI output found on most sunxi devices. +config USB_KEYBOARD + boolean "Enable USB keyboard support" + default y + ---help--- + Say Y here to add support for using a USB keyboard (typically used + in combination with a graphical console on HDMI). + endif
configs/A13-OLinuXinoM_defconfig +1 -0
@@ -3,6 +3,7 @@ CONFIG_SYS_EXTRA_OPTIONS="CONS_INDEX=2,USB_EHCI" CONFIG_FDTFILE="sun5i-a13-olinuxino-micro.dtb" CONFIG_USB1_VBUS_PIN="PG11" CONFIG_VIDEO=n +CONFIG_USB_KEYBOARD=n +S:CONFIG_ARM=y +S:CONFIG_ARCH_SUNXI=y +S:CONFIG_MACH_SUN5I=y
configs/A13-OLinuXino_defconfig +1 -0
@@ -3,6 +3,7 @@ CONFIG_SYS_EXTRA_OPTIONS="CONS_INDEX=2,AXP209_POWER,USB_EHCI" CONFIG_FDTFILE="sun5i-a13-olinuxino.dtb" CONFIG_USB1_VBUS_PIN="PG11" CONFIG_VIDEO=n +CONFIG_USB_KEYBOARD=n +S:CONFIG_ARM=y +S:CONFIG_ARCH_SUNXI=y +S:CONFIG_MACH_SUN5I=y
configs/Ippo_q8h_v5_defconfig +1 -0
@@ -5,3 +5,4 @@ CONFIG_MACH_SUN8I=y CONFIG_TARGET_IPPO_Q8H_V5=y CONFIG_DEFAULT_DEVICE_TREE="sun8i-a23-ippo-q8h-v5.dtb" CONFIG_VIDEO=n +CONFIG_USB_KEYBOARD=n
include/configs/sunxi-common.h +13 -0
@@ -247,6 +247,13 @@#define CONFIG_USB_STORAGE #endif +#ifdef CONFIG_USB_KEYBOARD +#define CONFIG_CONSOLE_MUX +#define CONFIG_PREBOOT +#define CONFIG_SYS_STDIO_DEREGISTER +#define CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE +#endif + #if !defined CONFIG_ENV_IS_IN_MMC && \ !defined CONFIG_ENV_IS_IN_NAND && \ !defined CONFIG_ENV_IS_IN_FAT && \
@@ -297,8 +304,14 @@#include <config_distro_bootcmd.h> +#ifdef CONFIG_USB_KEYBOARD +#define CONSOLE_STDIN_SETTINGS \ + "preboot=run usb_init\0" \ + "stdin=serial,usbkbd\0" +#else #define CONSOLE_STDIN_SETTINGS \ "stdin=serial\0" +#endif #ifdef CONFIG_VIDEO #define CONSOLE_STDOUT_SETTINGS \
Signature · 1 line
2.1.0
PATCH v2 4/4 sunxi: Add usb keyboard Kconfig option
Quoted 3 lines · Hans de Goede
For use together with the hdmi console.
Signed-off-by Hans de Goede <[email protected]>
Quoted 90 lines
--- board/sunxi/Kconfig | 7 +++++++ configs/A13-OLinuXinoM_defconfig | 1 + configs/A13-OLinuXino_defconfig | 1 + configs/Ippo_q8h_v5_defconfig | 1 + include/configs/sunxi-common.h | 13 +++++++++++++ 5 files changed, 23 insertions(+)board/sunxi/Kconfig +7
-0@@ -223,4 +223,11 @@ config VIDEO Say Y here to add support for using a cfb console on the HDMI output found on most sunxi devices. +config USB_KEYBOARD + boolean "Enable USB keyboard support" + default y + ---help--- + Say Y here to add support for using a USB keyboard (typically used + in combination with a graphical console on HDMI). + endifconfigs/A13-OLinuXinoM_defconfig +1
-0@@ -3,6 +3,7 @@ CONFIG_SYS_EXTRA_OPTIONS="CONS_INDEX=2,USB_EHCI" CONFIG_FDTFILE="sun5i-a13-olinuxino-micro.dtb" CONFIG_USB1_VBUS_PIN="PG11" CONFIG_VIDEO=n +CONFIG_USB_KEYBOARD=n +S:CONFIG_ARM=y +S:CONFIG_ARCH_SUNXI=y +S:CONFIG_MACH_SUN5I=yconfigs/A13-OLinuXino_defconfig +1
-0@@ -3,6 +3,7 @@ CONFIG_SYS_EXTRA_OPTIONS="CONS_INDEX=2,AXP209_POWER,USB_EHCI" CONFIG_FDTFILE="sun5i-a13-olinuxino.dtb" CONFIG_USB1_VBUS_PIN="PG11" CONFIG_VIDEO=n +CONFIG_USB_KEYBOARD=n +S:CONFIG_ARM=y +S:CONFIG_ARCH_SUNXI=y +S:CONFIG_MACH_SUN5I=yconfigs/Ippo_q8h_v5_defconfig +1
-0@@ -5,3 +5,4 @@ CONFIG_MACH_SUN8I=y CONFIG_TARGET_IPPO_Q8H_V5=y CONFIG_DEFAULT_DEVICE_TREE="sun8i-a23-ippo-q8h-v5.dtb" CONFIG_VIDEO=n +CONFIG_USB_KEYBOARD=ninclude/configs/sunxi-common.h +13
-0@@ -247,6 +247,13 @@#define CONFIG_USB_STORAGE #endif +#ifdef CONFIG_USB_KEYBOARD +#define CONFIG_CONSOLE_MUX +#define CONFIG_PREBOOT +#define CONFIG_SYS_STDIO_DEREGISTER +#define CONFIG_SYS_USB_EVENT_POLL_VIA_INT_QUEUE +#endif + #if !defined CONFIG_ENV_IS_IN_MMC && \ !defined CONFIG_ENV_IS_IN_NAND && \ !defined CONFIG_ENV_IS_IN_FAT && \@@ -297,8 +304,14 @@#include <config_distro_bootcmd.h> +#ifdef CONFIG_USB_KEYBOARD +#define CONSOLE_STDIN_SETTINGS \ + "preboot=run usb_init\0" \ + "stdin=serial,usbkbd\0" +#else #define CONSOLE_STDIN_SETTINGS \ "stdin=serial\0" +#endif #ifdef CONFIG_VIDEO #define CONSOLE_STDOUT_SETTINGS \